Client Events
These are client-side events that zephyr_police triggers on the police player’s client. Listen to them in your own resource to react to duty state changes, notifications, and other police-specific actions.
zephyr_police:dutyState
Fired when the server confirms a duty state change for the local player.
AddEventHandler('zephyr_police:dutyState', function(onDuty)
-- onDuty: boolean — true if clocking in, false if clocking out
if onDuty then
print('You are now on duty.')
else
print('You are now off duty.')
end
end)| Parameter | Type | Description |
|---|---|---|
onDuty | boolean | true = clocked in, false = clocked out |
This event also fires
zephyr_police:client:onDutyorzephyr_police:client:offDutylocally immediately after, which can be used to hook dispatch integration client-side.
zephyr_police:dutyStatusUpdate
A secondary duty confirmation event. Useful for UI elements (e.g. HUD indicators) that need to react to duty state independently of dutyState.
AddEventHandler('zephyr_police:dutyStatusUpdate', function(onDuty)
-- Update your HUD or NUI overlay here
SendNUIMessage({ type = 'setDuty', value = onDuty })
end)| Parameter | Type | Description |
|---|---|---|
onDuty | boolean | Current duty state |
zephyr_police:client:updateDutyVehicleBlips
Sent every ~2 seconds to all on-duty officers. Contains the positions and plate numbers of all police vehicles currently being driven by on-duty officers. Use this to render custom blips or a mini-map overlay.
AddEventHandler('zephyr_police:client:updateDutyVehicleBlips', function(vehicles)
-- vehicles: table array
for _, v in ipairs(vehicles) do
print(v.netId, v.plate, v.officer, v.coords.x, v.coords.y, v.coords.z)
end
end)Vehicle entry fields:
| Field | Type | Description |
|---|---|---|
netId | number | Network entity ID of the vehicle |
source | number | Server ID of the driving officer |
officer | string | Officer’s display name |
plate | string | Vehicle number plate (trimmed) |
coords | table | { x, y, z } world coords |
zephyr_police:setCuffed
Fired on the suspect’s client to apply or remove the handcuffed state. Soft-cuffs allow some movement; hard-cuffs do not.
AddEventHandler('zephyr_police:setCuffed', function(cuffed, isSoft)
-- cuffed: boolean
-- isSoft: boolean — true for soft handcuffs (some movement allowed)
if cuffed then
-- Apply cuffed animations / disable controls
end
end)| Parameter | Type | Description |
|---|---|---|
cuffed | boolean | true = handcuffed, false = released |
isSoft | boolean | true = soft cuffs (some movement allowed) |
zephyr_police:forceUncuff
Fired on the suspect’s client when an officer or external resource force-uncuffs them (e.g. from zephyr_mdt). Clears all cuff animations and re-enables controls.
AddEventHandler('zephyr_police:forceUncuff', function()
-- The local player has been force-uncuffed
-- Re-enable movement controls, clear animations, etc.
end)zephyr_police:notify
Sends a notification to the player’s client using the configured notification system.
-- From server-side (targeting a specific player):
TriggerClientEvent('zephyr_police:notify', src, {
type = 'success', -- 'success' | 'error' | 'info' | 'warning'
title = 'Suspect Cuffed',
description = 'The suspect has been restrained.',
})| Field | Type | Description |
|---|---|---|
type | string | 'success', 'error', 'info', or 'warning' |
title | string | Notification title |
description | string | (optional) Additional body text |
duration | number | (optional) Display duration in ms (default: 4000) |
zephyr_police:gsrResult
Fired on the testing officer’s client after a GSR test has been processed by the server. The physical evidence_gsr item is added to inventory server-side.
AddEventHandler('zephyr_police:gsrResult', function(targetName, positive)
if positive then
print(targetName .. ' tested POSITIVE for GSR.')
else
print(targetName .. ' tested NEGATIVE for GSR.')
end
end)| Parameter | Type | Description |
|---|---|---|
targetName | string | Display name of the tested suspect |
positive | boolean | true = positive GSR result |
zephyr_police:jailNotify
Fired on the suspect’s client when they have been sentenced to jail.
AddEventHandler('zephyr_police:jailNotify', function(months)
print('You have been sentenced to ' .. months .. ' months.')
end)| Parameter | Type | Description |
|---|---|---|
months | number | Jail sentence in months (1–99) |
zephyr_police:client:onDuty / zephyr_police:client:offDuty
Local client events (no parameters) fired immediately after dutyState resolves. Useful for lightweight hooks that don’t need the boolean payload.
AddEventHandler('zephyr_police:client:onDuty', function()
-- Officer just clocked in
end)
AddEventHandler('zephyr_police:client:offDuty', function()
-- Officer just clocked out
end)