02.11.2011, 17:24
1stly what is wrong? i compiled it no errors/warnings however when i press the command in-game it shows this
code:
2ndly how i can add admin levels?
PHP код:
Usage:/kick [id] [reason]
pawn Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "ERROR:Only admins can use this command!");
if(strcmp(cmd, "/kick", true) ==0) {
new giveid, reason[128];
if(sscanf(cmd, "rs[128]",giveid,reason))return SendClientMessage(playerid, -1, "Usage:/kick [id] [reason]");
if(giveid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "ERROR:This player isn't connected!");
else
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
new gname[MAX_PLAYER_NAME];
GetPlayerName(giveid, gname, sizeof(gname));
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "ADMIN KICK : %s has been kicked From The Server ( Reason : %s)", gname,reason);
SendClientMessageToAll(COLOR_PINK, string);
Kick(giveid);
}
return 1;
}