About arrys
#1

Hi there. Got a question about arrys

alright, I've think how to do arrys variables that they save some numbers, data and I will be able to change it around


something like this
Код:
new modelnumbers[][]=
{

     {400},
     {500}
};
And like if I'd press newkeys == key_up will change modelnumbers variable to 500 if again 400 you know everything will replay, spin around again
Reply
#2

pawn Код:
new modelnumbers[] =
{
     {400},//this is modelnumbers[0]
     {500}//and this is modelnumbers[1]
};

//so you can do that:

modelnumbers[0] = 300;
modelnumbers[1] = 400;
Reply
#3

error 008: must be a constant expression; assumed zero

didn't array structure should be [][]?
Reply
#4

There's no need for a second dimension.

pawn Код:
new modelnumbers[]=
{
     400,
     500
};
Reply
#5

only when you have something like that:

pawn Код:
modelnumbers[][] =
{
    {1,2},//modelnumbers[0][0] = 1 | modelnumbers[0][1] = 2
    {3,4}//modelnumbers[1][0] = 3 | modelnumbers[1][1] = 4
};
at least in theory :/
Reply
#6

And how did change variable to next with key_up when I try like that modelnumbers[0][0]++; I've got error
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)