kozmo
Member
- Joined
- Jan 30, 2009
- Messages
- 443
- Solutions
- 2
- Reaction score
- 23
Paying someone to add exp bonus and checkviptime command for this,
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
local viptimestorage = 15001
local itemid = 2148
local vipdays = 10
local left = os.date("%d", player:getStorageValue(viptimestorage) - os.time())
if player:getItemCount(itemid) == 0 then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You don't have an item.")
elseif player:getStorageValue(viptimestorage) >= os.time() then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You still have " .. left .. " VIP Days.")
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You got VIP " .. vipdays .. " days.")
player:setStorageValue(viptimestorage, os.time() + vipdays * 60 * 60 * 24)
doRemoveItem(item.uid, 1)
end
return true
end
Last edited: