SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 16/09/2009, 04:30 PM   #1
Grex
Big Clucker
 
Join Date: Mar 2008
Posts: 65
Reputation: 1
Default VehicleID

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
Grex is offline  
Old 16/09/2009, 04:37 PM   #2
Sergei
High-roller
 
Sergei's Avatar
 
Join Date: Mar 2008
Location: Slovenia
Posts: 2,862
Reputation: 230
Default Re: VehicleID

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.
__________________
Watch out, scouts everywhere!
Sergei is offline  
Old 16/09/2009, 05:09 PM   #3
Grex
Big Clucker
 
Join Date: Mar 2008
Posts: 65
Reputation: 1
Default Re: VehicleID

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

Hmm, can you give me a example?
Grex is offline  
Old 16/09/2009, 05:20 PM   #4
Sergei
High-roller
 
Sergei's Avatar
 
Join Date: Mar 2008
Location: Slovenia
Posts: 2,862
Reputation: 230
Default Re: VehicleID

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.
__________________
Watch out, scouts everywhere!
Sergei is offline  
Old 16/09/2009, 06:06 PM   #5
Grex
Big Clucker
 
Join Date: Mar 2008
Posts: 65
Reputation: 1
Default Re: VehicleID

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GetVehicleSpeed(vehicleid)?? VirSpectorX Help Archive 3 14/04/2010 08:29 AM
Vehicleid? Darekfred Help Archive 2 04/01/2010 01:00 AM
VehicleId AddStaticVehicle NPC nico005 Help Archive 1 05/10/2009 02:26 PM
[solved] vehicleid Marc_307 Help Archive 3 06/07/2009 02:33 PM


All times are GMT. The time now is 10:40 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.