String array
#1

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.
Reply
#2

Probably missing brackets ?
Reply
#3

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;
}
Reply
#4

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");
Reply
#5

Check with this: http://code.******.com/p/bracket-fin...r.zip&can=2&q=
Reply
#6

No it's ok vince had correct answer

off topic: LOL! @string's
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)