All data is optional except for (coords, title, and type).
-- coords: Coordinates vector3(x, y, z) in which the alert is triggered-- title: Title of the alert-- type: Type of alert (GENERAL, RADARS, 215, DRUGS, FORCE, 48X) This is to filter the alerts in the dashboard-- message: Alert message-- job: Job group related to the alert-- metadata: Additional metadata of the alert (vehicle model, color, plate, speed, weapon, ammo type, name of the subject, 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', }})
Get unpaid fines of a player using their identifier.
-- identifier: Player identifierexports['origen_police']:GetUnpayedBills(identifier)
GetPlayersReady
Get list of available players on the radio.
-- group: Group related to the alertexports['origen_police']:GetPlayersReady(group)
trackVehicle
Add the vehicle to the police cameras and dispatch.
-- category: Category of the vehicle tracking ("police", "ambulance", etc.)-- netid: Network ID of the vehicle being tracked-- label: Label of the vehicle being trackedexports['origen_police']:trackVehicle(category, netid, label)
unTrackVehicle
Remove the vehicle from the list of tracked vehicles.
-- category: Category of the vehicle tracking ("police", "ambulance", etc.)-- netid: Network ID of the vehicle being trackedexports['origen_police']:unTrackVehicle(category, netid)
GetVehicleTrackeds
Get list of tracked vehicles.
exports['origen_police']:GetVehiclesTrackeds()
GetPlayersInDuty
Get list of players on duty for a specific category.
-- category: Category of duty ("police", "ambulance", etc.)exports['origen_police']:GetPlayersInDuty(category)
Example of use
local policeCount = exports['origen_police']:GetPlayersInDuty('police')if#policeCount >=3thenprint('Police count is greater than 3')elseprint('Police count is less than 3')end
GetPlayersReadyByJob
Get a list with all the players sources ready filtered by players job, the source is the index of each entry of the table.
-- job: @string - Job name of the filter(police, ambulance, sheriff, etc)-- onlyInFrec: @bool - True/False to only get the players inside freqsexports['origen_police']:GetPlayersReadyByJob("police")
Example of use
local agentsReady = exports['origen_police']:GetPlayersReadyByJob('police', true)for playerId, _ inpairs(agentsReady) doprint("Player with ID: ", playerId, "is inside a freq and is ready")end
local agentsReady = exports['origen_police']:GetPlayersReadyByJob('police', false)for playerId, _ inpairs(agentsReady) doprint("Player with ID: ", playerId, "is ready")end