Raised This Month: $51 Target: $400
 12% 

Float problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 05-15-2011 , 10:51   Float problem
Reply With Quote #1

Hello,

I did:
PHP Code:
copy(MonitorValues[1][ent], 5CameraPropertieValues[0]); 
Then if I do:
str_to_float(MonitorValues[1][ent]) it returns 0

Can somoene help?
__________________
Retired.
Xalus is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-15-2011 , 11:12   Re: Float problem
Reply With Quote #2

Show full code.
__________________

SonicSonedit is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 05-18-2011 , 10:54   Re: Float problem
Reply With Quote #3

Okay,
I Start with:


PHP Code:
new CameraPropertieValues[3];
new 
MonitorValues[3][10000]

SQL_ReadResult(Query5CameraPropertieValues[0], 10); 
Then if I create camera
PHP Code:
copy(MonitorValues[0][ent], 5CameraPropertieValues[0]); 
if I do then:
PHP Code:
str_to_num(MonitorValues[0][ent]) 
Returns: 0

If I do:
PHP Code:
str_to_num(CameraPropertieValues[0]) 
Returns: 2 (Like normal)
__________________
Retired.
Xalus is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-18-2011 , 13:20   Re: Float problem
Reply With Quote #4

First, CameraPropertieValues is not an array of strings, but just an array of integers.
You don't have any length property set.

The same problem exists for MonitorValues.

Also, it is bad coding to index an array with an entity index.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-18-2011 , 15:38   Re: Float problem
Reply With Quote #5

Fun fact: You can directly retrieve float from SQL_ReadResult.
__________________
xPaw is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 05-21-2011 , 10:20   Re: Float problem
Reply With Quote #6

Should I use

Trie's then for save the properties or?
__________________
Retired.
Xalus 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 14:19.


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