darknelson
Member
- Joined
- Jun 19, 2011
- Messages
- 190
- Solutions
- 1
- Reaction score
- 15
im trying to make a lever when u use it, it add to you 2 vip days, only if you never geting, just once, i make this script, but is not working no error on console
tfs 0.4
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config={
removeOnUse = "no" -- remover quando usar ("yes" or "no")
}
local days = 2 -- coloque os dias que ser�o a VIP!
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, 13702)
local timenow = os.time()
time = timenow + daysvalue
time = storageplayer + daysvalue
end
if getPlayerStorageValue(cid, 82082) == -1 then
setPlayerStorageValue(cid, 13702, time)
setPlayerStorageValue(cid, 82082, 1)
local quantity = math.floor((getPlayerStorageValue(cid, 13702) - timenow)/(24 * 60 * 60))
doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Felicidades Amigo ".. days .." dias de VIP fueron agregados a tu cuenta.")
if (config.removeOnUse == "yes") then
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid,22,"NO MEN YA TOMASTE VIP.")
end
return TRUE
end
tfs 0.4