Thats not the problem i added this function to compat.luaMissing the function doAddVipDays.
function doAddVipDays(cid, days)
db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
function doAddVipDays(cid, days)
db.query("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid))
end
function getPlayerAccountId(cid) local p = Player(cid) return p ~= nil and p:getAccountId() or false end
Post script?
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVipDays(cid) > 365 then
doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
else
doAddVipDays(cid, 30)
doCreatureSay(cid, "VIP")
doPlayerPopupFYI(cid, "We have added 30 vip days to your account!\nEnjoy it!.")
doRemoveItem(item.uid)
end
return true
end
Worked, Thanks alot!doCreatureSay(cid, "VIP", TALKTYPE_ORANGE_1)