SA-MP Forums Archive
Got 2 warnings when compile - 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: Got 2 warnings when compile (/showthread.php?tid=318785)



Got 2 warnings when compile - deltapro - 16.02.2012

This is the warnings
Код:
(25237) : warning 219: local variable "string" shadows a variable at a preceding level
(28306) : warning 219: local variable "tmpcar" shadows a variable at a preceding level
Line 25237 -
Код:
new string[MAX_STRING];
Line 28306 -
Код:
new tmpcar = GetPlayerVehicleID(playerid);
CAn anyone help me with this warnings
Thank you


Re: Got 2 warnings when compile - deltapro - 16.02.2012

Can you give me a example.. because i am beginner lvl 2


Re: Got 2 warnings when compile - park4bmx - 16.02.2012

you have defined these variables somewhere before !
just change the name to like string2


Re: Got 2 warnings when compile - Konstantinos - 16.02.2012

pawn Код:
// Global Variables
new string[ MAX_STRING ];

public OnGameModeInit( )
{
    new string[ MAX_STRING ]; // you define it again
    // Rest
    return 1;
Result: warning 219: local variable "string" shadows a variable at a preceding level


Re: Got 2 warnings when compile - deltapro - 16.02.2012

Fixed.
What about the second warning?