How can I detect if the player is shooting an admin onduty?
#1

Well like the title say. I want to make it so if a player shoots an admin that is ON duty he will get slapped in the air and get a gametext where it say for example "Don't shoot admin on duty!" i know how to make the slap etc but I don't know how I can detect if the player is shooting an admin?
Reply
#2

Код:
public OnPlayerGiveDamage(playerid, damageid, Float:amount, weaponid)
{
	if(PlayerInfo[damageid][Level] >= 1 && PlayerInfo[damageid][OnDuty] == 1)
	{
	    Your code
	}
	return 1;
}
you need to repalce the "PlayerInfo[damageid][Level]" and the "PlayerInfo[damageid][OnDuty]" with your variables that define the player's level and the on-duty-status
Reply
#3

Only like that? Should have thougt about that. haha! Well thank you for the fast response! +REP for you.
Reply
#4

You can try OPSP include too.
Reply
#5

Quote:
Originally Posted by Black Wolf
Посмотреть сообщение
You can try OPSP include too.
Allready used the other way but please send me a link to that include so I can check it out.
Reply
#6

Quote:
Originally Posted by Don_Cage
Посмотреть сообщение
Allready used the other way but please send me a link to that include so I can check it out.
OnPlayerTakeDamage is natively supported now, you're better off using the callback provided rather then an include (the include will be slower and less accurate).

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
Reply


Forum Jump:


Users browsing this thread: