Estevam2d Posted October 22, 2015 Posted October 22, 2015 how i can make a vip system that not is accumulative ? even i do not playing make me time lose vip . Sorry bad inglesh, i'm learning inglesh.
Tomas Posted October 22, 2015 Posted October 22, 2015 It could work VIPs = {} setTimer( function () for account, data in pairs (VIPs) do time = data.time if ( time-10000 > 0 ) then VIPs[account].data = time-10000 else VIPs[account] = nil end end end, 15000, 0) addCommandHandler("getremainingviptime", function (player) local accName = getAccountName ( getPlayerAccount(player) ) outputChatBox( VIPs[accName] and ( VIPs[accName].data.time/1000.. " seconds") or "You aren't VIP", player) end ) addCommandHandler("givevipto", function (player, cmd, accName, secs) if ( getAccount(accName) ) then if ( VIPs[accName] ) then VIPs[accName].data.time = VIPs[accName].data.time + secs*1000 else VIPs[accName] = {} VIPs[accName].data = {} VIPs[accName].data.time = {} VIPs[accName].data.time = secs*1000 end end end )
Estevam2d Posted October 24, 2015 Author Posted October 24, 2015 Everything is working, but time does not count My vip does not end VIPs = {} setTimer( function () for account, data in pairs (VIPs) do time = data.time if ( time-10000 > 0 ) then VIPs[account].data = time-10000 else VIPs[account] = nil end end end,15000,0)
Estevam2d Posted October 26, 2015 Author Posted October 26, 2015 anyone can help me ? i don't know how make this system, i'm needing very this script;.
Estevam2d Posted October 26, 2015 Author Posted October 26, 2015 have some way the save time ? i don't know use mysql and i need very save time. i managed this script and now it is working setTimer( function () for account, data in pairs (VIPs) do if ( VIPs[account].data.time-10000 > 0 ) then VIPs[account].data.time = VIPs[account].data.time-1000 else VIPs[account] = nil end end end,1000,0) addCommandHandler("tv", function (player) local accName = getAccountName ( getPlayerAccount(player) ) outputChatBox( VIPs[accName] and ( VIPs[accName].data.time/1000 .. " Segundos") or "Voce não é vip", player) end ) addCommandHandler("addvip", function (player, cmd, accName, secs) if ( getAccount(accName) ) then if ( VIPs[accName] ) then VIPs[accName].data.time = VIPs[accName].data.time + secs*1000 else VIPs[accName] = {} VIPs[accName].data = {} VIPs[accName].data.time = {} VIPs[accName].data.time = secs*1000 outputChatBox( "Voce add "..secs.. " Segundos", player) end end end )
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now