Home › Documentation › Exports · origen_police
All exports are registered under the resource name origen_police. The sections below split them by execution side — use the correct side or the call will be silently ignored.
Send an alert to the police dispatch.
All data is optional except coords, title, and type.
-- coords: vector3(x, y, z) — location where the alert is triggered
-- title: Title of the alert
-- type: GENERAL | RADARS | 215 | DRUGS | FORCE | 48X — used to filter alerts in the dashboard
-- message: Alert message body
-- job: Job group for the alert
-- metadata: Additional context (vehicle, plate, speed, weapon, subject name, unit)
exports['origen_police']:SendAlert({
coords = vector3(0, 0, 0),
title = 'Alert title',
type = 'GENERAL',
message = 'Alert message',
job = 'police',
metadata = {
model = 'Vehicle label',
color = {255, 255, 255},
plate = 'PLATE',
speed = '100 kmh',
weapon = 'Weapon name',
ammotype = 'AMMO_PISTOL',
name = 'Subject name',
unit = 'ADAM-10',
}
})Example:
RegisterCommand('testalert', function(source, args, rawCommand)
local src = source
local coords = GetEntityCoords(GetPlayerPed(src))
exports['origen_police']:SendAlert({
coords = coords,
title = 'Test alert title',
type = 'GENERAL',
message = 'Test alert message',
job = 'police',
})
end)Get the list of available players in the dispatch.
exports['origen_police']:GetCentralSuscribeds()Get unpaid fines for a player by their identifier.
-- identifier: Player identifier
exports['origen_police']:GetUnpayedBills(identifier)Get the list of available players on the radio for a given group.
-- group: Group related to the alert
exports['origen_police']:GetPlayersReady(group)Add a vehicle to the police cameras and dispatch tracking list.
-- category: "police", "ambulance", etc.
-- netid: Network ID of the vehicle
-- label: Display label for the vehicle
exports['origen_police']:trackVehicle(category, netid, label)Remove a vehicle from the tracked vehicles list.
-- category: "police", "ambulance", etc.
-- netid: Network ID of the vehicle
exports['origen_police']:unTrackVehicle(category, netid)Get the list of all currently tracked vehicles.
exports['origen_police']:GetVehiclesTrackeds()Get the list of players on duty for a specific category.
This export is ESX only.
-- category: "police", "ambulance", etc.
exports['origen_police']:GetPlayersInDuty(category)Example:
local policeCount = exports['origen_police']:GetPlayersInDuty('police')
if #policeCount >= 3 then
print('Police count is greater than 3')
else
print('Police count is less than 3')
endGet all player sources currently ready, filtered by job. The source is the index of each entry in the returned table.
exports['origen_police']:GetPlayersReadyByJob(job)Send an alert to the police dispatch from the client side.
All data is optional except coords, title, and type.
TriggerServerEvent("SendAlert:police", {
coords = vector3(0, 0, 0),
title = 'Alert title',
type = 'GENERAL',
message = 'Alert message',
job = 'police',
metadata = {
model = 'Vehicle label',
color = {255, 255, 255},
plate = 'PLATE',
speed = '100 kmh',
weapon = 'Weapon name',
ammotype = 'AMMO_PISTOL',
name = 'Subject name',
unit = 'ADAM-10',
}
})Example:
RegisterCommand('testalert', function(source, args, rawCommand)
local coords = GetEntityCoords(PlayerPedId())
TriggerServerEvent("SendAlert:police", {
coords = coords,
title = 'Test alert title',
type = 'GENERAL',
message = 'Test alert message',
job = 'police',
})
end)Check if the local player is on duty. Returns a boolean.
exports['origen_police']:IsOnDuty()Send a vehicle theft alert to the police.
exports['origen_police']:RobVehicle()Toggle automatic alerts on/off.
exports['origen_police']:DisableAutoAlerts()Check if the local player is in jail. Returns a boolean.
exports['origen_police']:IsInPrision()Spawn the player in the federal location.
-- data: Player information (PlayerData)
exports['origen_police']:SpawnInFederal(data)Set the player's federal timer with a specified duration in minutes.
-- time: Duration in minutes
-- danger: "yes" or "no"
exports['origen_police']:SetFederal(time, danger)Set the player's wanted level.
-- level: Min 0 — Max 5
exports['origen_police']:SetWantedLevel(level)Check if the local player is handcuffed. Returns a boolean.
exports['origen_police']:IsHandcuffed()Check if the player has access to the tablet menu.
exports['origen_police']:CanOpenTablet()Get the minimum grade required to access certain features.
exports['origen_police']:GetMinimunGrade()Toggle the police tablet open/closed.
exports['origen_police']:TogglePause()Display the police fines menu.
exports['origen_police']:ShowBills()Get a list of fines for the local player.
exports['origen_police']:GetBills()Toggle radio communication.
exports['origen_police']:Toggle()