Setting weapons damage dealt.
#1

I would like to set the weapons damage dealt for every weapon.

Simply,when a player has a variable=1; and having an m4 on their hand,shooting to another player,making the m4 damage dealt per bullet to 50,instead of 25. Can someone help me? I don't want it to make one shot one kill,as I have that aldready for knife-stab attack.

I want it to work like every bullet that hits the target will deal more damage than usual.

Is there a function for this? I got the OPSP call back. I need the function that can set the bullet damage.


Would this sort it out?

http://forum.sa-mp.com/showthread.ph...+bullet+damage
Reply
#2

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponid)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
        if(
weaponid == 31 && variable == 1//! variable
        
{
            new 
Foat:health;
            if(
GetPlayerHealth(playeridhealth))
            {
                
SetPlayerHealth(playeridhealth-amount);
            }
        }
    }
    return 
1;

Reply
#3

Or:

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponid) {  
if(
variable == 1)
{
    new 
Foat:health
    
GetPlayerHealth(playeridhealth);
    switch(
weaponid
    { 
        case 
31SetPlayerHealth(playerid,health-50); 
    }

return 
true

Reply
#4

JM_Millers, please don't double post, just edit your post.

I'd recomment the first way you did, because not everytime does damage 25.
pawn Код:
health - amount
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)