Editing damage dealt by custom weapons
Hey,
I'm trying to edit a custom weapons damage dealt, but everything i try seems to fail. So here's the code-> Code:
Weapons deal waay too little damage. Between 15-20, no matter if it's in the head or body. So I want the weapons to deal atleast 25 damage, and 50-70 if it's in the head... |
Re: Editing damage dealt by custom weapons
I don't know if it is the main fault but you are not passing a float value in SetHamParamFloat.
It should be SetHamParamFloat(4, 500.0) NOT SetHamParamFloat(4, 500). Also probably 3rd and 4th IF could be changed to ELSE IF. |
Re: Editing damage dealt by custom weapons
Test on non-armored players and print some debug messages to be sure they get damaged by the right values...
Also, alot of wasted calls there, consider this instead: Code:
if (get_user_weapon(attacker) == CSW_KNIFE && !IsGrenade(inflictor)) |
Re: Editing damage dealt by custom weapons
Quote:
The plugins isn't mine, but yeah. That's strange, will fix that :) |
Re: Editing damage dealt by custom weapons
Also, you were setting integer values into a function that accepts floats.
When the integer is casted into the float value, it isn't the same value anymore. |
| All times are GMT -4. The time now is 01:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.