26.07.2014, 05:57
pawn Код:
CMD:asethp(playerid, params[])
{
if(GetPVarInt(playerid, "LoggedIn") == 0) return SendClientMessage(playerid, -1, "ERROR: You are not logged in.");
if(Player[playerid][AdminLevel] >= 3)
{
new string[128], id, amount;
if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, -1, "Command Usage: /asethp [playerid] [amount]");
if(id != INVALID_PLAYER_ID)
{
Player[id][Health] = amount;
SetPlayerHealth(id, amount);
format(string, sizeof(string), "[AdminCMD] You have set %s's health to %i.", GetName(id), amount);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "[AdminCMD] Your health has been set to %i by %s.", amount, GetName(playerid));
SendClientMessage(id, COLOR_LIGHTRED, string);
}
else return SendClientMessage(playerid, -1, "That player is not online.");
}
else return SendClientMessage(playerid, -1, ADMIN);
return 1;
}