error - undefined symbol "i"
#1

Hello, I trying to resolve the error " undefined symbol i ", but with no luck.

Here's the code:

Код:
	else if(PlayerInfo[playerid][pHousekey] == i)
	{
		SetPlayerInterior(playerid,0);
	        SetPlayerToTeamColor(playerid);
		SetPlayerVirtualWorld(playerid,0);
		SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
		return 1;
	}
Thanks
Reply
#2

"i" It's a variable and i assume you did not script that
add a loop with your code inside
pawn Код:
for(new i; i < MAX_HOUSES; i++)
{
// YOUR CODE GOES HERE sorry caps
}
Good luck
Reply
#3

Код:
	else if(PlayerInfo[playerid][pHousekey] == i)
	{
	for(new i; i < MAX_HOUSES; i++)
	{
		SetPlayerInterior(playerid,0);
	        SetPlayerToTeamColor(playerid);
		SetPlayerVirtualWorld(playerid,0);
		SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
		return 1;
		}
	}
Thanks for reply, but now are the following issues:
undefined symbol "i"
undefined symbol "MAX_HOUSES"

btw. I'm using a Godfather edit.

Tried with:

for(new i = 0; i < sizeof(HouseInfo); i++)

now it's " undefined symbol "i" "
Reply
#4

Код:
        for(new i; i < MAX_HOUSES; i++)
        {
	     else if(PlayerInfo[playerid][pHousekey] == i)
	     {
		     SetPlayerInterior(playerid,0);
	             SetPlayerToTeamColor(playerid);
		     SetPlayerVirtualWorld(playerid,0);
		     SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
		     return 1;
	     }
	}
Because you create i after the statement!

EDIT: and define MAX_HOUSES:
pawn Код:
//top of the code
#define MAX_HOUSES [your max houses numbers, like..] 50
Reply
#5

I got MAX_HOUSES defined as SCRIPT_MAXHOUSES, so there's no problem.

Script looks like this - http://codepad.org/6gZB83zm

error 029: invalid expression, assumed zero
error 001: expected token: ";", but found "if"
error 029: invalid expression, assumed zero
error 001: expected token: ";", but found "if"

New errors, help please? :S
Reply
#6

Show more code.
Reply
#7

If I remove

for(new i; i < SCRIPT_MAXHOUSES; i++)

those errors disappear and only one is

" undefined symbol "i" "
Reply
#8

Bump after 24hours.
Reply
#9

You have to show more code. If you don't, then don't expect any help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)