Jump to content

Silenced gun


Hero192

Recommended Posts

Posted

Is something like that correct?

function silencedDamageSystem(attacker, weapon, _, loss) 
    if attacker and getElementType(attacker) == "player" and weapon == 23 then 
      cancelEvent() 
     local damage = getElementHealth(localPlayer)+loss-5 
     if damage > 0 then 
     setElementHealth(localPlayer, damage) 
     end 
   end 
end  
addEventHandler("onClientPlayerDamage", localPlayer,silencedDamageSystem) 

Posted
Or just change the weapon's 'damage' property using
setWeaponProperty 

I know this function but I don't know which parametre should I use to change the damage

and Also may I know which way is better this way or solidesnake's way?

Posted

setWeaponProperty will change the properties for all the players in the server, which means that if you change the silenced pistol damage, it'll be for everyone.

Posted
setWeaponProperty will change the properties for all the players in the server, which means that if you change the silenced pistol damage, it'll be for everyone.

That's exactly what I want, Can I know which property I've to use in this situation to edit the silenced pistol's damage?

Posted
setWeaponProperty ("silenced", "poor", "damage", xx) 

xx would be float/int of the new damage value

Don't forget other weapon skills (pro & std).

Posted
setWeaponProperty ("silenced", "poor", "damage", xx) 

xx would be float/int of the new damage value

Don't forget other weapon skills (pro & std).

Okay, so 5HPs would be like that?

setWeaponProperty ("silenced", "poor", "damage", 5) 

Posted
Last question, What's the usage of this property weapon_range ?

I would assume that's the distance of the gun's reach. Think about a rocket, the distance it takes before it explodes. Same goes for a simple gun, to limit the range it can reach.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...