Getting data from an array
#1

How can i know what is the data filled inside the first array , for example:
Код:
enum GANGSTUFFS
{
     stuffs,
     stuffs2
};
new gangstuff[MAX_GANGS][GANGSTUFFS];
i don't need anything from gangstuff , but i want to know how much gangs have a certain gang stuff selected and how can i detect if the gang have no amount of this stuff ? Please i need a quick reply as soon as possible
Reply
#2

https://sampwiki.blast.hk/wiki/Scripting_Basics#Arrays
Reply
#3

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Doesn't seem helpful on multi arrays at all. i used to get data easily from 1 array , and even 2 but i don't know how to get data from the first array instead of the second one.
Reply
#4

Quote:
Originally Posted by AstroPoid
Посмотреть сообщение
Doesn't seem helpful on multi arrays at all. i used to get data easily from 1 array , and even 2 but i don't know how to get data from the first array instead of the second one.
It is helpful. It's exactly the same thing for one, two, three or four array dimensions.
PHP код:
new Array1D[2],
    
Array2D[1][3],
    
Array3D[6][7][8];
Array1D[0] = 1000;
Array2D[0][2] = 54;
Array3D[4][5][2] = 97451
When it comes enum, you have to replace the index by the variable's name.
PHP код:
enum E_TEST
{
    
value_random,
    
something_else
};
new 
Array3D[30][99][E_TEST];
Array3D[20][50][value_random] = 99
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)