Posts: 1,648
Threads: 482
Joined: Jun 2010
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;
}
Posts: 1,504
Threads: 109
Joined: Jan 2012
It's probably something to do with the autoban, because the code you've shown is correct.
Posts: 937
Threads: 106
Joined: Jan 2010
Reputation:
0
If it spams the message then you're not returning a value.
You need return true; after SendClientMessage.
Posts: 1,648
Threads: 482
Joined: Jun 2010
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
Posts: 694
Threads: 2
Joined: Oct 2012
Reputation:
0
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.