String array - 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: String array (
/showthread.php?tid=382015)
String array -
thefatshizms - 01.10.2012
Hello I'm kinda ducking up here and I dunno why:
pawn Код:
new string[2][128];
format(string[1], sizeof(string[1]), "test");
format(string[2], sizeof(string[2]), "test2");
Get these errors : (they are on the first format line)
Код:
C:\Users\iphone\Desktop\SFCNR\Sfcnr Scripting\gamemodes\Sfcnr.pwn(4366) : error 001: expected token: "]", but found "-integer value-"
C:\Users\iphone\Desktop\SFCNR\Sfcnr Scripting\gamemodes\Sfcnr.pwn(4366) : warning 215: expression has no effect
C:\Users\iphone\Desktop\SFCNR\Sfcnr Scripting\gamemodes\Sfcnr.pwn(4366) : error 001: expected token: ";", but found "]"
C:\Users\iphone\Desktop\SFCNR\Sfcnr Scripting\gamemodes\Sfcnr.pwn(4366) : error 029: invalid expression, assumed zero
C:\Users\iphone\Desktop\SFCNR\Sfcnr Scripting\gamemodes\Sfcnr.pwn(4366) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: String array -
Red_Dragon. - 01.10.2012
Probably missing brackets ?
Re: String array -
thefatshizms - 01.10.2012
where? in the format? cause im testing this in a simple cmd
pawn Код:
CMD:string(playerid, params[])
{
new string[2][128];
format(string[1], sizeof(string[1]), "penis");
format(string[2], sizeof(string[2]), "llol");
return 1;
}
Re: String array -
Vince - 01.10.2012
Never use dimensions in the sizeof operator. Also array indices start at 0.
pawn Код:
format(string[0], sizeof(string[]), "penis");
format(string[1], sizeof(string[]), "llol");
Re: String array -
Red_Dragon. - 01.10.2012
Check with this:
http://code.******.com/p/bracket-fin...r.zip&can=2&q=
Re: String array -
thefatshizms - 01.10.2012
No it's ok vince had correct answer
off topic: LOL! @string's