warning 219: local variable "str" shadows a variable at a preceding level - 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: warning 219: local variable "str" shadows a variable at a preceding level (
/showthread.php?tid=611878)
warning 219: local variable "str" shadows a variable at a preceding level -
Izaki - 11.07.2016
PHP код:
\pawno\include\YSI\y_debug.inc(277) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_debug.inc(339) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_debug.inc(344) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_amx.inc(454) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_amx.inc(904) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_amx.inc(926) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_utils.inc(246) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_utils.inc(369) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_utils.inc(396) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_utils.inc(475) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_malloc.inc(488) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_malloc.inc(613) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_timers/impl.inc(338) : warning 219: local variable "str" shadows a variable at a preceding level
\pawno\include\YSI\y_timers/impl.inc(358) : warning 219: local variable "str" shadows a variable at a preceding level
\gamemodes\zma.pwn(400) : warning 219: local variable "str" shadows a variable at a preceding level
\gamemodes\zma.pwn(470) : warning 219: local variable "str" shadows a variable at a preceding level
\gamemodes\zma.pwn(500) : warning 219: local variable "str" shadows a variable at a preceding level
please help me
PHP код:
function OnMapUpdate()
{
gtime -= 1;
new str[64];
format(str,sizeof(str),"~r~%d",gtime);
TextDrawSetString(TimeLeft,str);
if(gtime <= 0) TextDrawSetString(TimeLeft,"~y~Evac"),KillTimer(mapvar),KillTimer(balvar),SetTimer("ShowCheckpoint",MAX_SHOW_CP_TIME,false);
return 1;
}
Re: warning 219: local variable "str" shadows a variable at a preceding level - WhiteGhost - 11.07.2016
Because u already have "Str" in your script before.
Re: warning 219: local variable "str" shadows a variable at a preceding level -
Izaki - 11.07.2016
And what How to fix it ?
Re: warning 219: local variable "str" shadows a variable at a preceding level -
DarkSkull - 11.07.2016
Try this:
PHP код:
function OnMapUpdate()
{
gtime -= 1;
new string[64];
format(string,sizeof(string),"~r~%d",gtime);
TextDrawSetString(TimeLeft,string);
if(gtime <= 0) TextDrawSetString(TimeLeft,"~y~Evac"),KillTimer(mapvar),KillTimer(balvar),SetTimer("ShowCheckpoint",MAX_SHOW_CP_TIME,false);
return 1;
}
Re: warning 219: local variable "str" shadows a variable at a preceding level -
Izaki - 11.07.2016
thanks dark skulls , fixed