Another pawno bug
#1

Hello, I have found a bug with multi-index non-global variables.

Here is the example:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[100], i;
cmd = strtok(cmdtext, i);
if(!strcmp(cmd, "/XYZ", true))
{
new pos[3][50];
for(new a; a<3; a++) pos[a] = strtok(cmdtext, i);
if(!strlen(pos[2])) return true;
return SetPlayerPos(playerid, floatstr(pos[0]), floatstr(pos[1]), floatstr(pos[2]));
}
if(!strcmp(cmd, "/XYZ_LOL", true))
{
new pos[3][50];
for(new a; a<3; a++) pos[a] = strtok(cmdtext, i);
if(!strlen(pos[2])) return true;
return SetPlayerPos(playerid, floatstr(pos[0]), floatstr(pos[1]), floatstr(pos[2]));
}
return false;
}
Compiler shows an error:

Код:
Symbol already defined ("pos").
When I remove the "new pos[3][50];" from second command, it compiles good, but...
In-game, when you type "/XYZ_LOL" it teleports you to coords 0.0 0.0 0.0. It means, that variable "pos" does no longer exist.

I would be glad, if this can be fixed.
Thanks.
Reply


Messages In This Thread
Another pawno bug - by ¤Adas¤ - 31.03.2010, 15:48
Re: Another pawno bug - by Finn - 31.03.2010, 16:40
Re: Another pawno bug - by ¤Adas¤ - 31.03.2010, 18:16
Re: Another pawno bug - by Westie - 31.03.2010, 18:16
Re: Another pawno bug - by ¤Adas¤ - 31.03.2010, 18:17
Re: Another pawno bug - by Joe Staff - 31.03.2010, 18:19
Re: Another pawno bug - by Mr L - 31.03.2010, 18:34
Re: Another pawno bug - by ¤Adas¤ - 31.03.2010, 18:43
Re: Another pawno bug - by RSX - 31.03.2010, 20:45

Forum Jump:


Users browsing this thread: 2 Guest(s)