SA-MP Forums Archive
error 021: symbol already defined: "NameTimer" - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 021: symbol already defined: "NameTimer" (/showthread.php?tid=97026)



error 021: symbol already defined: "NameTimer" - x-unit - 12.09.2009

I got this one error when i trying to compile

error 021: symbol already defined: "NameTimer"
warning 203: symbol is never used: "vehicleEntered"

Code 1 where the "nametimer" is :
Код:
public CustomPickups()
{
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new string[128];
	NameTimer();
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			GetPlayerPos(i, oldposx, oldposy, oldposz);
			new tmpcar = GetPlayerVehicleID(i);
			if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0
2nd place where the "nametimer" is :
Код:
public NameTimer()
{
	for(new i = 0;i < MAX_PLAYERS;i++)
 	{
	 	if(IsPlayerConnected(i))
 		{
 			for(new q = 0;q < MAX_PLAYERS;q++)
 			{
				if(IsPlayerConnected(q))
				{
 					new Float:p1x;
					new Float:p1y;
					new Float:p1z;
					new Float:p2x;
					new Float:p2y;
					new Float:p2z;
					if(IsPlayerConnected(i) && IsPlayerConnected(q))
					{
						GetPlayerPos(i,p1x,p1y,p1z);
  					GetPlayerPos(q,p2x,p2y,p2z);
						if(GetPointDistanceToPointExMorph(p1x,p1y,p1z,p2x,p2y,p2z) < pdistance)
						{
							if(PlayerInfo[q][pMaskuse] != 1)
	  					{
								ShowPlayerNameTagForPlayer(i,q,1);
							}
	  				}
						else
						{
							ShowPlayerNameTagForPlayer(i,q,0);
						}
          }
        }
      }
    }
	}
}



Re: error 021: symbol already defined: "NameTimer" it isn't defined 2 times :/ - MadeMan - 12.09.2009

You are using an include that also defines it.


Re: error 021: symbol already defined: "NameTimer" it isn't defined 2 times :/ - x-unit - 12.09.2009

Quote:
Originally Posted by MadeMan
You are using an include that also defines it.
What should i do to fix it ?


Re: error 021: symbol already defined: "NameTimer" - MadeMan - 12.09.2009

Delete NameTimer func from your script or remove the #include line that includes the file that defines it.


Re: error 021: symbol already defined: "NameTimer" - x-unit - 12.09.2009

To delete the nametimer function you mean to delete only the line where it is or delete the whole function code?


Re: error 021: symbol already defined: "NameTimer" - MadeMan - 12.09.2009

Delete the function code only.


Re: error 021: symbol already defined: "NameTimer" - x-unit - 12.09.2009

thanks it is working but i have a question ,will i loose some functions by deleting that func ?


Re: error 021: symbol already defined: "NameTimer" - MadeMan - 12.09.2009

You won't lose this func if you have it defined already in your include file. And I guess you have it defined, otherwise you wouldn't got this error.


Re: error 021: symbol already defined: "NameTimer" - x-unit - 12.09.2009

ok thnx . Yes i have checked almost all the commands and functions of the gamemode and it's working normally thnx again