02.11.2017, 13:43
pawn Код:
enum pInfo
{
pMoney,
pAdmin, // we need only this one
pAduty, // and this one for this command
Float:pPosX,
Float:pPosY,
Float:pPosZ
}
new PlayerInfo[MAX_PLAYERS][pInfo];
CMD:heal(playerid, params[])
{
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/heal [id]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "That player isn't logged in.");
if(PlayerInfo[playerid][pAdmin] != 1) return SendClientMessage(playerid, -1, "You aren't an admin");
if(PlayerInfo[playerid][pAduty] != 0) return SendClientMessage(playerid, -1, "You aren't on admin duty.");
if(targetid == playerid)
{
SendClientMessage(playerid, -1, "You have healed yourself");
SetPlayerHealth(playerid, 100);
}
else
{
new pname[MAX_PLAYER_NAME], string[64];
GetPlayerName(targetid, pname, sizeof(pname));
format(string, sizeof(string), "You have healed %s", pname);
SetPlayerHealth(targetid, 100);
SendClientMessage(playerid, -1, string);
}
return 1;
}