invalid subscript? House system...
#1

I have this

pawn Код:
if(strcmp(option,"garage") == 0)
    {
        for(new i; i < MAX_HOUSES; i++)
        {
            new pname[24];
            GetPlayerName(playerid,pname,sizeof(pname));
            if(IsPlayerInRangeOfPoint(playerid,1.0,HouseInfo[i][hX],HouseInfo[i][hY],HouseInfo[i][hZ]))
            {
                for(new gc; gc < MAX_GARAGE_CAR; i++)
                {
                    new count = 0;
                    SendClientMessage(playerid,COLOR_RED,"");
                    SendClientMessage(playerid,COLOR_GREEN,"________________|YOUR GARAGE|________________");
                    SendClientMessage(playerid,COLOR_RED,"");
                    if(HouseInfo[i][GarageCar[gc]] > 0) // this line
                    {
                        format(string, sizeof(string), "Name: %s (ID:%i)",GetVehicleName(HouseInfo[i][GarageCar[gc]]),gc); // this line too
                        SendClientMessage(playerid,COLOR_CYAN,string);
                        count++;
                    }
                    if(count == 0)
                    SendClientMessage(playerid,COLOR_RED,"You don't have any cars in your house garage!");
                    SendClientMessage(playerid,COLOR_GREEN,"_________________________________________________");
                }
            }
        }
    }
Errors

pawn Код:
WHouse.pwn(447) : error 028: invalid subscript (not an array or too many subscripts): "GarageCar"
WHouse.pwn(447) : warning 215: expression has no effect
WHouse.pwn(447) : error 001: expected token: ";", but found "]"
WHouse.pwn(447) : error 029: invalid expression, assumed zero
WHouse.pwn(447) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
================ READY ================
problem is the HouseInfo[i][GarageCar[gc]]... Here's the variable

pawn Код:
enum E_HOUSE_INFO
{
    Name[24],
    Owner[24],
    Owned,
    Level,
    Price,
    GarageCar[MAX_GARAGE_CAR],
    Float:hX,
    Float:hY,
    Float:hZ,
    hVirtual,
    Text3D:hLabel,
}
new HouseInfo[MAX_HOUSES][E_HOUSE_INFO];
Reply


Messages In This Thread
invalid subscript? House system... - by xganyx - 18.09.2013, 11:18
Re: invalid subscript? House system... - by Konstantinos - 18.09.2013, 11:25
Re: invalid subscript? House system... - by xganyx - 18.09.2013, 11:29
Re: invalid subscript? House system... - by Konstantinos - 18.09.2013, 11:32
Re: invalid subscript? House system... - by xganyx - 18.09.2013, 11:42
Re: invalid subscript? House system... - by Konstantinos - 18.09.2013, 11:44
Re: invalid subscript? House system... - by xganyx - 18.09.2013, 11:53
Re: invalid subscript? House system... - by Konstantinos - 18.09.2013, 11:56
Re: invalid subscript? House system... - by Dragonsaurus - 18.09.2013, 12:02
Re: invalid subscript? House system... - by xganyx - 18.09.2013, 13:55

Forum Jump:


Users browsing this thread: 1 Guest(s)