AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Cell Array Floats (https://forums.alliedmods.net/showthread.php?t=93886)

Emp` 06-03-2009 18:25

Cell Array Floats
 
Is it possible to store floats in a cell array?

Code:

new Float:floaty = 10.5;
ArraySetCell(Array:which, item, floaty);

then
Code:

new Float:floaty = Float:ArrayGetCell(Array:which, item);
Is something wrong?

Exolent[jNr] 06-03-2009 18:27

Re: Cell Array Floats
 
I don't see a problem with it.

Code:
ArraySetCell(aMyArray, 0, 1.0); new Float:fValue = ArrayGetCell(aMyArray, 0);

Emp` 06-03-2009 18:28

Re: Cell Array Floats
 
Quote:

Originally Posted by Exolent[jNr] (Post 841089)
I don't see a problem with it.

Code:
ArraySetCell(aMyArray, 0, 1.0); new Float:fValue = ArrayGetCell(aMyArray, 0);

Dang, must be a problem somewhere else, alright.

Emp` 06-03-2009 18:44

Re: Cell Array Floats
 
Problem was that I was setting with one tag and retrieving with a different. Eg:
Code:

ArraySetCell(aMyArray, 0, 1);
new Float:fValue = ArrayGetCell(aMyArray, 0);

or
Code:

ArraySetCell(aMyArray, 0, 1.0);
new Value = ArrayGetCell(aMyArray, 0);


Exolent[jNr] 06-03-2009 19:01

Re: Cell Array Floats
 
Good job :up:


All times are GMT -4. The time now is 13:48.

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