stock makes compiler crash
#1

Why this stock makes compiler crashing?
Код:
stock OnAutoOmanik(playerid)
{
	foreach(x, MAX_HOUSESPERPLAYER)
	{
	    if(APlayerData[playerid][Houses][x] != 0)
	    {
	    	foreach(i, 10)
	    	{
				new autoid = GetPlayerVehicleID(playerid);
	    	    if(AHouseData[x][VehicleIDs][i] == autoid)
	    	    {
	    	        return 1;
		    }
	    }
	}
	return 0;
}
Reply
#2

pawn Код:
stock OnAutoOmanik(playerid)
{
        foreach(x, MAX_HOUSESPERPLAYER)
    {
        if(APlayerData[playerid][Houses][x] != 0)
        {
            foreach(i, 10)
            {
                new autoid = GetPlayerVehicleID(playerid);
                if(AHouseData[x][VehicleIDs][i] == autoid)
                {
                    return 1;
            }
        }
    }
    return 0;
    }
}
try
Reply
#3

Try this boy:
pawn Код:
stock OnAutoOmanik(playerid)
{
    foreach(x, MAX_HOUSESPERPLAYER)
    {
        if(APlayerData[playerid][Houses][x] != 0)
        {
            foreach(i, 10)
            {
                new autoid = GetPlayerVehicleID(playerid);
                if(AHouseData[x][VehicleIDs][i] == autoid)
                {
                    return 1;
                }
            }
        }
    }
    return 0;
}
Reply
#4

Same result with both of them.
Reply
#5

I'm pretty sure the foreach statement is wrong. I've never actually used foreach so I may be wrong, but from what I've seen, the right syntax is foreach(identifier, index) e.g. foreach(Player, i). You have it the other way round.
Reply
#6

How could I forgot that !? thank you
Reply
#7

I know I forgot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)