# SpawnVehicle - Export

### Parameters Needed

| Argument     | Data Type                                                                                                                                                                | Explanation                                                                                                                      |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| 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](https://nextscripts.gitbook.io/nextscripts/esx-scripts/garage-system/events-and-exports/client/getextradata-export "mention") | 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

<pre class="language-lua"><code class="lang-lua">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)
<strong>    -- Your Code
</strong>end)
</code></pre>
