I make a script that player can pass to area vip based on storage 13540, but i want that the player losses 1 storage point per day
ex: When vip activated the player has 30 storagevalue, but a want that decrease every day,like a premium, how i would do that?
ex: When vip activated the player has 30 storagevalue, but a want that decrease every day,like a premium, how i would do that?
PHP:
function onSay(cid, words, param)
local acess = getPlayerAccess(cid)
local player = getPlayerByName(param)
local storage = getPlayerStorageValue(player, 13540)
local time = 30 * 24 * 60 * 60 * 1000
if words == '/addvip' and acess >= 3 and param ~= '' and storage < 1 then
setPlayerStorageValue(player, 13540, 30)
doPlayerSendTextMessage(player, 20, 'You are vip now!')
doPlayerSendTextMessage(cid,21,'You have added a vip to ' .. param .. '.')
addEvent(endvip, time, player)
elseif acess < 3 then
doPlayerSendTextMessage(cid,25,"You can't do that.")
elseif storage > 0 then
doPlayerSendTextMessage(cid,25,"This player is vip already.")
else
doPlayerSendTextMessage(cid,21,"Player doensn't exist.")
end
function endvip(player)
doPlayerSendTextMessage(player, 20, 'You time vip is over.')
setPlayerStorageValue(player, 13540, 0)
end
end