Sniper
#3

Use simple code for adjusting health and armour with damage.

Код:
Damage(playerid, Float:health, Float:armour, Float:damage)
{
	armour -= damage; //Will decrease
	if(armour <= 0.0) //if armour is lower or equal to 0.0 do..
	{
		armour = 0.0;
		health -= damage;
		if(health <= 0.0) health = 0.0;
	}
	SetPlayerHealth(playerid, health);
	SetPlayerArmour(playerid, armour);
}
Use in OnPlayerShootPlayer:

Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
        switch(GetPlayerWeapon(Shooter)) //Switchs shooters weaponid
        {
       		 case 34: {
			HealthAdjust(Target, HealthLost, ArmourLost, 35.0); } //Default weapon damage + your custom damage
	}
Code above is only for health damage and won't work if player have armour.
Reply


Messages In This Thread
Sniper - by Fernado Samuel - 03.03.2013, 07:17
Re: Sniper - by RenSoprano - 03.03.2013, 07:31
Re: Sniper - by B-Matt - 03.03.2013, 07:42
Re: Sniper - by Tamer - 03.03.2013, 08:22

Forum Jump:


Users browsing this thread: 1 Guest(s)