SA-MP Forums Archive
local variable "time" Help!!! +REP - 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: local variable "time" Help!!! +REP (/showthread.php?tid=562385)



local variable "time" Help!!! +REP - CopKing123 - 08.02.2015

Ok So Here's The Warnings...
I know errors are more important, but pls help me out with this...

Код:
C:\Users\CopKing\Desktop\MA ASS\pawno\include\YSI\y_va/impl.inc(568) : warning 219: local variable "time" shadows a variable at a preceding level
C:\Users\CopKing\Desktop\MA ASS\pawno\include\YSI\y_va/impl.inc(573) : warning 219: local variable "time" shadows a variable at a preceding level
C:\Users\CopKing\Desktop\MA ASS\pawno\include\YSI\y_hooks/impl.inc(2624) : warning 219: local variable "time" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Код:
if(Map[EvacType] == 2)
	    {
			SetPlayerPos(playerid,3024.4983,447.9744,14.7813);
			SetPlayerInterior(playerid,0);
Line 568---------->format(string,sizeof(string), ""chat""COL_LIGHTBLUE" %s made it to the water evacuation point and has received 1 coin!",PlayerName(playerid)); 
			SendClientMessageToAll(-1,string);
			DisablePlayerCheckpoint(playerid);
			CurePlayer(playerid);
			GivePlayerXP(playerid,50);
			pInfo[playerid][pEvac]++; <------------ Line 573
			pInfo[playerid][pCoins]++;
			SetPlayerColor(playerid,COLOR_YELLOW);
		}
__________________________________________________ _____
Код:
if(PRESSED(KEY_WALK))
	{
	    if(team[playerid] == TEAM_ZOMBIE)
Line 2624    {
			if(pInfo[playerid][pZombieClass] == SCREAMERZOMBIE)
			{
			    if(gettime() - 9 < Abilitys[playerid][ScreamerZombieAb]) return GameTextForPlayer(playerid,"~w~ Still recovering",1000,5);
			    {
					foreach(Player,i)
					{
          				switch(GetPlayerSkin(i))
     					{
     					    case NON_IMMUNE,285:
							{



Re: local variable "time" Help!!! +REP - Misiur - 08.02.2015

Those errors come from other file, but are caused by your gamemode. Do you have global variable named "time"? If yes, find and replace all occurances of it in your script. https://github.com/Y-Less/YSI-Includ.../impl.inc#L578 y_va in YSI 3.1 apparently reserves that name.


Re: local variable "time" Help!!! +REP - CopKing123 - 08.02.2015

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Those errors come from other file, but are caused by your gamemode. Do you have global variable named "time"? If yes, find and replace all occurances of it in your script. https://github.com/Y-Less/YSI-Includ.../impl.inc#L578 y_va in YSI 3.1 apparently reserves that name.
I dont understand what you said lol...!!
which file is causing this, and no i dont have a global variable named "time"


Re: local variable "time" Help!!! +REP - Tamy - 08.02.2015

I think, the variable with name "time" is used in that include you're using.

Just search for the variable "time" in your script and change the name of variable to something else.


Re: local variable "time" Help!!! +REP - CopKing123 - 08.02.2015

Tamy, i change time to what??

any examples?


Re: local variable "time" Help!!! +REP - HazardouS - 08.02.2015

time1, Time, timE, whatever you want.


Re: local variable "time" Help!!! +REP - CopKing123 - 08.02.2015

nope still im getting warnings


Re: local variable "time" Help!!! +REP - Vince - 08.02.2015

Common practice is to prefix global variables with 'g'. However, globals should be avoided wherever possible. If a variable is only used in one function, but it needs to retain its value between calls then use a static local.


Re: local variable "time" Help!!! +REP - CopKing123 - 08.02.2015

Ok whenever i search for time it shows these....
and when i changed TIME to time2 or timE .. it gives error

Код:
// Defines
#define function%0(%1) forward%0(%1);public%0(%1)
#define NON_IMMUNE 69,14,261,2,107,11,125,6,299,43,124,12,13,280,230,274,27,25,95,260,149,29,161,76,23,115,287,67,200
#define MAX_MAPTIME 250
#define MAX_RESTART_TIME 10000
#define MAX_MAPUPDATE_TIME 1450
#define MAX_SHOW_CP_TIME 1000
#define MAX_END_TIME 60000
#define MAX_BALANCERUPDATE_TIME 6000
#define MAX_MAP_FILES 19
#define SCM SendClientMessage
#define SCMTA SendClientMessageToAll



Re: local variable "time" Help!!! +REP - HazardouS - 08.02.2015

You know what? Maybe your GM is fine. Maybe your includes are badly written and just the "time" variable inside them is causing the problem. Try taking a look at those lines in the specified includes.