SA-MP Forums Archive
Simple Help. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Simple Help. (/showthread.php?tid=271531)



Simple Help. - iPLEOMAX - 24.07.2011

pawn Код:
new Text:Info[5][MAX_PLAYERS char]; //Seems to work fine for me.
//or
new Text:Info[MAX_PLAYERS][5]; //Didn't try this.
Basically what I'm trying to do is to make 5 textdraws for each player. So, which one of the above is good/correct?
And some tips will be appreciated.


Re: Simple Help. - MoroDan - 24.07.2011

This one:
PHP код:
new Text:Info[MAX_PLAYERS][5]; 
The first one, works only for the first 255 players and only to the first 255 textdraws .


Re: Simple Help. - iPLEOMAX - 24.07.2011

Quote:
Originally Posted by MoroDan
Посмотреть сообщение
This one:
PHP код:
new Text:Info[MAX_PLAYERS][5]; 
The first one, works only for the first 255 players and only to the first 255 textdraws .
Reason please?


Re: Simple Help. - MoroDan - 24.07.2011

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
Reason please?
If you declare like this:
PHP код:
new array[100]; 
There will be: 100 cells * 4 bytes
And this array can stock vals from [-(2 ^ 31), (2^31)]

But if you declare like this:
PHP код:
new array[100 char]; 
There will be: 100 cells
And this array can stock vals from [0, 2^8-1]
If your val will exceeds 255, it will take the module.

^ - means power


Re: Simple Help. - iPLEOMAX - 24.07.2011

Thank you for the help. rep+