21.07.2015, 12:13
PHP код:
new bool:AdminDuty[MAX_PLAYERS]
public OnPlayerConnect(playerid)
{
AdminDuty[playeridp] = false;
}
CMD:aduty
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED,"*You are not allowed to use this command!");
new aName[24],string);
GetPlayerName(playerid, aName, 24);
format(string,50,"[Admin] %s(%i) Is Now On Admin Duty!",aName,playerid);
SendClientMessageToAll(blue,string);
AdminDuty[playerid] = true;
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(IsPlayerAdmin(damagedid) && AdminDuty[damagedid] == true)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z+1);
SendClientMessage(playerid,RED,"[Server]You Have Been Automatically Slapped To Shooting A Admin On Duty!");
SetPlayerHealth(damagedid,GetPlayerHealth(damagedid)+amount);
return 1;
}