15.02.2013, 10:35
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;
}
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).