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

Solved Help please, the premium doesn't is removed in the server shutdown...

Udun

Well-Known Member
Joined
Jan 5, 2012
Messages
199
Solutions
2
Reaction score
69
Hello there, I have a problem on my server, I have the tfs 0.3.6 and is the first time that I'm starting with the premium system, I dont know why but each time when I close the ot the premium days on the accs doesn't are removed, sorry if this question is very noob but I dont have idea what is wrong or how fix it, is something on the config.lua maybe? or in the mysql database? Or maybe I'm doen't have doing correct the server close... but I only close the server with the [X] I dont know how make it authomatic, I have the command /shutdown... but how I can start it again in the same sesion?

Well that's it...
Thanks alot! I'll wait some answer :>
 
Well, after searching in the forums I found the solution...
so the thread is solved.
I will put here the solution if someone else have the same problem:

This thing works with a globalevent, so we have to go to:
yourOt/data/globalevents/gobalevents.xml and put:

<globalevent name="VipDaysRemover" time="00:01" event="script" value="daysremover.lua"/>
It means that the remove of the premmy day will be at the 00:01 hours of your PC clock (you can edit this time as you wish)

Later you have to go to the scripts folder of globalevents, and inside of an empty lua called daysremover.lua copy this:

function onTime()
db.executeQuery("UPDATE accounts SET premdays = premdays - 1 WHERE premdays > 0;")
return true
end


Note: be carefull with the param: premdays, maybe the field responsable of the premium days on your account db have a different name like: vipdays, premiumdays, premdays (as in my case), if is different you have to change it on the globalevent script and will work perfectly (PD you can see on the account table of your database how is called the param for the premium days)

I hope that this will be for some help.
 
Back
Top