> For the complete documentation index, see [llms.txt](https://docs.tmc.bj/v2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tmc.bj/v2/tmc-core-object/client-functions/vehicle-functions.md).

# Vehicle Functions

### SpawnVehicle

Spawns vehicle at specified location

<table><thead><tr><th width="154">Parameter</th><th width="104" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>model</td><td>true</td><td>hash or string</td><td>Model or hash of the vehicle</td></tr><tr><td>coords</td><td>false</td><td>vector4</td><td>Coords to spawn vehicle at, defaults to ped current location</td></tr><tr><td>isNetworked</td><td>false</td><td>Boolean</td><td>Should the vehicle be networked</td></tr></tbody></table>

```lua
TMC.Functions.SpawnVehicle(model, coords, isNetworked)
```

### GetVehiclesInArea

Returns an array of vehicle entity handles in the radius of the specified coords

<table><thead><tr><th width="139">Parameter</th><th width="104" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>coords</td><td>false</td><td>vector3</td><td>The coords to check at</td></tr><tr><td>area</td><td>false</td><td>Number</td><td>The radius size to check for at the specified coords</td></tr></tbody></table>

```lua
local vehicles = TMC.Functions.GetVehiclesInArea()
```

### IsSpawnPointClear

Returns a bool indicating if there are any vehicles a the specified coords and radius

<table><thead><tr><th width="154">Parameter</th><th width="104" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>coords</td><td>false</td><td>vector3</td><td>The coords to check at</td></tr><tr><td>maxDistance</td><td>false</td><td>Number</td><td>The radius size to check for at the specified coords</td></tr></tbody></table>

```lua
if TMC.Functions.IsSpawnPointClear() then
    --
else
    --
end
```

### GetClosestVehicle

Returns the closest vehicle entity handle

<table><thead><tr><th width="154">Parameter</th><th width="101" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>coords</td><td>false</td><td>vector3</td><td>The coords at which to find the closest ped. If not passed through it'll use your ped's coords</td></tr></tbody></table>

```lua
local closestVehicle = TMC.Functions.GetClosestVehicle()
```

### GetClosestVehicle

Returns the closest vehicle entity handle

<table><thead><tr><th width="154">Parameter</th><th width="103" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>coords</td><td>false</td><td>vector3</td><td>The coords at which to find the closest ped. If not passed through it'll use your ped's coords</td></tr></tbody></table>

```lua
local closestVehicle = TMC.Functions.GetClosestVehicle()
```

### GetVehicles

Returns an array containing entity handles for each entity in the ped game pool&#x20;

<pre class="language-lua"><code class="lang-lua"><strong>-- GetGamePool("CVehicle")
</strong><strong>local vehicles = TMC.Functions.GetVehicles()
</strong>for k,v in ipairs(vehicles) do
    -- v = entity
end
</code></pre>
