24.10.2018, 20:03
Hi. When I use /kick on someone, instead of showing him the reason, he gets server closed without showing the reason but rest of the server can see it.
PHP код:
CMD:kick(playerid,params[])
{
if(pInfo[playerid][pAdminLevel] >= 1)
{
new targetid,reason[105],string[180];
if(sscanf(params, "us[105]", targetid,reason)) return SendClientMessage(playerid,-1,""COL_RED"AdmCmds: /kick [PlayerID] [Reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""COL_RED"Error!");
if(!IsPlayerNPC(targetid))
{
format(string, sizeof(string), ""COL_RED"AdmCmds: %s %s has kicked %s"COL_WHITE" [Reason: %s]",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),reason);
SendClientMessageToAll(-1,string);
format(jQuery, MAX_QUERY_LENGTH, "INSERT INTO `"#sanctionlog"` (Username, Targetname, Comanda, Motivul, Data) VALUES ('%s', '%s', 'KICK', '%s', CURRENT_TIMESTAMP)",PlayerName(playerid), PlayerName(targetid), reason);
mysql_tquery(handle, jQuery, "", "");
Kick(targetid);
}
else return SendClientMessage(playerid,-1,""COL_RED"ENPCe!");
}
else {
SendClientMessage(playerid,-1,""COL_RED"Error: Notadmin!");
}
return 1;
}