- Creates a vehicle at the coordinates point
- 00A5: [var] = create_car [int] at [flt1] [flt2] [flt3]
- Car.Create( [var], [int], [flt1], [flt2], [flt3] )
- Native analog
This opcode creates a vehicle at the coordinates point. Using this opcode requires the model to be already loaded, usually 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. The Enforcer, Police, and Rhino are locked initially (lock state 5) when spawned; they can be unlocked using opcode 020A or if any driver exits the vehicle. All vehicles created by this opcode outside a mission will become near-permanent in the game until opcode 01C3 is used to mark it as no longer needed.
- See also: Spawn a vehicle
The following example, using Sanny Builder, will spawn a Pony close to the player character.
const SPAWNED_CAR = [email protected] X_POS = [email protected] Y_POS = [email protected] Z_POS = [email protected] CAR_MODEL = #PONY // set your vehicle model end 0247: request_model CAR_MODEL 038B: load_requested_models 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