Help for error 001: variables
#1

Hello.

I shall like testing a filterscript but this one has errors during the compilation.
Код:
error 001: expected token: "{", but found "-integer value-"
error 001: expected token: "}", but found ";"
Код HTML:
new  HoldingButton[MAX_PLAYERS][2] = 0;
new	PlayerButtonTimer[MAX_PLAYERS];
The error comes from this first variable.

The author of the filterscript had made like that:
Код HTML:
new
    HoldingButton[MAX_PLAYERS][2] = 0,
    PlayerButtonTimer[MAX_PLAYERS]
;
I found no problem similar to variables of this type on the Internet.

Thank you for your help !
Reply
#2

Look at this:

PHP код:
HoldingButton[MAX_PLAYERS][2] = 0
You can't do that, this way...but actually you dont need it, cause variables (in pawn) automaticly initialized with zero.

So just write it like this:

PHP код:
new  HoldingButton[MAX_PLAYERS][2];
new    
PlayerButtonTimer[MAX_PLAYERS]; 
PS: If you want to initialisize an Array, it would look like this:

PHP код:
//For 1 Dimension
new test[5] = {0, ...};
//For 2 Dimensions:
new test[5][2] = {
    {
0,0},
    {
0,0},
    {
0,0},
    {
0,0},
    {
0,0}
}; 
and so on
Reply
#3

Simply...
I had not understood that he had used a syntax of array but that there was no array.

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)