View Full Version : Problem with Getting player vehicles and spawn them

09/07/2016, 11:47 AM
Hello.I'm Very new to this forum and to Pawn.i Was trying to Get the Player's vehicles(the vehicles which a player owns) and then spawn them.but i get lots of error like Array must be index and other that i have attached in the end of the post.i really have no idea why i get these errors and i tried searching ****** and the forum,but i couldnt get a result

new vehicles[50][32];
new ind;
for(new i;i<MAX_VEHICLES;i++)
if(VehicleInfo[i][cOwner]== PlayerInfo[playerid][pName])
return vehicles;
new fields = GetPlayerVehicles(playerid);
new length[10] = sizeof(fields);
new id;
for (new i;i<length;i++)
id = strval(fields[i]);


array must be indexed (variable "vehicles")
array must be indexed (variable "-unknown-")// on new fields = GetPlayerVehicles(playerid);
array must be indexed (variable "length")
invalid subscript (not an array or too many subscripts): "fields"//On id = strval(fields[i]);
warning 215: expression has no effectid = strval(fields[i]);//On id = strval(fields[i]);
error 001: expected token: ";", but found "]"//On id = strval(fields[i]);
error 029: invalid expression, assumed zero//On id = strval(fields[i]);
fatal error 107: too many error messages on one line//On id = strval(fields[i]);
7 Errors.

I Hope Someone can help me to make these functions correct and fix the errors