Disabling weapon damage
#5

In OnPlayerTakeDamage, there's a float called amount, which is how much the player was damaged, therefore you can just set the player's health + amount.
pawn Код:
new Float:health, Float:armour; // Creates 2 floats, "health" and "armour"
GetPlayerHealth(playerid, health); // Stores the player's health value in the float "health"
GetPlayerArmour(playerid, armour); // Stores the player's armour value in the float "amour"
if(armour > 0) SetPlayerArmour(playerid, armour + amount); // Otherwise sets the players armour to his current armour, plus the damage that he took, removing the damage
else SetPlayerHealth(playerid, health + amount); // Otherwise sets the players health to his current health, plus the damage that he took, removing the damage
Although if he has very low health, he can still die from it before the script can set his health back.
Reply


Messages In This Thread
Disabling weapon damage - by Albon - 24.02.2015, 15:06
Re: Disabling weapon damage - by ball - 24.02.2015, 15:10
Re: Disabling weapon damage - by Albon - 24.02.2015, 15:26
Re: Disabling weapon damage - by De4dpOol - 24.02.2015, 15:30
Re: Disabling weapon damage - by CalvinC - 24.02.2015, 15:35

Forum Jump:


Users browsing this thread: 1 Guest(s)