CreateSpoofedVehicle

Spawns a vehicle entity at coordinates with spoofed creation semantics.

Syntax

Susano.CreateSpoofedVehicle(modelHash, x, y, z, heading, isNetwork, bScriptHostVeh, p7) -> vehicle

Parameters

modelHash (int): Vehicle model hash.

x, y, z (number): World position.

heading (number): Yaw in degrees.

isNetwork (boolean): Create as networked entity.

bScriptHostVeh (boolean): Try to set script host for the vehicle.

p7 (boolean): Engine-specific flag (pass false unless required).

Return(s)

vehicle (int): Entity handle. 0 on failure.

Example(s)

Citizen.CreateThread(function()
  local hash = GetHashKey("adder")
  RequestModel(hash)
  while not HasModelLoaded(hash) do 
    Citizen.Wait(0) 
  end
  
  local veh = Susano.CreateSpoofedVehicle(hash, 215.0, -920.0, 30.0, 90.0, true, true, false)
  if veh ~= 0 then
    print("Vehicle created:", veh)
  else
    print("Create failed")
  end
end)

Last updated