Weird Kick(playerid) problem - 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: Weird Kick(playerid) problem (
/showthread.php?tid=268432)
Weird Kick(playerid) problem -
*IsBack - 12.07.2011
Hi,
Here's my code:
pawn Код:
mysql_query(queryStr);
mysql_store_result();
if(mysql_num_rows() > 0)
{
new tmpData[24];
while(mysql_retrieve_row())
{
mysql_fetch_field_row(tmpData,"BannedBy");
new msg[64];
format(msg,64,"You are banned from this server by %s!",tmpData);
SendClientMessage(playerid,cError,msg);
mysql_fetch_field_row(tmpData,"BanEnds");
format(msg,64,"Ban ends at %s",tmpData);
SendClientMessage(playerid,cError,msg);
}
SendClientMessage(playerid,cError,"Bye!");
mysql_free_result();
Kick(playerid);
}
But for some reason it kicks player
before sending those messages.. Why?
If I comment the "Kick" part, it sends the messages and everything seems to be ok..
Re: Weird Kick(playerid) problem -
Jeffry - 12.07.2011
Set a little timer to kick the player. I had the same problem. A timer with 100ms will 'fix' this.
Re: Weird Kick(playerid) problem -
*IsBack - 13.07.2011
Quote:
Originally Posted by Jeffry
Set a little timer to kick the player. I had the same problem. A timer with 100ms will 'fix' this.
|
Had to set timer with 1500ms, since setting lower value didn't fixed the problem.. :/
Re: Weird Kick(playerid) problem -
Jeffry - 13.07.2011
Quote:
Originally Posted by *IsBack
Had to set timer with 1500ms, since setting lower value didn't fixed the problem.. :/
|
Could be the MySQL then, that it takes so long.
On my Ban System (which uses one file) it works with a little timer (500ms for the ones with a higher Ping).
But well, being ingame for 2 seconds is not a big deal, if you get kicked then. ^^