# Get all vehicles of player

To get all vehicles owned by a player ID in all buyable garages

## Export

```lua
exports["jobs_creator"]:getAllVehiclesOfPlayer(playerId)
```

### Parameters

| Name       | Data Type | Description        |
| ---------- | --------- | ------------------ |
| `playerId` | integer   | Player's server ID |

### Return value

| Name       | Data Type | Description                                                                                                         |
| ---------- | --------- | ------------------------------------------------------------------------------------------------------------------- |
| `vehicles` | table     | Table with all vehicles owned by the player in the buyable garages, key is vehicle ID and value is the vehicle data |

## Example

```lua
local playerId = 4
local vehicles = exports["jobs_creator"]:getAllVehiclesOfPlayer(playerId)

print("Player vehicles:")
print(ESX.DumpTable(vehicles))
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.jaksam-scripts.com/jobs-creator/server/buyable-vehicles/get-all-vehicles-of-player.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
