Timer question?
#1

Hi, i have been wondering, if you use "SetTimerEx" on a player and that player logs off, can the timer keep on count if tho the player is offline?

Example:

If i set a player admin and then i put a timer on 5 days on to remove the admin from that player, he would prob not be logged on 24/7 on the server in those 5 days, so would the timer be able to take the admin off him without him being online?
Reply
#2

In terms of your timer, 'playerid' is just a parameter, not really a player, you just use it to identify someone. Anyway, 5 days later it takes away the admin from the player who's connected on the same id you specified when launching the timer. (edit: the timer is not killed when someone logs off, these 2 events are not related to each other unless you explicitly tell the timer must be killed upon disconnect. plus, keep in mind 5 days is a long time, you better not rely on timers given that countless unexpected events could occur: server crash, etc...)

You ought to have a name list stored in a file/database. That'll work out way better.
Reply
#3

Hmm.. Is it possible to load dini into a timer?
Reply
#4

You could handle it as a playerstat. Make a new stat named something that covers the purpose of what you want. Could be, adminRevocationDate. Instead of setting up a timer, make that stat equal to a certain date (current date + 5 days).
On connect: Check whether the value of this stat is set in the first place. Then see if it's less than the current date. (You'll need some sneaky functions to deal with dates, I'm sure there are some out there)
In case the date you specified is passed, take the player's admin away.

ps.: edited my first post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)