SA-MP Forums Archive
error 017: 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)
+--- Thread: error 017: undefined symbol "i" (/showthread.php?tid=504519)



error 017: undefined symbol "i" - Slicebook - 04.04.2014

how to fix? help

Код:
            case 1:
				{
					BementIdo[playerid] = 3;
					new hazak = sizeof(HouseInfo);
					if(IsAt(playerid,IsAt_HazElott) != NINCS)
					for(new i = 0; i < hazak; i++)
					if(PlayerToPoint(1, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
					if(HouseInfo[i][hDrog] != 1) return Msg(playerid,"A hбzban nincs droglabor!");
					SetPlayerVirtualWorld(playerid, i); <<ERROR!
					SetPlayerPos(playerid,1253.2783,-1701.6456,6319.3672);
					Freeze(playerid,5000);
					GameTextForPlayer(playerid, "~w~Ьdv itt!", 2000, 1);
					PlayerInfo[playerid][pLocal] = i; <<ERROR!
					Hazbanvan[playerid] = 1;
				}	
			}	
		}
	}
D:\Mбtй kйpei\RPG\26febrmof\icerpg.pwn(13346) : error 017: undefined symbol "i"
D:\Mбtй kйpei\RPG\26febrmof\icerpg.pwn(13350) : error 017: undefined symbol "i"


Re: error 017: undefined symbol "i" - micha654 - 04.04.2014

Instead of writing:
Код:
[pLocal] = i;
Try this:
Код:
[pLocal] = i+6000;
__________________
+REP If I helped you




Re: error 017: undefined symbol "i" - Dignity - 04.04.2014

Quote:
Originally Posted by micha654
Посмотреть сообщение
Instead of writing:
Код:
[pLocal] = i;
Try this:
Код:
[pLocal] = i+6000;
__________________
+REP If I helped you
How is that going to help him? It still won't define what the "i" is.

pawn Код:
case 1:
                {
                    for(new i = 0; i < hazak; i++)
                    {
                        if(PlayerToPoint(1, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
                        if(HouseInfo[i][hDrog] != 1) return Msg(playerid,"A hбzban nincs droglabor!");
                        SetPlayerVirtualWorld(playerid, i); <<ERROR!
                        SetPlayerPos(playerid,1253.2783,-1701.6456,6319.3672);
                        Freeze(playerid,5000);
                        GameTextForPlayer(playerid, "~w~Ьdv itt!", 2000, 1);
                        PlayerInfo[playerid][pLocal] = i; <<ERROR!
                        Hazbanvan[playerid] = 1;
                    }
                }  
            }  
        }
    }
Maybe adding callbacks fixes it. It'd be easier for me to understand if I knew what you were trying to do. Nevertheless; try this.


Re: error 017: undefined symbol "i" - Slicebook - 04.04.2014

Код:
for(new i = 0; i < hazak; i++)
Код:
error 017: undefined symbol "hazak"



Re: error 017: undefined symbol "i" - Dignity - 04.04.2014

Quote:
Originally Posted by Slicebook
Посмотреть сообщение
Код:
for(new i = 0; i < hazak; i++)
Код:
error 017: undefined symbol "hazak"
What is "hazak" supposed to be?


Re: error 017: undefined symbol "i" - Slicebook - 04.04.2014

succeeded, thanks for the help


Re: error 017: undefined symbol "i" - DerickClark - 04.04.2014

By the way,

"I" means playerid.


Re: error 017: undefined symbol "i" - Dignity - 04.04.2014

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
By the way,

"I" means playerid.
Not always, "i" can be anything what you define it to be. In most cases however, it is defined as "playerid" in a loop.


Re: error 017: undefined symbol "i" - DerickClark - 04.04.2014

Quote:
Originally Posted by Mionee
Посмотреть сообщение
Not always, "i" can be anything what you define it to be. In most cases however, it is defined as "playerid" in a loop.
yea.