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;
}
if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_FADE1, "USAGE:kill [playerid]");
if(sscanf(params, "us", targetid)) SendClientMessage(playerid, COLOR_FADE1, "USAGE:kill [playerid]");
Change
pawn Код:
pawn Код:
|
CMD:akill(playerid, params[]) { new string[128], playerto, sendername[MAX_PLAYER_NAME] ,giveplayer[MAX_PLAYER_NAME]; if(sscanf(params, "u", playerto)) return SendClientMessage(playerid, COLOR_ORANGE, "{F97804}USAGE:{B4B5B7}{FFFFFF} /akill [playerid/PartOfName]"); if(!IsPlayerConnected(playerto)) return SendClientMessage(playerid, COLOR_GRAD1,"Invalid player !"); GetPlayerName(playerto, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "You have admin killed player %s ", sendername); SendClientMessage(playerid, COLOR_YELLOW, string); SetPlayerHealth(playerto, 0); return 1; }
command(kill, playerid, params[])
{
new PID;
if(PlayerInfo[playerid][pAdmin] < 4) return return SCM(playerid, COLOR_RED, "You are not authorized to use this command");
if(sscanf(params, "u", PID)) return SendClientMessage(playerid, COLOR, "/kill [ playerid / Name ]");
return SetPlayerHealth(PID, 0);
}