Kick mess whole public
#1

pawn Код:
forward BanCheck(query[], playerid, extraid, connectionHandle);
public BanCheck(query[], playerid, extraid, connectionHandle)
{
    mysql_store_result();
    if(mysql_num_rows())
    {
        mysql_fetch_row(query);
        new Ban_Name[24], Ban_Reason[40], Ban_Time;
        sscanf(query, "p<|>s[24]s[40]i", Ban_Name, Ban_Reason, Ban_Time);
        if(Ban_Time <= 0)
        {
            SendClientMessageEx(playerid, red,"[Ban]: You have an existing ban from %s for %s!", Ban_Name, Ban_Reason);
        }
        else
        {
            SendClientMessageEx(playerid, red,"[Ban]: You have an existing ban from %s for %s it will expire in %d minutes!", Ban_Name, Ban_Reason, Ban_Time);
        }
        SendClientMessage(playerid, red, "You are banned!");
        Kick(playerid);//My problem...
    }
    mysql_free_result();
    return 1;
}
Problem is next: When i have that Kick(playerid), that whole public is just just messed up(just these one)...nothing is called except Kick... (I debugged it many times and im 100% sure that kick cause all)
If i remove that Kick all messages and debug messages (removed now) are called and everything is fine...
I also tried to call kick by SetTimer and everything was fine...
I also have some kick functions in script and they all work fine...

Im testing these on windows and server is 0.3x (but these already was my problem with 0.3e)
Public is called by mysql_query_callback function and i use R6 mysql plugin, mysql return's and fetch query fine and sscanf2 split it to variables (checked many times).
Reply
#2

Try using KickPlayer(playerid); instead of Kick(playerid);
pawn Код:
stock KickPlayer(playerid)
{
    SetTimerEx("KickPlayerNow", 700, false, "i", playerid);
    return 1;
}

forward KickPlayerNow(playerid);
public KickPlayerNow(playerid)
{
    return Kick(playerid);
}
Reply
#3

As i said, if i use SetTimer to call custom kick function than it work's fine.
I already found solution to problem, i just want to know WHY is these messing up with my public...
Reply
#4

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
i just want to know WHY is these messing up with my public...
It's the Kick function
Quote:

Important Note: As of SA-MP 0.3x, any message sent to the player with SendClientMessage before Kick() will not be displayed for them.

Reply
#5

Thank you.
And for DEV tim, i think these its not since 0.3x cos i had these problem on 0.3e
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)