> For the complete documentation index, see [llms.txt](https://zloma-scripts.gitbook.io/zloma-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zloma-scripts.gitbook.io/zloma-scripts/zloma_garages-paid/customization.md).

# Customization

zloma\_garages provides two open (non-escrowed) files for server-specific customization.

***

## Client Customization — `cl_customization.lua`

### AfterVehicleSpawn

Called after a vehicle is spawned and properties are applied. Use this to apply custom handling, stance, or visual modifications.

```lua
function AfterVehicleSpawn(vehicle, props)
    -- Default: applies zloma_stance if Config.UseZlomaStance is true
    if Config.UseZlomaStance then
        TriggerEvent('zloma_stance:applyStance', vehicle)
    end
    
    -- Example: apply custom handling
    -- exports['myhandling']:ApplyHandling(vehicle)
end
```

### BeforeVehicleSave

Called before vehicle properties are saved. Return modified props to add custom data.

```lua
function BeforeVehicleSave(vehicle, props)
    -- Example: save stance data
    -- props.stanceData = exports['zloma_stance']:GetStanceData(vehicle)
    return props
end
```

### RepairVehicle

Full vehicle repair implementation. Replace with your custom repair script if needed.

```lua
function RepairVehicle(vehicle)
    -- Default: full visual repair
    SetVehicleFixed(vehicle)
    SetVehicleEngineHealth(vehicle, 1000.0)
    SetVehicleBodyHealth(vehicle, 1000.0)
    -- + fixes tyres, windows, doors
end
```

### IsVehicleDamaged

Determines whether the "Repair" option appears in the garage menu.

```lua
function IsVehicleDamaged(vehicle)
    -- Default: body or engine health below 950
    return GetVehicleBodyHealth(vehicle) < 950.0 
        or GetVehicleEngineHealth(vehicle) < 950.0
end
```

***

## Server Customization — `sv_customization.lua`

### Discord Webhooks

Set your Discord webhook URLs at the top of the file:

```lua
local WebhookURL = ''         -- General webhook (transfers, etc.)
local PoliceWebhookURL = ''   -- Police impound webhook
```

### OnVehicleSpawned / OnVehicleStored

Server-side hooks for spawn and store events:

```lua
function OnVehicleSpawned(source, plate, vehicleProps)
    -- Called when a vehicle is taken out of garage
end

function OnVehicleStored(source, plate, vehicleProps)
    -- Called when a vehicle is stored
    -- Return modified props to add custom data
    return vehicleProps
end
```

### CanAccessGarage / CanAccessImpound

Custom access control. Runs **after** the built-in access checks.

```lua
function CanAccessGarage(source, garageData)
    -- Return true to allow, false to deny
    -- Example: VIP-only garage
    return true
end

function CanAccessImpound(source, impoundData, vehiclePlate)
    return true
end
```

### CalculateImpoundFee

Override the default impound fee calculation. Receives base price and context.

```lua
function CalculateImpoundFee(basePrice, vehicleClass, hoursImpounded, plate)
    -- Example: charge more for sports cars
    if vehicleClass == 7 then  -- Super class
        return basePrice * 2
    end
    return basePrice
end
```

### GetSecondaryJob

Multi-job support. Return a secondary job name for frameworks that support it.

```lua
function GetSecondaryJob(source)
    -- Example for ESX with job2
    -- local xPlayer = ESX.GetPlayerFromId(source)
    -- return xPlayer.job2 and xPlayer.job2.name or nil
    return nil
end
```

### Custom Fake Plates Sync

When `Config.FakePlates.inventorySync.custom = true`:

```lua
function SyncVehicleInventory(oldPlate, newPlate, action)
    -- action: 'apply' (real -> fake) or 'remove' (fake -> real)
    -- Rename your inventory stashes here
end
```

When `Config.FakePlates.fuelSync.custom = true`:

```lua
function GetVehicleFuelType(plate)
    -- Return fuel type string for this plate
    return nil
end

function SetVehicleFuelType(plate, fuelType)
    -- Set fuel type for this plate
end
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://zloma-scripts.gitbook.io/zloma-scripts/zloma_garages-paid/customization.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.
