# Client-Side

{% tabs %}
{% tab title="Default" %}
{% code expandable="true" %}

```lua
if Config.Dispatch then
    return
end

function DispatchAlertClient(property, type)
    -- Nothing
end

RegisterNetEvent('vms_housing:cl:dispatchAlert', function(propertyId, coords, alarmType)
    local hasJob = false
    
    local property = Properties[propertyId]

    if Config.Alarm.AlarmJobs then
        local myJob = CL.GetPlayerJob('name')

        if type(Config.Alarm.AlarmJobs) == 'table' then
            for _, jobName in ipairs(Config.Alarm.AlarmJobs) do
                if myJob == jobName then
                    hasJob = true
                    break
                end
            end
        else
            if myJob == Config.Alarm.AlarmJobs then
                hasJob = true
            end
        end
    end

    if hasJob then
        CL.Notification(TRANSLATE('notify.lockpick:alarm_' .. alarmType), 12000, 'dispatch')

        local blipId = #AlarmBlips + 1

        AlarmBlips[blipId] = {
            alpha = 220,
            blip = AddBlipForCoord(coords),
            radius = AddBlipForRadius(coords, 25.0),
        }

        SetBlipSprite(AlarmBlips[blipId].blip, 480)
        SetBlipDisplay(AlarmBlips[blipId].blip, 4)
        SetBlipScale(AlarmBlips[blipId].blip, 1.0)
        SetBlipColour(AlarmBlips[blipId].blip, 1)
        SetBlipAsShortRange(AlarmBlips[blipId].blip, false)

        BeginTextCommandSetBlipName("STRING")
        AddTextComponentString(TRANSLATE('blip.alarm'))
        EndTextCommandSetBlipName(AlarmBlips[blipId].blip)

        SetBlipHighDetail(AlarmBlips[blipId].radius, true)
        SetBlipColour(AlarmBlips[blipId].radius, 1)
        SetBlipAlpha(AlarmBlips[blipId].radius, 90)
        SetBlipAsShortRange(AlarmBlips[blipId].radius, true)

        Citizen.CreateThread(function()
            Citizen.Wait(30000)
            while AlarmBlips[blipId].alpha ~= 0 do
                AlarmBlips[blipId].alpha = AlarmBlips[blipId].alpha - 1
                SetBlipAlpha(AlarmBlips[blipId].radius, AlarmBlips[blipId].alpha)

                if AlarmBlips[blipId].alpha <= 0 then
                    RemoveBlip(AlarmBlips[blipId].radius)
                    RemoveBlip(AlarmBlips[blipId].blip)
                    AlarmBlips[blipId] = nil
                    break
                end

                Citizen.Wait(200)
            end
        end)
    end
end)
```

{% endcode %}
{% endtab %}

{% tab title="qs-dispatch" %}
{% code expandable="true" %}

```lua
if Config.Dispatch ~= 'qs-dispatch' then
    return
end

function DispatchAlertClient(property, type)
    local coords = nil
    if property.type == 'mlo' then
        coords = vector3(property.metadata.menu.x, property.metadata.menu.y, property.metadata.menu.z)
    else
        coords = vector3(property.metadata.enter.x, property.metadata.enter.y, property.metadata.enter.z)
    end

    if not coords then
        return
    end

    TriggerServerEvent('qs-dispatch:server:CreateDispatchCall', {
        job = Config.Alarm.AlarmJobs,
        callLocation = coords,
        callCode = {code = '459', snippet = 'Burglary'},
        message = TRANSLATE('notify.lockpick:alarm_' .. type),
        flashes = false,
        blip = {
            sprite = 480,
            scale = 1.0,
            colour = 1,
            flashes = true,
            text = 'Burglary',
            time = (20 * 1000),
        },
    })
end
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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.vames-store.com/assets/vms_housing/configuration-files/integration-files/dispatch/client-side.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.
