> For the complete documentation index, see [llms.txt](https://docs.otherplanet.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherplanet.dev/scripts/op-garages-v3/exports-list/server-side.md).

# Server-side

Server side exports for OP GARAGES V3

### getAllGarages

***

Get List of all Available garages.

Example Usage:

```lua
exports['op-garages']:getAllGarages()
```

Example Returned Data:

```json
"35": {
    "onespawn": {
        "x": -35.35721588134765,
        "y": -1456.6011962890626,
        "z": 30.27030754089355,
        "w": 109.94937133789063
    },
    "Type": "car",
    "Index": 35,
    "AccessPoint": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    },
    "zPoints": {
        "minZ": 0,
        "maxZ": 0
    },
    "PrivatePlayersList": [],
    "Gang": {
        "name": "ballas",
        "grade": 0,
        "type": "owned"
    },
    "Job": {
        "name": "police",
        "grade": 0,
        "type": "owned"
    },
    "Radius": "20",
    "IsPrivate": false,
    "blipDisabled": false,
    "Label": "Test Garage",
    "CenterOfZone": {
        "x": -35.35721588134765,
        "y": -1456.6011962890626,
        "z": 30.27030754089355,
        "w": 109.94937133789063
    }
}
```

### getGarageByIndex

***

Get garage data by index.

Example Usage:

```lua
exports['op-garages']:getGarageByIndex("35")
```

Example Returned Data:

```json
"35": {
    "onespawn": {
        "x": -35.35721588134765,
        "y": -1456.6011962890626,
        "z": 30.27030754089355,
        "w": 109.94937133789063
    },
    "Type": "car",
    "Index": 35,
    "AccessPoint": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 0.0
    },
    "zPoints": {
        "minZ": 0,
        "maxZ": 0
    },
    "PrivatePlayersList": [],
    "Gang": {
        "name": "ballas",
        "grade": 0,
        "type": "owned"
    },
    "Job": {
        "name": "police",
        "grade": 0,
        "type": "owned"
    },
    "Radius": "20",
    "IsPrivate": false,
    "blipDisabled": false,
    "Label": "Test Garage",
    "CenterOfZone": {
        "x": -35.35721588134765,
        "y": -1456.6011962890626,
        "z": 30.27030754089355,
        "w": 109.94937133789063
    }
}
```

### getAllImpounds

***

Get List of all Available Impounds.

Example Usage:

```lua
exports['op-garages']:getAllImpounds()
```

Example Returned Data:

```json
"1": {
    "blipDisabled": 0,
    "Index": 1,
    "Type": "car",
    "Label": "LS Police",
    "Coords": {
        "x": 403.6280212402344,
        "y": -1624.9676513671876,
        "z": 28.29195404052734,
        "w": 190.83750915527345
    },
    "AllowedJobs": [
        "mechanic"
    ]
}
```

### getImpoundByIndex

***

Get Impound data by index.

Example Usage:

```lua
exports['op-garages']:getImpoundByIndex("1")
```

Example Returned Data:

```json
"1": {
    "blipDisabled": 0,
    "Index": 1,
    "Type": "car",
    "Label": "LS Police",
    "Coords": {
        "x": 403.6280212402344,
        "y": -1624.9676513671876,
        "z": 28.29195404052734,
        "w": 190.83750915527345
    },
    "AllowedJobs": [
        "mechanic"
    ]
}
```

### getVehiclesLabels

***

Get Vehicles Custom Labels added through Garage Admin.

Example Usage:

```lua
exports['op-garages']:getVehiclesLabels()
```

Example Returned Data:

```json
{
    "rebla": {
        "label": "Rebla GTS",
        "model": "rebla"
    }
}
```

### getVehicleLabelByModel

***

Get Vehicle Custom Label added through Garage Admin by Model.

Example Usage:

```lua
exports['op-garages']:getVehicleLabelByModel("rebla")
```

Example Returned Data:

```json
{
    "rebla": {
        "label": "Rebla GTS",
        "model": "rebla"
    }
}
```

### setVehicleOutside

***

Marks a vehicle as taken out of the garage in the database (`stored` / `state` = outside) and saves its network ID.

* `plate`: `string`
* `netId`: `number`
* returns: `boolean`

Example Usage:

```lua
local netId = NetworkGetNetworkIdFromEntity(vehicle)
exports['op-garages']:setVehicleOutside(plate, netId)
```

### setVehicleInside

***

Marks a vehicle as stored inside the garage in the database (`stored` / `state` = inside) and clears its network ID / impound fields.

* `plate`: `string`
* returns: `boolean`

Example Usage:

```lua
exports['op-garages']:setVehicleInside(plate)
```
