Something wrong with messages..
#1

**FIXED**
Reply
#2

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

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

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 :/
Reply
#5

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.
Reply
#6

I found problem... fixed...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)