03.03.2013, 07:42
Use simple code for adjusting health and armour with damage.
Use in OnPlayerShootPlayer:
Code above is only for health damage and won't work if player have armour.
Код:
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); }
Код:
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 }