# Customization

* There's some functions and events that you might need to customize the script and adapt it to your own server: dispatch, key system, notifications style, etc.

### Dispatch Event

* This event is triggered when the job vehicle enters a mission zone, the event receives the vehicle entity so you can use it with your own dispatch system:

{% code title="client/framework/cops.lua" %}

```lua
RegisterNetEvent("av_runs:sendDispatch", function(vehicle)
    -- Your dispatch event/export goes here:
    -- This example is only for ps-dispatch (make sure to read the docs first)
    if Config.Debug then
        print("Dispatch triggered")
    end
    if GetResourceState("ps-dispatch") ~= "missing" then
        exports['ps-dispatch']:VehicleShooting(vehicle)
    end
end)
```

{% endcode %}

### Hacking Minigame

* This minigame is activated when the driver uses the hacking device while inside the job vehicle. Ensure that it returns true or false, and most importantly, make sure your minigame export is async (otherwise, implement your own await mechanism)

{% code title="client/framework/minigame.lua" %}

```lua
function hackingMinigame()
    local result = true
    if GetResourceState('bl_ui') == "started" then
        result = exports.bl_ui:PrintLock(3, {
            grid = 4,
            duration = 20000,
            target = 4
        })
    end
    return result
end
```

{% endcode %}

### Vehicle Keys

* Once the vehicle is hacked and the driver has full control of it, this function is triggered so you can add your own vehicle keys export/event and give the vehicle keys to the player:

{% code title="client/framework/functions.lua" %}

```lua
function GiveKeys(vehicle) -- Just in case u need the vehicle object
    local plates = GetVehicleNumberPlateText(vehicle)
    -- Give vehicle keys export/event:
end
```

{% endcode %}

### Set Fuel

* The job vehicle is spawned with some random fuel set by the server, use your own export to add more:

<pre class="language-lua" data-title="client/framework/functions.lua"><code class="lang-lua"><strong>function SetFuel(vehicle)
</strong>    -- Add your own fuel export/event here:
    
end
</code></pre>

### Notifications

* The script uses the ox\_lib notifications:

<pre class="language-lua" data-title="client/framework/notifications.lua"><code class="lang-lua"><strong>RegisterNetEvent("av_runs:notification", function(title, description, type)
</strong>    lib.notify({
        title = title,
        description = description,
        type = type
    })
end)
</code></pre>


---

# 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://docs.av-scripts.com/guides/illegal-runs/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.
