Timer stops working.
#1

pawn Код:
SetTimerEx("KickPlayer",500,false,"i",giveplayerid);
I use it for various things including autoban, it spams the autoban message but doesnt kick the player eventually, at first it works but gradually slows down or something until it stops? maybe to do with playerid? Help would be appreciated.

pawn Код:
forward KickPlayer(playerid);
public KickPlayer(playerid)
{
    Kick(playerid);
    return 1;
}
Reply
#2

It's probably something to do with the autoban, because the code you've shown is correct.
Reply
#3

If it spams the message then you're not returning a value.
You need return true; after SendClientMessage.
Reply
#4

Quote:
Originally Posted by Lynn
Посмотреть сообщение
If it spams the message then you're not returning a value.
You need return true; after SendClientMessage.
No you don't.
Reply
#5

It does it with the kick command also. It's as if it just isn't calling the timer or its slowed down so much its not working
Reply
#6

Your problem certainly doesn't lie inside the function that isn't getting called, but rather the one that is getting called.
That simple snippet has nothing to do with not getting called, and lemme assure you if server does actually to your SetTimerEx, your timer will for sure get called after the given time.
so your problem here is the function crashing before reaching that SetTimer.
One of the reasons could be stack overflow/underflow (don't quote me on this, don't remember the name). As you mentioned something looping over and over again, recursive functions do tend to cause that problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)