array must be indexed problem
#1

i have an error and i tried all i know to try fix it but no result :\ pls help me

pawn Код:
new model_array[] = {456, 455, 578, 403, 514, 515, 525, 437, 431, 524, 408, 443, 433};
            if(GetPlayerMoney(playerid) >= VehiclesPrice[model_array[listitem]-400])
            {
                new Name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, Name,sizeof(Name));
                new str[128];
                format(str,128,"%s bought a %s",Name,VehiclesName[model_array[listitem]-400]);
                CreateVehicle(model_array[listitem], 60.4640,-257.1053,1.5781, 0.0, 1, 1, -1);
            }
            else
            {
                SendClientMessage(playerid, 0xFF0000FF,"You cannot afford this vehicle.");
            }
error 033: array must be indexed (variable "VehiclesPrice") at the line
pawn Код:
if(GetPlayerMoney(playerid) >= VehiclesPrice[model_array[listitem]-400])
this is an exemple of the VehiclesPrice

pawn Код:
new VehiclesPrice[][] = {
{200000},{90000},{230000},{200000},{0},{125000},{700000},
{3500000},{400000},{400000},{90000},{500000},{130000},{110000},{0}
};
thx
Reply


Messages In This Thread
array must be indexed problem - by timaoux - 19.12.2011, 06:15
Re: array must be indexed problem - by Calgon - 19.12.2011, 06:18
Re : array must be indexed problem - by timaoux - 19.12.2011, 06:44
Re : array must be indexed problem - by timaoux - 19.12.2011, 06:47

Forum Jump:


Users browsing this thread: 1 Guest(s)