24.08.2011, 10:48
sscanf have isnull in-build code.
pawn Code:
CMD:kick(playerid,params[])
{
new id,name1[MAX_PLAYER_NAME]name2[MAX_PLAYER_NAME];
if(!PlayerInfo[playerid][pAdmin] >= 1) return SCM(playerid, COLOR_GREY," you are not authorized to use this command");
if(sscanf(params,"us[128]",id,params)) return SCM(playerid, COLOR_WHITE,"USAGE: /kick [playerid/partofname] [reason]");
if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_WHITE,"Player is not connected");
GetPlayerName(playerid,name1,sizeof(name1));
GetPlayerName(id,name2,sizeof(name2));
format(params,129, "AdmCmd: %s was kicked by %s, reason: %s",name2,name1,params);
SendClientMessageToAll(COLOR_LIGHTRED,params);
Kick(id);
return 1;
}