Raised This Month: $32 Target: $400
 8% 

Why it doesn't work as it should ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 06-10-2020 , 06:36   Why it doesn't work as it should ?
Reply With Quote #1

Hey there guys.
I have set a variable NEM_HEALTH = 150000
And when I am setting it using fm_set_user_health() something weird is happening and the health getting set is 114204721 which is not what I want.
Does anyone knows what is happening ?
Abhinash is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-10-2020 , 06:42   Re: Why it doesn't work as it should ?
Reply With Quote #2

Show some code.
__________________
HamletEagle is offline
condoriano90
Member
Join Date: May 2020
Old 06-10-2020 , 06:52   Re: Why it doesn't work as it should ?
Reply With Quote #3

Probably integer/float problem
condoriano90 is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 06-10-2020 , 06:59   Re: Why it doesn't work as it should ?
Reply With Quote #4

It's just 2 line Hamlet.
First --
PHP Code:
new NEMESIS_HEALTH 150000 
Second --
PHP Code:
fm_set_user_health(idNEMESIS_HEALTH
Thats it bro.
Can you help me out
Abhinash is offline
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 06-10-2020 , 07:24   Re: Why it doesn't work as it should ?
Reply With Quote #5

it happens with me one time when i try to set an entity health
try

PHP Code:
 fm_set_user_health(id,float(NEMESIS_HEALTH)) 
If i am wrong correct me
__________________
SED LYF !!!

Last edited by SHIELD755; 06-10-2020 at 07:27. Reason: YO GUYS !
SHIELD755 is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 06-10-2020 , 07:44   Re: Why it doesn't work as it should ?
Reply With Quote #6

Quote:
Originally Posted by SHIELD755 View Post
it happens with me one time when i try to set an entity health
try

PHP Code:
 fm_set_user_health(id,float(NEMESIS_HEALTH)) 
If i am wrong correct me
I tried.
It still doesn't work
Abhinash is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-10-2020 , 07:49   Re: Why it doesn't work as it should ?
Reply With Quote #7

Nope, that stupid function wants in integer so the problem isn't integer/float conversion. Anyway, please don't use functions from fakemeta_util like the one you are using.

How do you know the value is incorrect? The health hud can show max 255.
__________________

Last edited by HamletEagle; 06-10-2020 at 07:52.
HamletEagle is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 06-10-2020 , 08:14   Re: Why it doesn't work as it should ?
Reply With Quote #8

Quote:
Originally Posted by HamletEagle View Post
Nope, that stupid function wants in integer so the problem isn't integer/float conversion. Anyway, please don't use functions from fakemeta_util like the one you are using.

How do you know the value is incorrect? The health hud can show max 255.
I am using set_hudmessage to display a I am doing it inside Zombie Plague Addon. So, from there I am able to see.
How, can I fix it ?
Abhinash is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-10-2020 , 08:19   Re: Why it doesn't work as it should ?
Reply With Quote #9

hire a professional
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-10-2020 , 08:20   Re: Why it doesn't work as it should ?
Reply With Quote #10

Your assumption is that the value is not set properly, but I'm pretty sure your bug is in how you actually check the value.
Show the hudmessage code.
__________________
HamletEagle is offline
Reply



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 20:03.


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