Array length - 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: Array length (
/showthread.php?tid=157161)
Array length -
selEcT - 05.07.2010
Hi guys,
how long can be an array?
I've got an array (field) in my script that is defined with
new field[110][128];
but I think it doesn't work, because I tested it so:
print("nothing");
new field[110][128];
print("field"); (<-- it's not desplayed in the server monitor)
Could that be?
Greez, selEcT
Re: Array length -
Matite - 05.07.2010
Lets go back to basics...
If you want to just store a string (some text) then do this:
In simple terms the 32 part means it can store up to 32 characters.
When you want to view the contents of your variable in the server console do this:
pawn Код:
printf("My field variable is: %s", field);
Hope this gets you on track.
Re: Array length -
selEcT - 06.07.2010
I think you don't understand.
here:
http://www.strickenkid.info/mysql_plugin/example.pwn
He has "new field[4][32]" and I'd like to have "new field[110][32]" (110 fields with a string length of 32). But it doesn't work.. WHY?