27.09.2013, 16:51
WRONG, there are 2000 vehicles.
SA-MP allows 2000 vehicles, starting at vehicle id 1, up to and including vehicle id 2000, so accessing an array of size MAX_VEHICLES with vehicle id 2000 will crash, so you need an array of size 2001 (MAX_VEHICLES+1) if you want to access an array with its vin.
Or you can access the array with "VIN - 1" and have access to vin 2000.
Which ever is easier.
SA-MP allows 2000 vehicles, starting at vehicle id 1, up to and including vehicle id 2000, so accessing an array of size MAX_VEHICLES with vehicle id 2000 will crash, so you need an array of size 2001 (MAX_VEHICLES+1) if you want to access an array with its vin.
pawn Код:
new vehicles[MAX_VEHICLES+1];
vehicles[vin];
pawn Код:
new vehicles[MAX_VEHICLES];
vehicles[vin -1];