AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Float problem (https://forums.alliedmods.net/showthread.php?t=157047)

Xalus 05-15-2011 10:51

Float problem
 
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?

SonicSonedit 05-15-2011 11:12

Re: Float problem
 
Show full code.

Xalus 05-18-2011 10:54

Re: Float problem
 
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)

Exolent[jNr] 05-18-2011 13:20

Re: Float problem
 
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.

xPaw 05-18-2011 15:38

Re: Float problem
 
Fun fact: You can directly retrieve float from SQL_ReadResult.

Xalus 05-21-2011 10:20

Re: Float problem
 
Should I use

Trie's then for save the properties or?


All times are GMT -4. The time now is 04:29.

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