funny consequences [armor problem]
Im my plugin I use armor calculations. so it takes 2/3 of damage like this
Code:
and armor 100-66=33. the problem is when damage is too high (100-120) and I have Low armor (10-30) after hit I have armor with negative values like -20, -30 ... |
Re: funny consequences [armor problem]
Bos93 < i know you are god of scripting. but shut your mouth and go away from this thread.
should I use "min" or "max" ? max(val1,val2) |
Re: funny consequences [armor problem]
Just make sure final value is not < 0
set_pev(i, pev_armorvalue, floatmax(YOUR_CALCULATION, 0.0)) Anyway, if it is for cs, you should use cs_set_user_armor, so you can set armortype to 0 when armorvalue is 0, and if, before calcultion, armor amount is > 0 but armortype is 0 (can happen if a bad plugin is used), do nothing. |
Re: funny consequences [armor problem]
your floatmax works well. tnhx
|
| All times are GMT -4. The time now is 06:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.