Bug kick command on id 1
#1

Hello! I have a problem with kick command with id 1, even if the player is not connected command is still running and send message with " has been kicked by x. Reason: y".

Here is the code:

CMD:kick(playerid, params[])
{
if(pLogged[playerid] == 0) return LoginError(playerid);
new id, reason[100], string[100], playername[100], targetname[100];
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "ds[100]", id, reason)) return SendClientMessage(playerid, COLOR_SYNTAX, "Syntax: /kick [playerid] [reason].");
{
if(id != INVALID_PLAYER_ID)
{
if(id == playerid) return SendClientMessage(playerid, -1, "Error: You can't kick yourself.");
GetPlayerName(id, targetname, sizeof(targetname));
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "Kick: %s has been kicked by %s. Reason: %s", targetname, playername, reason);
SendClientMessageToAll(COLOR_KICK, string);
Kick(id);
}
else return SendClientMessage(playerid, COLOR_SYNTAX, "Error: Player not connected.");
}
}
else
{
AdminError(playerid);
}
return 1;
}
Reply


Messages In This Thread
Bug kick command on id 1 - by AlexGheorghe - 14.05.2017, 17:24
Re: Bug kick command on id 1 - by Toroi - 14.05.2017, 17:32
Re: Bug kick command on id 1 - by AlexGheorghe - 14.05.2017, 19:09

Forum Jump:


Users browsing this thread: 1 Guest(s)