Raised This Month: $ Target: $400
 0% 

Solved Problem with floats in hud [SOLVED]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Ludak
Member
Join Date: Oct 2014
Old 12-04-2019 , 16:02   Problem with floats in hud [SOLVED]
Reply With Quote #1

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.

Last edited by HamletEagle; 12-05-2019 at 08:39.
Ludak is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode