Venn
Member
- Joined
- Aug 16, 2009
- Messages
- 547
- Reaction score
- 20
what is wrong ?
script
function
script
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local i = getPlayerVocation(cid)
if i == 5 then
vocation = "Wizard"
elseif i == 6 then
vocation = "Summoner"
elseif i == 7 then
vocation = "Assassin"
elseif i == 8 then
vocation = "Warrior"
end
if getPlayerVipDays(cid) == 0 then
doPlayerSendCancel(cid,"You need to be a vip in order to use this item.")
else
if getPlayerPromotionLevel(cid) == 1 then
setPlayerPromotionLevel(cid, 2)
doCreatureSay(cid, "You are now a "..vocation.."", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,"You need to be promoted in order to use this item.")
end
end
end
function
Code:
--- Vip functions by Kekox
function getPlayerVipDays(cid)
local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local days= Info:getDataInt("vipdays")
Info:free()
return days
end
return LUA_ERROR
end