- Spawns a character in the driver seat of the vehicle
- 0129: [var] = create_actor_pedtype [int1] model [int2] in_car [car handle] driverseat
- Native analog
This opcode spawns a character in the driver seat of a vehicle. Using this opcode requires an existing vehicle and opcode 0247 to load the character model or else the game could crash.
- See also: Spawn a ped
The following example, using Sanny Builder, will spawn a ped in a car close to the player character.
const CHAR_MODEL = #BFORI // set your character model CAR_MODEL = #PONY // set your vehicle model CHAR_HANDLE = [email protected] CAR_HANDLE = [email protected] X_POS = [email protected] Y_POS = [email protected] Z_POS = [email protected] end 0247: request_model CHAR_MODEL 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: CAR_HANDLE = create_car CAR_MODEL at X_POS Y_POS Z_POS 0129: CHAR_HANDLE = create_actor_pedtype 4 model CHAR_MODEL in_car CAR_HANDLE driverseat 0249: release_model CHAR_MODEL 0249: release_model CAR_MODEL 01C2: mark_actor_as_no_longer_needed CHAR_HANDLE 01C3: mark_car_as_no_longer_needed CAR_HANDLE
create, spawn, actor, ped, pedestrian, character, pedtype, model, inside, vehicle, car, driver