SpawnVehicle - Export

Parameters Needed

ArgumentData TypeExplanation

vehicleData

Array (GetVehicleProperties)

Vehicle Data

spawnCoords

vector3

the position where the vehicle need to spawn

spawnHeading

number

the rotation of the vehicle

extraData

Array (ExtraData) -> getExtraData - Export

Set the ExtraData to the Vehicle like (EVC, Livery, or set Custom Values, Like Vehicle Keys) all extraDatas will set as stateBag

callback

function

Here you can define your callback.

Example Usage

local propData = {
    vehicleData =  {} -- vehicleProperties predefined like for Jobs
    plate = "12345678" -- Current Plate of the Vehicle
}

local extraData = {
    evc = "jugular:test", -- EVC is supportet with that you can make custom emergency vehicles
}

exports["ns_garagesystem"]:SpawnVehicle(propData, coords, heading, extraData, function(vehicle)
    -- Your Code
end)

Last updated