I have 2 scripts that are giving vip to the player.
and i need help to fix them
1- Vip through the Store, I edited it a little and left it that.
However it seems that the Storage is not going out alone over time, I need the player to lose the storage after 30 days.
because I'm using the Storage system for doors, floors, Teleports, XP bonos and other things.
2- the Second Script is Vip through an Item.
I also want to put the same storage system that, after 30 days, the storage leaves the player.
But this is a little more confusing. he does not remove the item (17496) after the player uses it.
and i need help to fix them
1- Vip through the Store, I edited it a little and left it that.
However it seems that the Storage is not going out alone over time, I need the player to lose the storage after 30 days.
because I'm using the Storage system for doors, floors, Teleports, XP bonos and other things.
Lua:
local a = { DAYS = 30 } -- Dias de Vip
function onSay(cid, words, param, channel)
if getPlayerStorageValue(cid, 225501) == 1 then
return doPlayerSendTextMessage(cid, 20, "Você ja ainda possui VIP Account, espere o termino para ativar novamente!!")
and true
else
if getPlayerItemCount(cid, 2145) < 15 then
return doPlayerSendTextMessage(cid, 20, "Voce não tem 15 Gold Bars para realizar a compra.")
and true
end
if getPlayerItemCount(cid, 2145) >= 15 then
setPlayerStorageValue(cid, 225501, 1)
doPlayerAddPremiumDays(cid, a.DAYS)
doPlayerRemoveItem(cid, 2145, 15)
doPlayerSendTextMessage(cid, 20, "Voce recebeu "..a.DAYS.." dias de VIP Account!")
doSendMagicEffect(getCreaturePosition(cid), 28)
return true
end
end
end
2- the Second Script is Vip through an Item.
I also want to put the same storage system that, after 30 days, the storage leaves the player.
But this is a little more confusing. he does not remove the item (17496) after the player uses it.
Lua:
local a = { DAYS = 30 } ---Dias Vip
function onUse (cid, item, frompos, item2, topos, words, param)
if getPlayerStorageValue(cid, 225501) == 1 then
return doPlayerSendTextMessage(cid, 20, "Voce ja ainda possui VIP Account, espere o termino para ativar novamente!!")
and true
end
if setPlayerStorageValue(cid, 225501, 1) then
doRemoveItem(cid, 17496, 1)
doPlayerAddPremiumDays(cid, a.DAYS)
doPlayerSendTextMessage(cid, 20, "Voce ativou 30 dias de VIP Account, com areas exclusiva, +30% EXP e outros beneficios!")
doSendMagicEffect(getCreaturePosition(cid), 28)
return true
end
end