29.05.2014, 07:21
When i used the Kick Boxing Fight Style I damaged half of Players Life , how to changed it to normal damage like at Normal FightStyle?
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart) { if(GetPlayerWeapon(playerid)==0) { if(GetPlayerFightingStyle(playerid)==7) // '7' is for FIGHT_STYLE_KNEEHEAD { SetPlayerHealth(damagedid,GetPlayerHealth(damagedid)-5.0); } } return 1; }
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart) { if(GetPlayerWeapon(playerid)==0) { if(GetPlayerFightingStyle(playerid)==7) // '7' is for FIGHT_STYLE_KNEEHEAD { SetPlayerHealth(damagedid,GetPlayerHealth(damagedid)-5.0); } } return 1; } |
if(GetPlayerFightingStyle(playerid)==7) // '7' is for FIGHT_STYLE_KNEEHEAD
{
SetPlayerHealth(damagedid,GetPlayerHealth(damagedid) + 45.0);
}
This code should take half of the player's life, + -5.0 of his health.
Surprised that your indentation is a little better.. You should rather use a positive value. Otherwise he will just get more damage. pawn Код:
|
but adding 45 will create a problem , cedizon wants to deduct some health as far as I know.
|
Kick Boxing Fight Style I damaged half of Players Life , how to changed it to normal damage like at Normal FightStyle? |