31.03.2015, 10:04
The cmd works fine except one thing;
When I type /kick 0, it kicks me... whilst I scripted not to kick my self, lol.
When I type /kick 0, it kicks me... whilst I scripted not to kick my self, lol.
PHP код:
CMD:kick(playerid, params[])
{
new targetplayer;
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "u", targetplayer))
return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /kick [ID] [REASON]");
if(!IsPlayerConnected(targetplayer)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected!");
if(targetplayer == playerid)
SendClientMessage(playerid, COLOR_RED, "You cannot kick yourself!");
new string[64];
format(string, sizeof string, "%s has been kicked by an admin!", Kick(targetplayer));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
}
else
{
SendClientMessage(playerid, -1, "SERVER: Unknown command.");
}
return 1;
}