Annoying variable problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Annoying variable problem (
/showthread.php?tid=298394)
Annoying variable problem -
oliverrud - 20.11.2011
I'm having this annoying problem, and I still don't get why, but I do know whats causing it so I was hoping somebody here knew the reason for it.
Example:
pawn Код:
if(PlayerID == 1){ new query[50]; }
else if(PlayerID == 2){ new query[50];}
I seem to get the error: error 021: symbol already defined: "query"
Is there no way to fix this or do I really have to always make sure they are not called the same the variables? It does not effect every single variable, but I think its just those who are on the same "indent" level or something like that. I'm not completely sure though.
Re: Annoying variable problem -
Kostas' - 20.11.2011
pawn Код:
new query[50];
if(PlayerID == 1){ query }
else if(PlayerID == 2){ query}
Re: Annoying variable problem -
oliverrud - 20.11.2011
Rofl, haven't actually thought of that even though its the simplest solution and its basically suggestioning it to you, thanks.
Re: Annoying variable problem -
MP2 - 20.11.2011
What are you actually attempting to do? That code makes absolutely no sense whatsoever.