Fightstyle Problem
#1

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?
Reply
#2

/fightstyle or /setfightstyle if you are admin
Reply
#3

@Barnwell , i mean how to change the damage of Kick Boxing Fight Style same as Normal FightStyle Damage?
Reply
#4

You can't change how much damage they do.
Reply
#5

Код:
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;
}
Reply
#6

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Код:
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;
}
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 Код:
if(GetPlayerFightingStyle(playerid)==7) // '7' is for FIGHT_STYLE_KNEEHEAD
{
    SetPlayerHealth(damagedid,GetPlayerHealth(damagedid) + 45.0);
}
Reply
#7

Quote:
Originally Posted by NaClchemistryK
Посмотреть сообщение
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 Код:
if(GetPlayerFightingStyle(playerid)==7) // '7' is for FIGHT_STYLE_KNEEHEAD
{
    SetPlayerHealth(damagedid,GetPlayerHealth(damagedid) + 45.0);
}
No offense but adding 45 will create a problem , cedizon wants to deduct some health as far as I know.
Reply
#8

Quote:
Originally Posted by Rittik
Посмотреть сообщение
No offense
None taken.
Quote:
Originally Posted by Rittik
Посмотреть сообщение
but adding 45 will create a problem , cedizon wants to deduct some health as far as I know.
Quote:

Kick Boxing Fight Style I damaged half of Players Life , how to changed it to normal damage like at Normal FightStyle?

Correct me if wrong, but the amount of damage given to a player is already built into samp. So if the kick boxing style really takes -50 health, then you should add 45 to it to get a -5 damage.
45 + (-50) = -5
Chemistry also has something to do with maths, ya know
Reply
#9

The word 'if' matters a lot here.Read the code very carefully brother.
If a player is using fighting style 7 then the player who is getting damaged, his/her health will be reduced by 5%
Reply
#10

His/her health will be reduced by 5% with the additional damage native to SA-MP, which doesn't solve anything and in fact just makes the problem worse. The only REAL way that you can solve this is by setting the players to the same team using SetPlayerTeam. This will disallow friendly fire within teams, so the player will natively do no damage at all. Then you can use OnPlayerGiveDamage etc. to calculate an appropriate deduction from the player's health when they are hit with a certain fighting style.

Note that this would affect all weapons and you would need to add callbacks like OnPlayerWeaponShot, OnPlayerTakeDamage etc.

To be honest, it really isn't worth all the hassle, just to stop all the damage from the fighting style. If it bothers you that much, just remove the fighting style.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)