"error 021: symbol already defined" pawn bug?
#1

When I use script like:
Код:
if (something)
{
	new xx[5][5]; // 5 just for example
}else{
	new xx[5][5]; // error 021: symbol already defined: "xx"
}
It will cause error 021: symbol already defined: "xx" on 5. line. Why?


There is everything ok:
Код:
if (something)
{
	new xx[5]; // 5 just for example
}else{
	new xx[5]; // 5 just for example
}
but if I use 2+ arrays [..][..], it will cause error.
Код:
if (something)
{
	new xx[5][5][5]; // 5 just for example
}else{
	new xx[5][5][5]; // error 021: symbol already defined: "xx"
}
It is a pawn bug?
Reply
#2

pawn Код:
new xx[5];
if(something)
{
   //use of xx
}
else
{
  // use of xx
}
Reply
#3

Hmm it's a possible solution, but I just wanted to use different arrays like:
pawn Код:
if (something)
{
    new xx[2][20];
}else{
    new xx[2][80];
}
Reply
#4

Why would you need to do such?
Can you give an example on how you would use it after that.
Reply
#5

Just use it before 'if'.
I also don't understand why you need to do that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)