Redefine array ?
#1

Hello,

Is there a way to quickly redefine whole parts of an array, without redefining all its items?

For instance :

Global array:
new Race[MAX_PLAYERS][255][3];

Then, in a function :

Race[playerid][0] = {1, 2, 3};

I tried it but it didn't work ("Array has to be indexed" error), so I was thinking if there were a workaround ^^

Thanks
Reply
#2

In my knowledge, it's not possible.

When you write

new Race[playerid][0] = {1, 2, 3};

you can do that because you create and fill the variables at the same time, but it works only because the compiler arrange the vars and values for the compiled file in the space for initialization, so when you execute the program first of all it reads vars and stores values before the program starts to run.

On realtime execution you can't do that, just store values in vars, one by one.
Reply
#3

Thanks for your answer I will do it manually, so...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)