• 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!

Help with Vip system

Keiro

New Member
Joined
Jun 24, 2009
Messages
285
Reaction score
0
Using TFS 0.3.6

im using a script that when u use medal of honour, it gives u 30 days pacc , it adds + 30 on the storagevalue XXXX

so can someone tell me a way of a better system? cuz i dont know how to make it to take out 1 day of pacc when 24 hrs passed......

i could if i use the global event that takes -1 on that storage each 24 hrs , but if serv crash or i reload glboal events....the script starts from 0

so it doesnt work.....


any ideas?

thanks
 
One way would be to insert a column in your accounts table, and then have a script in game that executes every 24 hours, or on a set time (Like... 12 AM), which executes a query like...

UPDATE account SET vipdays = (vipdays - 1)

Or something like that...

Thus it would remove vip days from all characters whether they're logged in or not.


Another way would be to simply use UNIX time to set a date (Like... 24 dec 2009) in a column, then the script which checks for vip days checks if the current server date is before the date set in the players account, and if it is before the set date, the player has VIP, if it is past that date, then the player does not have VIP anymore.
It's also possible to if needed, display the remaining seconds/hours/days/months/years before the player VIP expires.


Personally I would suggest the second alternative.
 
Back
Top