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.
Server-side exports
SendAlert
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)GetCentralSuscribeds
Get the list of available players in the dispatch.
exports['origen_police']:GetCentralSuscribeds()GetUnpayedBills
Get unpaid fines for a player by their identifier.
-- identifier: Player identifier
exports['origen_police']:GetUnpayedBills(identifier)GetPlayersReady
Get the list of available players on the radio for a given group.
-- group: Group related to the alert
exports['origen_police']:GetPlayersReady(group)trackVehicle
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)unTrackVehicle
Remove a vehicle from the tracked vehicles list.
-- category: "police", "ambulance", etc.
-- netid: Network ID of the vehicle
exports['origen_police']:unTrackVehicle(category, netid)GetVehicleTrackeds
Get the list of all currently tracked vehicles.
exports['origen_police']:GetVehiclesTrackeds()GetPlayersInDuty
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')
endGetPlayersReadyByJob
Get 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)Client-side exports
SendAlert
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)IsOnDuty
Check if the local player is on duty. Returns a boolean.
exports['origen_police']:IsOnDuty()RobVehicle
Send a vehicle theft alert to the police.
exports['origen_police']:RobVehicle()DisableAutoAlerts
Toggle automatic alerts on/off.
exports['origen_police']:DisableAutoAlerts()IsInPrision
Check if the local player is in jail. Returns a boolean.
exports['origen_police']:IsInPrision()SpawnInFederal
Spawn the player in the federal location.
-- data: Player information (PlayerData)
exports['origen_police']:SpawnInFederal(data)SetFederal
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)SetWantedLevel
Set the player's wanted level.
-- level: Min 0 — Max 5
exports['origen_police']:SetWantedLevel(level)IsHandcuffed
Check if the local player is handcuffed. Returns a boolean.
exports['origen_police']:IsHandcuffed()CanOpenTablet
Check if the player has access to the tablet menu.
exports['origen_police']:CanOpenTablet()GetMinimunGrade
Get the minimum grade required to access certain features.
exports['origen_police']:GetMinimunGrade()TogglePause
Toggle the police tablet open/closed.
exports['origen_police']:TogglePause()ShowBills
Display the police fines menu.
exports['origen_police']:ShowBills()GetBills
Get a list of fines for the local player.
exports['origen_police']:GetBills()Toggle
Toggle radio communication.
exports['origen_police']:Toggle()