Problem with floats in hud [SOLVED]
Hello, I have level system fro ZM server.
I want to show the bonus speed and damage per level in the hud. I have natives: zp_get_hm_damage(player) zp_get_hm_speed(player) zp_get_zp_speed(player) All of those natives return integers. Now, in the level plugin, the speeds are divided by 100 and added to the current speed on spawn and the damage is divided by 10 and added for each bullet impact in (Ham_TakeDamage). So per level player gets 1 / 10 = 0.1 damage bonus, and 1 / 100 = 0.01 speed bonus. Now, since the values in natives are integers, I want to display them like floats in the hud. When I try the following: float(zp_get_hm_speed(player) / 100) float(zp_get_zp_speed(player) / 100) float(zp_get_hm_damage(player) / 10) The format in the hud is: %.5f The hud just displays 0.00000 I do not know why it is not working, can someone help me. |
Re: Problem with floats in hud
float(native) / 100
|
Re: Problem with floats in hud
Quote:
Then I tried float(native) / 100.0 and it works. Thanks. |
Re: Problem with floats in hud [SOLVED]
Do not empty your post. Why do people still do that in 2019 is beyond my understanding.
|
| All times are GMT -4. The time now is 02:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.