01.10.2011, 02:57
Valid ID? I type /makeadmin 0 1 (to test) and I get invalid ID, same with my kick command...
It keeps saying "Player is not connected"
pawn Code:
CMD:kick(playerid,params[]){
new id,reason[128];
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,COLOR_GRAY,"ERROR: You're not authorized to use this command!");
else if(sscanf(params, "uz",id,reason)) return SendClientMessage(playerid,COLOR_GRAY,"SYNTAX: /kick [ID] [REASON]");
else if(id==playerid)SendClientMessage(playerid,COLOR_WHITE,"Error: You can not kick yourself!");
else if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_GRAY,"You can not kick an admin!");
else if(id==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_GRAY,"Error: Player not connected!");
else{
new name,string[128];
format(string,sizeof(string),"%s has just kicked %s, Reason: %s",GetName(playerid),name);
SendClientMessageToAll(COLOR_RED,string);
Kick(playerid);
}
return 1;
}