Untitled

 avatar
unknown
plain_text
a year ago
1.0 kB
9
Indexable
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart) 
{
	if(GetPVarInt(playerid, "IsInArena") == -1 && GetPVarInt(damagedid, "IsInArena") == -1 && GetPVarInt( playerid, "EventToken" ) == 0 && PlayerInfo[damagedid][pJailTime] == 0) 
	{
	    new Float:A, Float:H, Float:pos[3], Float:Giap;
		GetPlayerPos(damagedid, pos[0], pos[1], pos[2]);
		GetPlayerArmour(damagedid, A);
		GetPlayerHealth(damagedid, H);

	    if(!(IsPlayerInRangeOfPoint(playerid, 1.0, pos[0], pos[1], pos[2]))) 
	    {
	    	if(weaponid == 22) {
	    		amount = 10.5;
	    	}

	    	if(GetPVarInt(damagedid, "Injured") == 1) amount = 0;
			if(PlayerInfo[damagedid][pJailTime] > 0) return 1;
			if(GetPVarType(damagedid, "pGodMode") == 1) return 1;
			PlayerPlaySound(playerid, 17802, 0, 0, 0);
	
			Giap = A-amount;
			if(A > 0) SetPlayerArmour(damagedid, A-amount);
			if(Giap < 1) SetPlayerArmour(damagedid, 0.0);
			if(A < 1) SetPlayerHealth(damagedid, H-amount);
	    }
	}
	return 1;
}
Editor is loading...
Leave a Comment