SA-MP Forums Archive
Help me in Fixing some warnings... - 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: Help me in Fixing some warnings... (/showthread.php?tid=580331)



Help me in Fixing some warnings... - danish007 - 04.07.2015

Код:
D:\Danish\Zombie Gamemode\pawno\include\YSI\y_va/impl.inc(568) : warning 219: local variable "time" shadows a variable at a preceding level
D:\Danish\Zombie Gamemode\pawno\include\YSI\y_va/impl.inc(573) : warning 219: local variable "time" shadows a variable at a preceding level
D:\Danish\Zombie Gamemode\pawno\include\YSI\y_hooks/impl.inc(2626) : warning 219: local variable "time" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
when i compiled gamemode i found these warning s can anyone help me how can i fix it?


AW: Help me in Fixing some warnings... - Kaliber - 04.07.2015

You have a global variable "time" in your script.

You made it like this:

PHP код:
new time//maybe looks like this...or new time[12]; ...or new Text:time; ..this
//Now replace the new and write:
static time
Then the Warnings disappear..or just rename the variable


Re: Help me in Fixing some warnings... - Lynn - 04.07.2015

Changing something from a 'new' to 'static' won't change anything.
Static simply means it's only used by this file and can't be shared or altered by others.

You need to increase the variable.
If you have, new Time[10]; Try doing new Time[11]; etc. Until you find the right one.
However, don't go over what you need either.