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)
+--- Thread: undefined symbol i? (/showthread.php?tid=365950)



undefined symbol i? - TaLhA XIV - 04.08.2012

PHP код:
if(HouseInfo[i][hOwned] = false
this it giving the error that undefined symbol i.
I have all the defines like define like:
PHP код:
#define MAX_HOUSES 100 
I have this one to :
PHP код:
new HouseInfo[MAX_HOUSES][hInfo]; 
Please help.


Re: undefined symbol i? - Misiur - 04.08.2012

Show more code surrounding if(HouseInfo[i][hOwned] = false)
i usually means it's a loop, so show whole loop if there is one


Re: undefined symbol i? - TaLhA XIV - 04.08.2012

PHP код:
        if(IsPlayerInRangeOfPoint(playerid1.5,-2789.1965,-181.2355,10.0625))
        {
            {
                if(
HouseInfo[i][hOwned] = false)
                
GameTextForPlayer(playerid,"blablabla",3000,5);
            }
            else
            {
                
GameTextForPlayer(playerid,"blablablabla",3000,5);
            }
        } 
I am using them like this.


Re: undefined symbol i? - Misiur - 04.08.2012

Still not enough. You don't have any i variable in sight. Show more code before, or try to find "i" variable. Otherwise you have variable with other name holding the id of house


Re: undefined symbol i? - TaLhA XIV - 04.08.2012

PHP код:
{
        if(
IsPlayerInRangeOfPoint(playerid1.5,-2789.1965,-181.2355,10.0625))
        {
            {
                if(
HouseInfo[i][hOwned] = false)
                
GameTextForPlayer(playerid,"blablabla",3000,5);
            }
            else
            {
                
GameTextForPlayer(playerid,"blablablabla",3000,5);
            }
        }
        if(
IsPlayerInRangeOfPoint(playerid1.5,-2786.7607,-175.4513,10.0625))
        {
            {
                if(
HouseInfo[i][hOwned] = false)
                
GameTextForPlayer(playerid,"House for sale",3000,5);
            }
        else
            {
                
GameTextForPlayer(playerid,"House is owned",3000,5);
            }
        }
        if(
IsPlayerInRangeOfPoint(playerid1.5,-2790.3088,-168.4088,7.2020))
          {
            {
                if(
HouseInfo[i][hOwned] = false)
                
GameTextForPlayer(playerid,"House for sale",3000,5);
            }
            else
            {
                
GameTextForPlayer(playerid,"House is owned",3000,5);
            }
        }
         if(
IsPlayerInRangeOfPoint(playerid1.5,-2791.5959,-146.0833,7.8594))
          {
            {
                if(
HouseInfo[i][hOwned] = false)
                
GameTextForPlayer(playerid,"House for sale",3000,5);
            }
            else
            {
                
GameTextForPlayer(playerid,"House is owned",3000,5);
            }
        }
           if(
IsPlayerInRangeOfPoint(playerid1.5,-2786.9595,-118.3625,10.0625))
          {
            {
                if(
HouseInfo[i][hOwned] = false)
                
GameTextForPlayer(playerid,"House for sale",3000,5);
            }
            else
            {
                
GameTextForPlayer(playerid,"House is owned",3000,5);
            }
        }
        if(
IsPlayerInRangeOfPoint(playerid1.5,-2790.2976,-110.8887,7.2020))
        {
            {
                if(
HouseInfo[i][hOwned] = false)
                
GameTextForPlayer(playerid,"House for sale",3000,5);
            }
            else
            {
                
GameTextForPlayer(playerid,"House is owned",3000,5);
            }
        }
         if(
IsPlayerInRangeOfPoint(playerid1.5,-2791.5867,-107.4266,7.8594))
          {
            {
                if(
HouseInfo[i][hOwned] = false)
                
GameTextForPlayer(playerid,"House for sale",3000,5);
            }
            else
            {
                
GameTextForPlayer(playerid,"House is owned",3000,5);
            }
        }
          if(
IsPlayerInRangeOfPoint(playerid1.5,-2786.9756,-89.7384,10.0625))
          {
            {
                if(
HouseInfo[i][hOwned] = false)
                
GameTextForPlayer(playerid,"House for sale",3000,5);
            }
            else
            {
                
GameTextForPlayer(playerid,"House is owned",3000,5);
            }
        }
           if(
IsPlayerInRangeOfPoint(playerid1.5,-2790.2649,-82.7106,7.1953))
          {
            {
                if(
HouseInfo[i][hOwned] = false)
                
GameTextForPlayer(playerid,"House for sale",3000,5);
            }
            else
            {
                
GameTextForPlayer(playerid,"House is owned",3000,5);
            }
        }
    return 
1;




Re: undefined symbol i? - TaLhA XIV - 04.08.2012

bump...
Please help.


Re: undefined symbol i? - TaLhA XIV - 04.08.2012

bump please please please help.


Re: undefined symbol i? - Abravanel - 04.08.2012

You should use a Loop


Re: undefined symbol i? - The__ - 04.08.2012

pawn Код:
for(new h = 0; h < sizeof(hInfo); h++) {
//stuff here
}