CMD:aheal(playerid, params[]) { new targetid, Float:health, targetname[MAX_PLAYER_NAME], string[70], string2[70]; if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "This command is only for administrators!"); if(sscanf(params,"ur", targetid, health)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /aheal [playerid/partofname] [health]"); else if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid player ID!"); else { SetPlayerHealth(targetid, health); GetPlayerName(targetid, targetname, MAX_PLAYER_NAME); format(string, sizeof(string), "You've set %s's (%d) health to %d.", targetname, targetid, health); SendClientMessage(playerid,COLOR_WHITE,string); format(string2, sizeof(string2), "%s has set your health to %d.", playerid, health); SendClientMessage(targetid,COLOR_WHITE,string2); } return 1; }
CMD:aheal(playerid, params[])
{
new targetid, Float:health, targetname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[70], string2[70];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "This command is only for administrators!");
if(sscanf(params,"ui", targetid, health)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /aheal [playerid/partofname] [health]");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid player ID!");
SetPlayerHealth(targetid, health);
GetPlayerName(targetid, targetname, sizeof(targetname));
GetPlayerName(playerid, adminname, sizeof(adminname));
format(string, sizeof(string), "You've set %s's (%d) health to %d.", targetname, targetid, health);
SendClientMessage(playerid,COLOR_WHITE,string);
format(string2, sizeof(string2), "%s has set your health to %d.", adminname, health);
return SendClientMessage(targetid,COLOR_WHITE,string2);
}
CMD:aheal(playerid, params[])
{
new targetid, Float:health, targetname[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME],string[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "This command is only for administrators!");
if(sscanf(params,"uf", targetid, health)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /aheal [playerid/partofname] [health]");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid player ID!");
SetPlayerHealth(targetid, health);
GetPlayerName(targetid, targetname, MAX_PLAYER_NAME);
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "You've set %s's (%d) health to %0.1f.", targetname, targetid, health);
SendClientMessage(playerid,COLOR_WHITE,string);
format(string, sizeof(string), "%s has set your health to %0.1f.", playername, health);
SendClientMessage(targetid,COLOR_WHITE,string);
return 1;
}
if(sscanf(params,"ui", TargetID)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /goto [playerid/partofname]");
pawn Код:
|