SA-MP Forums Archive
warning with string - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: warning with string (/showthread.php?tid=130517)



warning with string - Dainyzxz - 27.02.2010

warnning:
Код:
local variable "string" shadows a variable at a preceding level
in this code:
Код:
new string[256];
new playername[250];
GetPlayerName(playerid,playername,sizeof(playername));
format(string, sizeof(string), "[/MENIU]: %s work in police, if you want too, use: /meniu", playername);
SendClientMessageToAll(COLOR_ORANGE, string);



Re: warning with string - Hiitch - 27.02.2010

That warning means you alerady created a variable called string, and it's a duplicate of it, just rename the string that you have that warning with.

E.g.

2 strings = new string[64];
= new string[25];

change one of them to something else.

so it would be:

new string[64];

new setstring[64];

if you get that warning, it could also be because it's a global var, and you are trying to reuse it.


Re: warning with string - Dainyzxz - 27.02.2010

really thanks


Re: warning with string - Hiitch - 27.02.2010

Quote:
Originally Posted by SpectroTek
really thanks
No problem.