24.08.2011, 10:39
Damn thanks, noticed that I got the same problem on this command:
But I think I can't check if is null because there are 2 parameters? How to make here?
pawn Code:
CMD:kick(playerid, params[])
{
new id, sendername[MAX_PLAYER_NAME], string[128], reason[128];
if(!PlayerInfo[playerid][pAdmin] >= 1) return SCM(playerid, COLOR_GREY," you are not authorized to use this command");
if(sscanf(params,"us[128]",id, reason)) return SCM(playerid, COLOR_WHITE,"USAGE: /kick [playerid/partofname] [reason]");
if(id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_WHITE,"Player is not connected");
else
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", id, sendername, reason);
SendClientMessageToAll(COLOR_LIGHTRED,string);
Kick(id);
}
return 1;
}