19.12.2011, 06:15
i have an error and i tried all i know to try fix it but no result :\ pls help me
error 033: array must be indexed (variable "VehiclesPrice") at the line
this is an exemple of the VehiclesPrice
thx
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.");
}
pawn Код:
if(GetPlayerMoney(playerid) >= VehiclesPrice[model_array[listitem]-400])
pawn Код:
new VehiclesPrice[][] = {
{200000},{90000},{230000},{200000},{0},{125000},{700000},
{3500000},{400000},{400000},{90000},{500000},{130000},{110000},{0}
};