SA-MP Forums Archive
9 Warnings - Could you help me? Thanks. - 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: 9 Warnings - Could you help me? Thanks. (/showthread.php?tid=286251)



9 Warnings - Could you help me? Thanks. - Ehab1911 - 27.09.2011

pawn Код:
D:\country gamemode\samp03dsvr_RC2_win32\gamemodes\elitedrift.pwn(1372) : warning 219: local variable "string" shadows a variable at a preceding level
D:\country gamemode\samp03dsvr_RC2_win32\gamemodes\elitedrift.pwn(1389) : warning 219: local variable "string" shadows a variable at a preceding level
D:\country gamemode\samp03dsvr_RC2_win32\gamemodes\elitedrift.pwn(1437) : warning 219: local variable "string" shadows a variable at a preceding level
D:\country gamemode\samp03dsvr_RC2_win32\gamemodes\elitedrift.pwn(2641) : warning 219: local variable "string" shadows a variable at a preceding level
D:\country gamemode\samp03dsvr_RC2_win32\gamemodes\elitedrift.pwn(2673) : warning 219: local variable "string" shadows a variable at a preceding level
D:\country gamemode\samp03dsvr_RC2_win32\gamemodes\elitedrift.pwn(2695) : warning 219: local variable "string" shadows a variable at a preceding level
D:\country gamemode\samp03dsvr_RC2_win32\gamemodes\elitedrift.pwn(2711) : warning 219: local variable "string" shadows a variable at a preceding level
D:\country gamemode\samp03dsvr_RC2_win32\gamemodes\elitedrift.pwn(3086) : warning 219: local variable "string" shadows a variable at a preceding level
D:\country gamemode\samp03dsvr_RC2_win32\gamemodes\elitedrift.pwn(3092) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


9 Warnings.



Re: 9 Warnings - Could you help me? Thanks. - admantis - 27.09.2011

You did this, for example:

pawn Код:
new string[128];
for(new i = 0; i < 500; i++ )
{
    new string[128];
}
No need to define it twice!


Re: 9 Warnings - Could you help me? Thanks. - Ehab1911 - 27.09.2011

Код:
Line 1372:     new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
Line 1389:    new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
Line 1437: 	new string[256];
Line 2641:						        string[128],
Line 2673:			                       string[128]
2695:					string[128]
2711: 				new string[256],year,month,day,hours,minutes,seconds;
3086:		        new string[250];
3092:		        new string[300];



Re: 9 Warnings - Could you help me? Thanks. - admantis - 27.09.2011

If you already defined 'string' above, you should delete new string. (in the lines where it gives warning).


Re: 9 Warnings - Could you help me? Thanks. - Ehab1911 - 27.09.2011

Oh, LOL. Thank you mate 1 rep +