View Single Post
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-17-2017 , 15:32   Re: [ TUT ]Dynamic Array
Reply With Quote #27

I told you before, stop seeing things as a whole and analyze them piece by piece.
I'm pushing the numbers one by one, so I'm saving single-cell data. Here you have a dynamic array of numbers.
addons is saving the entire array once, he has multi-cell data. Here you have a dynamic array of arrays.

My snippet translates to:
Code:
0
1
2
3
4
5
6
7
8
9

//the dynamic array has 10 elements
"cellsize" param is 1 because, again, we are saving numbers.

addon's snippet translates to:
Code:
{2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647}

//the dynamic array has 1 element(only one array)
"cellsize" param is 7 because that's the size of the array that you will save.

Another example:
PHP Code:
new Array1[] = {01,3}
new 
Array2[] = {4567}
new 
Array3[] = {891011}

new Array:
Test ArrayCreate(4//4 because that's the array size.
ArrayPushArray(TestArray1)
ArrayPushArray(TestArray2)
ArrayPushArray(TestArray3
It "looks" like:
Code:
{0, 1, 2, 3}
{4, 5, 6, 7}
{8, 9, 10, 11}

//array has 3 elements.
We have 12 numbers, but they are organized in arrays, and each array is pushed into the dynamic array.
__________________

Last edited by HamletEagle; 02-17-2017 at 15:34.
HamletEagle is offline