Olá.
Goastaria de um script que ele apenas checasse qts dias falta para acabar a vip.
esse é o meu scrip de vip
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config={
removeOnUse = "yes" -- remover quando usar ("yes" or "no")
}
local days = 35 -- dias que serão adicionados
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, 15000)
local timenow = os.time()
if getPlayerStorageValue(cid, 15000) - os.time() <= 0 then
time = timenow + daysvalue
else
time = storageplayer + daysvalue
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabens Você Se tornou um PLayer Vip ".. days .." dias de VIP no seu character.")
setPlayerStorageValue(cid, 15000, time)
local quantity = math.floor((getPlayerStorageValue(cid, 15000) - 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)
end
return TRUE
end
----------------------------------------------
Outro Post no msm Topico.
Gostaria de saber comoo eu posso fazer para um item que da 3 dias de vip.
Scrip que eu estou tentando usar é esse
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config={
removeOnUse = "yes" -- remover quando usar ("yes" or "no")
}
local days = 3 -- dias que serão adicionados
local daysvalue = days * 1 * 3 * 60( qual seria a contagem)
local storageplayer = getPlayerStorageValue(cid, 15000)
local timenow = os.time()
if getPlayerStorageValue(cid, 15000) - os.time() <= 0 then
time = timenow + daysvalue
else
time = storageplayer + daysvalue
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabens Você Se tornou um PLayer Vip ".. days .." dias de VIP no seu character.")
setPlayerStorageValue(cid, 15000, time)
local quantity = math.floor((getPlayerStorageValue(cid, 15000) - timenow)/(1 * 3 * 60))( qual seria a contagem)
doSendMagicEffect(getPlayerPosition(cid), math.random(1,5))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
if (config.removeOnUse == "yes") then
doRemoveItem(item.uid, 1)
end
return TRUE
end
Obrigado Me Ajudando ganha +Rep