PHP код:
CMD:setarmour(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new ID; new amount;
if(sscanf(params,"ui",ID,amount)) return SendClientMessage(playerid,0xf8f8f8fff,"Syntax: {F00f00}/setarmour [ID] [amount]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xf8f8f8fff,"ERROR: {FFFFFF}Player isn't connected!");
if(amount < 0 || amount > 100) return SendClientMessage(playerid, 0xf8f8f8fff, "ERROR: {FFFFFF}Invalid amount (0 -> 100).");
if(PlayerInfo[ID][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, 0xf8f8f8fff,"ERROR: {FFFFFF}You can't set armour to this admin!");
new string[128]; new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{f00f00}Administrator {f00f00}%s {ffa700}has set your armour amount to {f00f00}%d!",pname,amount);
SendClientMessage(ID,0xf8f8f8fff,string);
SetPlayerArmour(ID,amount);
SendClientMessage(playerid, 0xf8f8f8fff,"[ADMIN] {FFFFFF}Player armour amount has been changed!");
}
else
{
SendClientMessage(playerid,0xf8f8f8fff,"ERROR: {FFFFFF}You aren't authorized to use this command!");
}
return 1;
}