Error when there shouldn't be
#1

I have something that's like this

pawn Код:
if(...)
{
  if(...)
  {
    ....
  }
  ...
  new string[3][4];
  ... Use string in here ....
}
if(...)
{
  if(...)
  {
    ...
  }
  ...
  new string[2][4]; line 50
  ... Use string in here ...
}
and I get an error
Код:
(50) : error 021: symbol already defined: "string"
But since they're not apart of the same section, why is it giving me that error?

ADDED* but when I comment line 50, it says Undefined Symbol "string"
Reply
#2

It probably means you have "string" defined globally, somewhere on top of your gamemode, so change "string" to something else.
Reply
#3

It's an empty script, I'm starting from scratch. I don't really care though, I just changed the variable's name and got on with my life.
Reply
#4

Try this

Quote:
Originally Posted by Joe Staff
I have something that's like this

pawn Код:
if(...)
{
  if(...)
  {
    ....
  }
  ...
  new string[3][4];
  ... Use string in here ....
}
if(...)
{
  if(...)
  {
    ...
  }
  ...
  ... Use string in here ...
}
and I get an error
Код:
(50) : error 021: symbol already defined: "string"
But since they're not apart of the same section, why is it giving me that error?

ADDED* but when I comment line 50, it says Undefined Symbol "string"
Reply
#5

That causes the script to hault, because it's trying to set a string that doesn't exist. It's fine now, I just changed the name. I was just trying to make my script easy to add to for others.
Reply
#6

Word "string" is sometimes used in functions parameters too, like

pawn Код:
MyFunction(playerid, string[])
so that may also cause that error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)