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

[ TUT ]Dynamic Array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-17-2017 , 08:49   Re: [ TUT ]Dynamic Array
Reply With Quote #14

Quote:
Originally Posted by HamletEagle View Post
Do you even read the answers?

Addons said:


Klippy said:


I said:


Let's try one more time:
PHP Code:
new Array:Test ArrayCreate(1
The 1 tells that you want to save single-cell data(basically numbers).

PHP Code:
new Array:Test ArrayCrete(some_other_number_here), where some_other_number_here 
This means that you will store multicell data(basically arrays). They can be strings or array of numbers.

PHP Code:
new Array:Test ArrayCreate(32
In "Test" you can save as many strings as you want, but one string can't be bigger than 32.

View the array like a list:
PHP Code:
new Array:Test ArrayCreate(1)

Translates to:
/*
var0
var1
var2
var3
.
.
.
varn
*/

new Array:Test ArrayCreate(32)
/*
var0[32]
var1[32]
var2[32]
.
.
.
.
varn[32]
*/ 

If you create an array with cellsize = 1(not of size 1), then you are creating an array of numbers. You can store as much data as you want, but data must be a number, not an array.
There is no cap.

PHP Code:
new Array:MyArray ArrayCreate(1)
for(new 
i9999i++)
{
     
ArrayPushCell(MyArrayi)

We just saved 9999 values.
Oohh, I was just confused because in Zombie Plague MerCyLeZZ used 32/64 for models, sounds etc...

Sorry I understand things a little slowly. So if I want to use integers, I can make the cellsize 1, but what if I want to use huge values like 1000000, do I have to use cellsize 7?
__________________

Last edited by edon1337; 02-17-2017 at 08:58.
edon1337 is offline
 



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 12:58.


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