Help About Virtual World.
#8

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.

pawn Код:
new vehicles[MAX_VEHICLES+1];

vehicles[vin];
Or you can access the array with "VIN - 1" and have access to vin 2000.

pawn Код:
new vehicles[MAX_VEHICLES];

vehicles[vin -1];
Which ever is easier.
Reply


Messages In This Thread
Help About Virtual World. - by MAFIAWARS - 27.09.2013, 14:23
Re: Help About Virtual World. - by MAFIAWARS - 27.09.2013, 15:33
Re: Help About Virtual World. - by Unri - 27.09.2013, 15:44
Re: Help About Virtual World. - by MAFIAWARS - 27.09.2013, 15:56
Re: Help About Virtual World. - by Konstantinos - 27.09.2013, 15:58
Re: Help About Virtual World. - by Grimrandomer - 27.09.2013, 16:00
Re: Help About Virtual World. - by Konstantinos - 27.09.2013, 16:07
Re: Help About Virtual World. - by Grimrandomer - 27.09.2013, 16:51
Re: Help About Virtual World. - by Konstantinos - 27.09.2013, 17:01
Re: Help About Virtual World. - by Grimrandomer - 27.09.2013, 17:10

Forum Jump:


Users browsing this thread: 4 Guest(s)