Sharingan Posted July 23, 2011 Share Posted July 23, 2011 I have a question, how do I increase the damage of weapons? If I do this, Is it right?: funcion WeaponDamage(attacker, weapon, bodypart, loss) if(weapon == 30 or weapon == 31) then setElementHealth(source, getElementHealth(source)-(loss*2)) end end addEventHandler("onPlayerDamage",getRootElement(),WeaponDamage) In this case I want to duplicate the damage of M4 and AK-47. Link to comment
Castillo Posted July 23, 2011 Share Posted July 23, 2011 (edited) Try this (client side) function WeaponDamage(attacker, weapon, bodypart, loss) if(weapon == 30 or weapon == 31) then cancelEvent() setElementHealth(source, getElementHealth(source)-(loss*2)) end end addEventHandler("onClientPlayerDamage",getRootElement(),WeaponDamage) Edited July 23, 2011 by Guest Link to comment
Kenix Posted July 23, 2011 Share Posted July 23, 2011 function WeaponDamage(attacker, weapon, bodypart, loss) if(weapon == 30 or weapon == 31) then cancelEvent() setElementHealth(source, getElementHealth(source)-(loss*2)) end end addEventHandler("onClientPlayerDamage",getRootElement(),WeaponDamage) Link to comment
qaisjp Posted July 23, 2011 Share Posted July 23, 2011 That is the same thing Kenix... Link to comment
SDK Posted July 23, 2011 Share Posted July 23, 2011 That is the same thing Kenix... Nope, check 'function' Link to comment
Sharingan Posted July 23, 2011 Author Share Posted July 23, 2011 OK, Thank you everyone. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now