#define MAX_PLAYER (500)
mislis
#undef
#define MAX_PLAYERS 500
string, msg, Float:Pos
zasto toliko velik string?
zasto array?
Quote
Arrays are slower than normal variables
The following code is inefficient:
Code:
new Float:pos;
GetPlayerPos(playerid, pos, pos, pos);
And here is the assembly version of that above code:
Code:
zero.pri
addr.alt fffffff4
fill c ;These 3 instructions are responsible for zeroing all the array elements
break ; 38
addr.pri fffffff4 ;Get the address of the array
add.c 8 ;Add the index (index 2 means 2*4 bytes ahead)
load.i ;This will get the value stored at that address
push.pri ;Now push the argument
addr.pri fffffff4 ;Same as above
add.c 4
load.i
push.pri
addr.pri fffffff4 ;Same as above
load.i
push.pri
Now here is an equivalent code written more efficiently:
Code:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y , z);
And here is the assembly version:
Code:
push.c 0 //Making room for the variables on the stack
push.c 0
push.c 0
push.adr fffffff4 //Pushing the arguments
push.adr fffffff8
push.adr fffffffc
for(new scid = 1;
Kreces od 0 a ne od 1 da pristupis svakom, ako bi krenuo od 1 onda bi propustio 0 ili grijesim?
Imas svugdje prevelike stringove, da si optimizovao i da si koristio streamer bilo bi tip top, ali ovako je isto super, gj