- Creates a vehicle at a point
- 00A5: [var] = create_car [int] at [flt1] [flt2] [flt3]
- Car.Create( [var], [int], [flt1], [flt2], [flt3] )
- Variable to store the handle of the vehicle
This creates a vehicle at a point. Using this opcode requires models loaded through opcode 0247 or else the game might crash. The major script editors like Sanny Builder support using the vehicle's DFF model name and automatically converts those values into integers upon compilation. Some cars are locked by default when spawned, including Enforcer, Police, and Rhino. Those can be unlocked using opcode 020A. All vehicles created by this opcode will become near-permanent in the game until opcode 01C3 is used to release them from memory.
- See also: Spawn a vehicle
The following example, using Sanny Builder, will spawn a Pony close to the player character.
// set constants const SPAWNED_CAR = 0@ X_POS = 1@ Y_POS = 2@ Z_POS = 3@ CAR_MODEL = #PONY end // spawn pony 0247: request_model CAR_MODEL repeat wait 0 if 0248: model CAR_MODEL available then break end until false 00A0: store_actor $PLAYER_ACTOR position_to X_POS Y_POS Z_POS X_POS += 4.0 00A5: SPAWNED_CAR = create_car CAR_MODEL at X_POS Y_POS Z_POS 0249: release_model CAR_MODEL 01C3: remove_references_to_car SPAWNED_CAR
create, spawn, car, vehicle, model