Vehicles in GTA 2 Mission Scripts
Cars are very easy to create and I’m sure you’ll have alot of them in your maps! Below is how you can place a parked car in your map. If you leave out the
Z coordinate, the car is placed on the highest solid surface.
PARKED_CAR_DATA name = (X,Y,Z) remap rotation MODEL
PARKED_CAR_DATA name = (X,Y,Z) remap rotation MODEL TRAILERMODEL
The second is only for use with trucks and trailers (since when did you see a Z-Type driving around with a tanker?).
So, you could have one similar to the one below.
PARKED_CAR_DATA fastcar (34.5,45.5,2.0) 28 0 STRATOS
PARKED_CAR_DATA truck (35.5,47.5,2.0) 19 270 TRUKCAB2 TANKER
The second declares that when the game loads, the trailer is automatically attached.
To create a half-size car, set the
TRAILERMODEL to be
MINI_CAR. Best used for remote control missions!
PARKED_CAR_DATA fastcar (34.5,45.5,2.0) 28 0 STRATOS MINI_CAR
Vehicle Remap Colours
Taken straight from the official documentation. Default colour is usually a medium brown.
Below is a table detailing every car in GTA 2 with their script name as well as their in-game name.
|Armed Land Roamer 6|
|Cop Car 6|
|G4 Bank Van|
|Hot Dog Van|
|Hot Dog Van Dummy 1 3|
|Karma Bus 4|
|Land Roamer 6|
|Meteor Turbo 4|
|Special Agent Car 6|
|SWAT Van 6|
|Taxi Xpress 7|
|Truck Cab SX|
|Truck Trailer, Container 2|
|Truck Trailer, Flatbed 2|
|Truck Trailer, Tanker 2|
Goes on a bit doesn’t it? If you are wondering what the numbers are for, here they are:
- Game Crashes.
- Guess what, you can’t enter a Truck Cab Container!
- Useless, don’t even bother putting them in unless it is for a special mission.
- Default gang car.
- Primarily used for the Wang Car bonuses.
- Emergency vehicles.
- Public transport.
If you try to use the
WRECK vehicles and actually destroy them via weapons, the game will crash. In this way, you should make them all weapon proof (machine gun, rocket launcher and flame-thrower) for added security. Unfortunately, it is still affected by the Electro Gun. Furthermore, they cannot be driven by the player or the AI so you cannot spawn characters inside them. You have been warned!
Preventing A Model Type From Spawning
If you don’t want a certain vehicle to drive around on the map, use the code below:
Only one car can ever be suppressed, and if you try another, it will update with the new one. If you want to stop this later on, such as after a mission, set the
Vehicle Door Locks
To make your game cars locked, you need to add the following commands:
CHANGE_CAR_LOCK (name, LOCK_TYPE)
name to any previously created car, and the
LOCK_TYPE to one of the following:
|Car has no lock whatsoever.|
|Locks out everyone, including players.|
|Car is unlocked.|
|Car is always locked for everyone.|
|Only locks out car thieves, this is the default for created cars.|
|Only locks out players.|
If you want to give a car an alarm, just add the following code:
name to a previously made car. The alarm will go off if you steal the car or shoot it.
(Originally written by Chris “Pyro” Hockley and formatted by Ben “Cerbera” Millard with full permission.)