# Functions

## Client

### OpenGarage

* **exports.mGarage:OpenGarage()**

```lua
exports.mGarage:OpenGarage({
    name = 'GARAGE ID/NAME',
    garagetype = 'garage',              
    intocar = true,                     
    carType = { 'automobile', 'bike' }, 
    spawnpos = {  vec4(0, 0, 0, 0) }
})
```

### **SaveCar**

* **exports.mGarage:SaveCar()**

```lua
exports.mGarage:SaveCar({
    name = 'GARAGE ID/NAME',
    garagetype = 'garage',              
    entity = vehicleEntity or false to getVehiclePedIsIn,            
    carType = { 'automobile', 'bike' }, 
})
```

### impound Vehicle

* **exports.mGarage:ImpoundVehicle()**

<pre class="language-lua"><code class="lang-lua"><strong>exports.mGarage:ImpoundVehicle({ 
</strong>    vehicle = Vehicle entity, 
    impoundName = 'Impound Name' 
})
</code></pre>

## Examples

```lua
RegisterCommand('mGarage:opengarage', function(source, args, raw)
    local ped = PlayerPedId()
    local coords, heading = GetEntityCoords(ped), GetEntityHeading(ped)
    exports.mGarage:OpenGarage({
        name = 'Pillbox Hill',
        garagetype = 'garage',              
        intocar = true,                     
        carType = { 'automobile', 'bike' }, 
        spawnpos = {
            vec4(coords.x, coords.y, coords.z, heading),
        }
    })
end)

RegisterCommand('mGarage:savecar', function(source, args, raw)
    local ped = PlayerPedId()
    local vehicleEntity = GetVehiclePedIsIn(ped, false)
    if DoesEntityExist(vehicleEntity) then
        exports.mGarage:SaveCar({
            name = 'Pillbox Hill',
            garagetype = 'garage',             
            entity = vehicleEntity,             
            carType = { 'automobile', 'bike' }, 
        })
    else
        print('No Vehicle')
    end
end)

RegisterCommand('mGarage:impound', function(source, args, raw)
    local ped = PlayerPedId()
    local vehicleEntity = GetVehiclePedIsIn(ped, false)
    if DoesEntityExist(vehicleEntity) then
     ImpoundVehicle({
        vehicle = vehicleEntity,
        impoundName = 'Impound'
    })
    else
        print('No Vehicle')
    end
end)
```
