> For the complete documentation index, see [llms.txt](https://docs.l2s.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.l2s.dev/assets-and-guides/dispatch/integration/duty-system.md).

# Duty System

> In <mark style="color:red;">**QBCore**</mark>, the duty system is built into the framework by default. To ensure that players with specific jobs are required to be on duty before using dispatch, you can use the following functions:

{% code title="Update Duty Status to unit" %}

```lua
TriggerServerEvent("l2s-dispatch:server:SetDutyStatus", BOOL)
```

{% endcode %}

{% hint style="danger" %}
QBCore Version comes fully equipped with a default duty system.
{% endhint %}

#### **Update&#x20;**<mark style="color:red;">**`server/v_editable.lua`**</mark>**&#x20;Code for Custom Duty System:**

```lua
function ToggleDuty(src, boolean) -- To Link your duty system with dispatch script
    -- local Player = QBCore.Functions.GetPlayer(src)  -- Get the player object by their source ID
    -- Player.Functions.SetJobDuty(boolean)  -- Set the player's job duty status based on the boolean (true/false)
    TriggerClientEvent(Shared.Settings.SetDuty, src, boolean)  -- Notify the client with the updated duty status
end

function GetDuty(src) -- To get initial value for duty status
    -- local Player = QBCore.Functions.GetPlayer(src)  -- Retrieve the player object
    --return Player.PlayerData.job.onduty or true  -- Return the duty status of the player, defaults to true if not set
    return true

end

```
