SA-MP Forums Archive
Variable - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Variable (/showthread.php?tid=486471)



Variable - halil69 - 08.01.2014

Which is more optimized?

new variable[3][MAX_PLAYERS];

or

new variable1[MAX_PLAYERS];
new variable2[MAX_PLAYERS];
new variable3[MAX_PLAYERS];


Re: Variable - MatriXgaMer - 08.01.2014

Hmm, try using the
pawn Код:
new variable1[MAX_PLAYERS];
new variable2[MAX_PLAYERS];
new variable3[MAX_PLAYERS];
Because
pawn Код:
new variable[3][MAX_PLAYERS];
can be buggy.


Re: Variable - Seif- - 08.01.2014

Quote:
Originally Posted by MatriXgaMer
Посмотреть сообщение
Hmm, try using the
pawn Код:
new variable1[MAX_PLAYERS];
new variable2[MAX_PLAYERS];
new variable3[MAX_PLAYERS];
Because
pawn Код:
new variable[3][MAX_PLAYERS];
can be buggy.
No it's not buggy unless you make it buggy. Both methods use the same amount of bytes. The efficient way is multidimensional arrays.


Re: Variable - park4bmx - 08.01.2014

Quote:
Originally Posted by MatriXgaMer
Посмотреть сообщение
can be buggy.
Whatever you say boss