02.11.2011, 21:10
guys can you explain why this happens please?
i have the current code:
but when i login and type /kick it is kicking me and for reason it has the id of the player was kicked :P
i have the current code:
pawn Код:
if(strcmp(cmd, "/kick", true) ==0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only admins can use this command!");
new
id,
reason[120];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
new gname[MAX_PLAYER_NAME];
GetPlayerName(id, gname, sizeof(gname));
if (sscanf(cmd, "uz", id, reason)) return SendClientMessage(playerid, 0xFF0000AA, "Usage:/kick [id] [reason]");
else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "ERROR:This player isn't connected!");
else
{
format(reason, sizeof(reason), "ADMIN KICK : %s has been kicked From The Server ( Reason : %d)",gname,reason);
SendClientMessageToAll(COLOR_PINK, reason);
Kick(id);
}
return 1;
}