24.02.2015, 15:35
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.
Although if he has very low health, he can still die from it before the script can set his health back.
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

