Admin Onduty Slap player if shoot!
#1

Hello guys . what code i gonna add if Player shoot the adminonduty then the player will automatically Slap then Text Will show on the player screen "Dont Shoot Admin On Duty"

Thank you! +1Rep
Reply
#2

Okey, I saw already another user replayed. Yep, that will work.

[IGNORE]
Reply
#3

on the top
PHP код:
new bool:onDuty[MAX_PLAYERS]; 
under duty command
PHP код:
onDuty[playerid] = true
Under OnPlayerGiveDamage
PHP код:
if(onDuty[damageid] == true)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    
SetPlayerPos(playeridxyz+10);

Reply
#4

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

Enjoy ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)