27.11.2013, 01:05
vehicleid = GetPlayerVehicleID(playerid);
and what if player is not in vehicle?? vehicleid == 0
next
GetVehicleModel(vehicleid) returns 0
VehicleNames[0 - 400]
0-400 = Run time error 4: "Array index out of bounds" because VehicleName[] is from 0-211
Solution:
Check if vehicleid > 0
and what if player is not in vehicle?? vehicleid == 0
next
GetVehicleModel(vehicleid) returns 0
VehicleNames[0 - 400]
0-400 = Run time error 4: "Array index out of bounds" because VehicleName[] is from 0-211
pawn Code:
format(Vehiclename, sizeof(Vehiclename), "%s", VehicleNames[GetVehicleModel(vehicleid) - 400]);
Check if vehicleid > 0