potinho
Advanced OT User
I have a vip script that works great and gives the player 30 days of VIP. I would like to create a command (talkaction) that the player can see how much VIP time he still has.
Follow my VIP scroll action:
Follow my VIP scroll action:
Lua:
local vipStorage = 30009
local vipDays = 30
function onUse(cid, item, fromPosition, itemEx, toPosition)
local currentTime, vipStorageValue = os.time(), getPlayerStorageValue(cid, vipStorage)
setPlayerStorageValue(cid, vipStorage, (vipStorageValue < currentTime and currentTime or vipStorageValue) + (60 * 60 * 24 * vipDays))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you've added " .. vipDays .. " VIP days to this account!")
doRemoveItem(item.uid, 1)
return true
end