30.12.2015, 01:35
So alright Ive set up a small timer that repeats itself every 5 minutes, the problem is the timer doesnt actualy stop when you logout
How do I know its a timer? Ive set up a small print there, its being called every 5 minutes no matter if you logged off or not
Now there are no problems with SavePlayerAccount which I use all the time, but the timer itself tends to run eventho you arent online
I know simple resolution would be to check if he is online or not and the if false to kill the timer, or just kill in under OnPlayerDisconnect, but why does it happen?
EDIT: Just to add up, of course it starts when you login and then just works no matter if you are there or not
PHP код:
SetTimerEx("SavePlayerAccountTimer",300000,true,"i",playerid);
forward SavePlayerAccountTimer(playerid);
public SavePlayerAccountTimer(playerid) {
SavePlayerAccount(playerid);
Msg(playerid,COLOR_RED,"Your account has been automaticly saved");
print("hi");
return true;
}
Now there are no problems with SavePlayerAccount which I use all the time, but the timer itself tends to run eventho you arent online
I know simple resolution would be to check if he is online or not and the if false to kill the timer, or just kill in under OnPlayerDisconnect, but why does it happen?
EDIT: Just to add up, of course it starts when you login and then just works no matter if you are there or not