Problem on assignment
#1

Hi there,

I was making a custom vehicle system, but on compiling I get this error and I don't undestand why
Код:
error 032: array index out of bounds (variable "Car")
Here's my code:
pawn Код:
enum vInfo
{
    cOwner[30],
    cModel,
    cPrice,
    cCol1 = 0,
    cCol2 = 0
};
new Car[MAX_VEHICLES][vInfo];
pawn Код:
forward CreaVeh(playerid, model, price);
public CreaVeh(playerid, model, price)
{
    if(GetPlayerMoney(playerid) >= price)
    {
        new Float:X, Float:Y, Float:Z;GetPlayerPos(playerid, X, Y, Z);
        autom[playerid] = CreateVehicle(model, X, Y+2.0, Z, 0.0, 0, 0, 60);
        PutPlayerInVehicle(playerid, autom[playerid], 0);
        new id = autom[playerid];
        format(Car[id][cOwner], 30, PlayerName(playerid));
        new msg[256];
        format(msg, sizeof(msg), "DEBUG: Owner: %s", Car[id][cOwner]);
        SCM(playerid, -1, msg);
        Car[id][cPrice] = price; //error
        Car[id][cModel] = model; //error
        Car[id][cCol1] = 0;
        Car[id][cCol2] = 0;
        TogglePlayerControllable(playerid, 0);
        inColor[playerid] = 1;
    }
    return 1;
}
The problem comes when I assign to the varible Car[id][cPrice] a value
Someone can help?
Reply


Messages In This Thread
Problem on assignment - by Sk1lleD - 22.12.2013, 15:52
Re: Problem on assignment - by Konstantinos - 22.12.2013, 15:57
Re: Problem on assignment - by Sk1lleD - 22.12.2013, 16:01
Re: Problem on assignment - by Sk1lleD - 24.12.2013, 10:38
Re: Problem on assignment - by Konstantinos - 24.12.2013, 10:57
Re: Problem on assignment - by Sk1lleD - 24.12.2013, 11:12

Forum Jump:


Users browsing this thread: 2 Guest(s)