22.06.2013, 10:14
This command wont let me enter a ID, everytime i use it, it just kills me and dont let me enter a player id.. idk whats wrong help me plz
pawn Код:
CMD:akill(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED, "You are not authorized to use this command");
new targetid, string[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_FADE1, "USAGE:kill [playerid]");
if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "invalid player id!");
format(string, sizeof(string), "You have admin killed player %s ", pname);
SendClientMessage(playerid, COLOR_YELLOW, string);
SetPlayerHealth(targetid,0.0);
return 1;
}