Raised This Month: $2 Target: $400
 0% 

Cvar is doing strange, getting 104872688 as value, set with 0.75 (float)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TwN
Junior Member
Join Date: Apr 2008
Location: Netherlands
Old 05-04-2008 , 04:04   Cvar is doing strange, getting 104872688 as value, set with 0.75 (float)
Reply With Quote #1

This is part of my first plugin OverKill.

Problem: cvar is fucking up, getting either always 0, or gigatons of a value.
Using get_pcvar_num/float/string/..(amx_ok_perc), and then turning it into the type I want, always returns 0. Hardcoding the value, (wich is still in the uploaded version), I get a gigaton value like 104872688.

I know I am putting some floats in some int's, I changed it so the compiler was quite happy about it. Tried with using correct types aswell, hence warnings...

Any comments?

Last edited by TwN; 02-07-2009 at 12:03.
TwN is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 05-04-2008 , 04:14   Re: Cvar is doing strange, getting 104872688 as value, set with 0.75 (float)
Reply With Quote #2

1) use get_pcvar_float for float cvars
2) its "Float:" and not "float:"
__________________
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Howdy!
Senior Member
Join Date: Feb 2007
Old 05-04-2008 , 06:58   Re: Cvar is doing strange, getting 104872688 as value, set with 0.75 (float)
Reply With Quote #3

You can change these:
PHP Code:
new amx_ok_perc
new amx_ok_life_cap
new amx_ok_max
new amx_ok_reward_cap
new amx_ok_perc_capped 
to

PHP Code:
new amx_ok_percamx_ok_life_capamx_ok_maxamx_ok_reward_capamx_ok_perc_capped 
Code:
//one line comment
/* Multiple line comment */
These has nothing to do with your problem, but good information tho.
__________________
[IMG]http://img221.**************/img221/5608/howdyfinnishhq2.jpg[/IMG]
Howdy! is offline
Reply


Thread Tools
Display Modes

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 08:56.


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