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

# Customization

Connect ALT0 Boosting to your notification, dispatch, key and inventory scripts, or to another framework.

Everything Boosting does with other scripts goes through open files you can edit:

| File                            | Side   | Functions                                                                                                                               |
| ------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| `configs/cl_functions.lua`      | Client | `Notify`, `Dispatch`, `DispatchWifiBreach`, `DispatchHackFailed`, `GiveKeys`, `HasItem`, `CanAccessTablet`                              |
| `configs/sv_functions.lua`      | Server | `Notify`, `AddItem`, `RemoveItem`, `HasItem`, `CanCarryItem`, `SendWebhook`, `IsPoliceOnDuty`, `GetOnlinePolice`, `IsAdmin`, `GiveKeys` |
| `bridge/framework/<framework>/` | Both   | Players, jobs, money, garages, keys and items for each framework                                                                        |

## Notifications

The quickest way is the config (`Notification.System = 'alt0'` or `'lib'`). For any other script, edit `Functions.Notify` in `configs/cl_functions.lua`:

```lua
function Functions.Notify(description, type, title, duration)
    exports['okokNotify']:Alert(title or 'Boosting', description, duration or 5000, type or 'info')
end
```

And on the server side, in `configs/sv_functions.lua`:

```lua
function Functions.Notify(source, description, type, title, duration)
    TriggerClientEvent('okokNotify:Alert', source, title or 'Boosting', description, duration or 5000, type or 'info')
end
```

## Dispatch

Pick a supported system with `Dispatch.System` in `configs/shared.lua`: `'alt0-mdt'`, `'alt0-dispatch'`, `'ps-dispatch'`, `'cd_dispatch'`, `'qs-dispatch'` or `'none'`.

For any other script there are two ways:

1. Set `System = 'custom'` and give `Dispatch.CustomFunction` in `configs/shared.lua` a function. It receives the coords, the car model, the plate and the class:

   ```lua
   CustomFunction = function(coords, model, plate, rank)
       TriggerServerEvent('your-dispatch:vehicleTheft', { coords = coords, vehicle = model, plate = plate })
   end,
   ```
2. Or edit the dispatch functions in `configs/cl_functions.lua` directly:

   ```lua
   function Functions.Dispatch(vehicle, coords, streetName, vehicleModel, plate, vehicleRank)
       TriggerServerEvent('your-dispatch:vehicleTheft', {
           coords = coords, street = streetName, vehicle = vehicleModel, plate = plate,
       })
   end
   ```

There are three alerts: `Functions.Dispatch` when a car is stolen, `Functions.DispatchHackFailed` when a car hack fails, and `Functions.DispatchWifiBreach(coords, streetName, ssid)` when a player fails to break into a secured network.

## Vehicle keys

`Functions.GiveKeys` already supports qbx\_vehiclekeys, qb-vehiclekeys, vehicles\_keys, wasabi\_carlock and mrn\_vehcontrol. For another key script, add it to `Functions.GiveKeys(vehicle)` in `configs/cl_functions.lua` and `Functions.GiveKeys(source, vehicle, plate)` in `configs/sv_functions.lua`:

```lua
function Functions.GiveKeys(source, vehicle, plate)
    exports['your-keys']:GiveKey(source, plate)
end
```

## Inventory

`configs/sv_functions.lua` checks for ox\_inventory, then qs-inventory, then qb-inventory, then falls back to your framework's own inventory through the bridge. For another inventory, add it to `Functions.HasItem`, `AddItem`, `RemoveItem` and `CanCarryItem`. There is a commented `your-inventory` example in each.

On the client, `Functions.HasItem(itemName)` decides whether to show the hack prompts. The server always checks again.

## Police count

Contracts need a number of police on duty (`cops` per class). `Functions.IsPoliceOnDuty(source)` decides who counts: by default an on-duty job from `PoliceJobs` in `configs/server.lua`, or a Qbox / QBCore job of type `leo`. Change it if your police use a different duty system.

## Admins

`Functions.IsAdmin(source)` decides who gets the Admin tab and the test command. By default: ACE permissions (for example `alt0-boosting.admin` or `admin`) and your framework's admin permission.

## Webhooks

`Functions.SendWebhook(webhookType, title, message, color, fields)` posts to the Discord webhooks in `configs/server.lua` → `Webhooks`. Change it to send logs somewhere else.

## Tablet access

`Functions.CanAccessTablet()` in `configs/cl_functions.lua` decides whether a player may open the tablet, for example to block a job.

## Frameworks

`Framework = 'auto'` picks the right folder in `bridge/framework/`. For any other framework, set `Framework = 'custom'` and fill in `bridge/framework/custom/server.lua` and `client.lua`. Each function has a comment saying what it must return:

| Server                                                                                                                                                                                                         | Client                                |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| `GetPlayer`, `GetIdentifier`, `GetCharacterName`, `GetJob`, `HasMoney`, `RemoveMoney`, `AddMoney`, `Notify`, `GetCopCount`, `GetLicense`, `AddVehicleToGarage`, `GiveKeys`, `HasItem`, `AddItem`, `RemoveItem` | `GetPlayerData`, `Notify`, `GiveKeys` |

On start, the server console says which bridge functions are missing.
