Weird Kick(playerid) problem
#1

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

Set a little timer to kick the player. I had the same problem. A timer with 100ms will 'fix' this.
Reply
#3

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

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. ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)