SA-MP Forums Archive
Something wrong with messages.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Something wrong with messages.. (/showthread.php?tid=79606)



Something wrong with messages.. - Dreftas - 29.05.2009

**FIXED**


Re: Something wrong with messages.. - MenaceX^ - 29.05.2009

I'd suggest you to redo the AFK system with a simply way.
I did everything with OnPlayerUpdate, it's short as hell .


Re: Something wrong with messages.. - yom - 29.05.2009

You never tell the script to stop sending the message, so it's sent everytime this function is called by the timer.


Re: Something wrong with messages.. - Dreftas - 29.05.2009

Quote:
Originally Posted by 0rb
You never tell the script to stop sending the message, so it's sent everytime this function is called by the timer.
I want that script send that message if coordinates is equal, but message is sended ~20 times with one timer call.... I want 1 message with 1 timer call, so how to do this ?

P.S. OnPlayerConnect:
pawn Код:
SetTimerEx("AntiAfk",AFK_TIME,true,"d",playerid);
On top of script there is:
pawn Код:
#define AFK_TIME 10000
i dont get it, where is the problem :/


Re: Something wrong with messages.. - yom - 29.05.2009

You have to kill the timer when the player disconnect, because everytime a player connect it will start a timer for his id so if a player disconnect and another player connect right after, he got the same id as the previous player and it will set another timer for the same player id (so the timer will be called 2 times in this case, for the same id, so this playerid will receive 2 messages).

Or better solution, start a timer in init() and use a loop for all players inside the timer.

I don't know if it's your problem, but it's a problem anyway.


Re: Something wrong with messages.. - Dreftas - 29.05.2009

I found problem... fixed...