SA-MP Forums Archive
Undefined symbol "i" - 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: Undefined symbol "i" (/showthread.php?tid=131903)



Undefined symbol "i" - Centulo - 05.03.2010

Hello scripters!

I'm making a tutorial for my server ( Godfather based ) and I get this error's"

Код:
D:\Servers\Killer\gamemodes\gamemode.pwn(305) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(307) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(308) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(310) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(311) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(312) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(313) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(315) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(317) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(319) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(321) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(322) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(323) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(324) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(325) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(326) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(328) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(330) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(332) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(334) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(335) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(336) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(337) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(338) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(339) : error 017: undefined symbol "i"
D:\Servers\Killer\gamemodes\gamemode.pwn(341) : error 017: undefined symbol "i"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Could anyone help me?


Re: Undefined symbol "i" - Calgon - 05.03.2010

We're not psychic, show us the lines that are causing the errors.


Re: Undefined symbol "i" - Centulo - 05.03.2010

Код:
			if(TutTime[i] >= 1)
			{
				TutTime[i] += 1;
				if(TutTime[i] == 3)
				{



Re: Undefined symbol "i" - Hot - 05.03.2010

Can you post your whole callback? I can't understand anything from that you had post.
Do you have a loop before the "If's"? As Calgon said:
Quote:
Originally Posted by CalgonX
We're not psychic, show us the lines that are causing the errors.



Re: Undefined symbol "i" - Calgon - 05.03.2010

Show me the lines between where you declare 'i' and the lines you've just shown me.


Re: Undefined symbol "i" - Centulo - 05.03.2010

Код:
forward SetPlayerUnjail();
Код:
public SetPlayerUnjail()
{
			if(TutTime[i] >= 1)
			{
				TutTime[i] += 1;
				if(TutTime[i] == 3)
				{
					SendClientMessage(i, COLOR_YELLOW, "Text comes here");
				}
				else if(TutTime[i] == 10)
				{
					SendClientMessage(i, COLOR_YELLOW, "Text comes here");
				}
				else if(TutTime[i] == 15)
				{
					TutTime[i] = 0; PlayerInfo[i][pTut] = 1;
					gOoc[i] = 0; gNews[i] = 0; gFam[i] = 0;
					TogglePlayerControllable(i, 1);
					MedicBill[i] = 0;
					SetPlayerSpawn(i);
				}
			}
		}
	}
}



Re: Undefined symbol "i" - MaykoX - 05.03.2010

Код:
new i = 0; i < MAX_PLAYERS; i++
You are missing something like that...


Re: Undefined symbol "i" - Hot - 05.03.2010

You have removed the loop. I think this might work.

Код:
public SetPlayerUnjail()
{
	for(new i=0; i<sizeof(TutTime); i++)
	{
		if(TutTime[i] >= 1)
		{
			TutTime[i] += 1;
			if(TutTime[i] == 3)
			{
				SendClientMessage(i, COLOR_YELLOW, "Text comes here");
			}
			else if(TutTime[i] == 10)
			{
				SendClientMessage(i, COLOR_YELLOW, "Text comes here");
			}
			else if(TutTime[i] == 15)
			{
				TutTime[i] = 0; PlayerInfo[i][pTut] = 1;
				gOoc[i] = 0; gNews[i] = 0; gFam[i] = 0;
				TogglePlayerControllable(i, 1);
				MedicBill[i] = 0;
				SetPlayerSpawn(i);
			}
		}
	}
}



Re: Undefined symbol "i" - Centulo - 05.03.2010

Quote:
Originally Posted by † мąүқоҳ™
Код:
new i = 0; i < MAX_PLAYERS; i++
You are missing something like that...
Yes, I fixed it. Thanks all for the fast reply's!


Re: Undefined symbol "i" - Calgon - 05.03.2010

Quote:
Originally Posted by Centulo
Код:
forward SetPlayerUnjail();
Код:
public SetPlayerUnjail()
{
			if(TutTime[i] >= 1)
			{
				TutTime[i] += 1;
				if(TutTime[i] == 3)
				{
					SendClientMessage(i, COLOR_YELLOW, "Text comes here");
				}
				else if(TutTime[i] == 10)
				{
					SendClientMessage(i, COLOR_YELLOW, "Text comes here");
				}
				else if(TutTime[i] == 15)
				{
					TutTime[i] = 0; PlayerInfo[i][pTut] = 1;
					gOoc[i] = 0; gNews[i] = 0; gFam[i] = 0;
					TogglePlayerControllable(i, 1);
					MedicBill[i] = 0;
					SetPlayerSpawn(i);
				}
			}
		}
	}
}
You're not even declaring 'i' - this is your problem!

pawn Код:
public SetPlayerUnjail()
{
  for( new i = 0; i < MAX_PLAYERS; i++ )
  {
        if(TutTime[i] >= 1)
        {
            TutTime[i] += 1;
            if(TutTime[i] == 3)
            {
                SendClientMessage(i, COLOR_YELLOW, "Text comes here");
            }
            else if(TutTime[i] == 10)
            {
                SendClientMessage(i, COLOR_YELLOW, "Text comes here");
            }
            else if(TutTime[i] == 15)
            {
                TutTime[i] = 0; PlayerInfo[i][pTut] = 1;
                gOoc[i] = 0; gNews[i] = 0; gFam[i] = 0;
                TogglePlayerControllable(i, 1);
                MedicBill[i] = 0;
                SetPlayerSpawn(i);
            }
        }
    }
    return 1;
}