SA-MP Forums Archive
VehicleID - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: VehicleID (/showthread.php?tid=97768)



VehicleID - Grex - 16.09.2009

Hello, now I compiled my script with the pawno and the include files from samp 0.3
All cars are fine, till car ID ~220 (it's a train)
After the car ID 220 all cars are "moved", have anyone a soloution?, I won't to change all vehicleIDs, before I asking here.


Thanks


Re: VehicleID - Sergei - 16.09.2009

When you add train it's added with three trailers, so if train is ID 220, first trailer is 221, second 222 and third 223.

And why would oyu need to change any vehicle IDs manually? You can just save their IDs in variables and then use those variables in your script.


Re: VehicleID - Grex - 16.09.2009

hmm this is new, that each trailer from a train have a own ID or?

Hmm, can you give me a example?


Re: VehicleID - Sergei - 16.09.2009

Each trailer is separated vehicle basically, but it is automaticly spawned and attached when you spawn train.

And for examples about variables.
Make an array for those special IDs you need like:
pawn Code:
new VehID[XXX];
And when you spawn those vehicles which you need IDs for later you do like:
pawn Code:
VehID[X] = CreateVehicle(...
or
VehID[X] = AddStaticVehicle(...
or
VehID[X] = AddStaticVehicleEx(...
And later on in your script you just use VehID[X] instead of actual IDs.

Of course XXX are just symbols in this example, you need ot change them with actual values.


Re: VehicleID - Grex - 16.09.2009

This is a very nice idea, thank you. I will change this