Weapon Damage Changed
#1

How to changed the Damage of Weapon?? for example i want to change the damage of Deagle to 1/4 of Life Damage instead of Half How?? can you show me the Code?
Reply
#2

Maybe with OnPlayerGiveDamage?
Reply
#3

I'm not sure if this will work...
pawn Код:
public OnPlayerTakeDamage( playerid, issuerid, Float:amount, weaponid )
{
    new Float:h;
    if (weaponid == 24)
    {
        if (amount >= 50)
        {
            GetPlayerHealth(playerid, h);
            SetPlayerHealth(playerid, h + 25.0);
        }
    }
    return 1;
}
This should increase the health by 25.0 whenever deagle causes more than or equal to 50 damage..
Reply
#4

I make this script quicly, i don't know if it works :

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
    if(
weaponid == 24// If the weapon is a deagle
    
{
          new 
Float:health;
          
GetPlayerHealth(damagedidhealth); // Get the player's health after the shot
          
health += amount// Add the damage amount at the player's health
          
SetPlayerHealth(damagedidhealth 25); // Removed 1/4 of player's health
    
}

Sorry for my bad english and, i repeat, i don't know if this script works ^^
Reply
#5

Set every player's team to a constant value. From then, a player cannot damage other player. However, the callbacks get called and you can do the damage accordingly.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)