API REFERENCE

CreateSpoofedVehicle

Spawns a vehicle entity at coordinates with spoofed creation semantics.

Syntax

local vehicle = ONYX.CreateSpoofedVehicle(modelHash, x, y, z, heading, isNetwork, scriptHostPed, p7)

Parameters

  • modelHash (int) — Vehicle model hash.
  • x, y, z (number) — World position.
  • heading (number) — Facing angle in degrees.
  • isNetwork (boolean) — Create as a networked entity.
  • scriptHostPed (boolean) — Register the vehicle as owned by your script.
  • p7 (boolean) — Engine specific flag; pass false unless required.

Return(s)

vehicle (int) — entity handle, 0 on failure.

Behavior

  • The vehicle is created with spoofed creation semantics so the server treats it like a normal spawn.

Example(s)

local model = GetHashKey("adder")
local vehicle = ONYX.CreateSpoofedVehicle(model, 215.0, -920.0, 30.0, 90.0, true, true, false)