• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

VIP system storage value

zednem

New Member
Joined
Nov 15, 2008
Messages
108
Reaction score
0
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?

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
 
I have another idea without addevent but you have to write here you login.lua file.
If you have default just tell me :D
 
Ok never mind try this:
setPlayerStorageValue(player, 13540, os.clock())

login.lua
if os.clock() - getPlayerStorageValue(cid,13540) >= (time when vip time finish in seconds) then
---something---

@Sry for double post... missclick :/
 
Back
Top