não sei dizer, mas vou postar aqui:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config={
removeOnUse = "yes" -- remover quando usar ("yes" or "no")
}
local days = 30 -- dias que serão adicionados
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, 13704)
local timenow = os.time()
if getPlayerStorageValue(cid, 13704) - os.time() <= 0 then
time = timenow + daysvalue
else
time = storageplayer + daysvalue
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")
setPlayerStorageValue(cid, 13704, time)
local quantity = math.floor((getPlayerStorageValue(cid, 13704) - timenow)/(24 * 60 * 60))
doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
if (config.removeOnUse == "yes") then
doRemoveItem(item.uid, 1)
db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")
doPlayerSendTextMessage(cid,25,"Você será kickado em 5 segundos para mudança de nome.")
doPlayerAddAddons(cid, 1)
addEvent(doRemoveCreature, 5*1000, cid, true)
end
return TRUE
end
function onStepIn(cid, item, position, fromPosition)
local config = {
msgDenied = "Este lugar é só para vips, adquira sua vip no site..",
msgWelcome = "Bem vindo a area vip, bom up.."
}
if getPlayerStorageValue(cid, 13704) - os.time() <= 0 then
doTeleportThing(cid, fromPosition, true)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgDenied)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
return TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgWelcome)
return TRUE
end