TRIGGERS/EXPORTS Lua code examples for Client Side
TriggerEvent("sfpolice:tabletopen") -- open police tablet
TriggerEvent("nuifix") -- if the NUI breaks.
local result = exports["sfpolice"]:bodyCamStatus()return result -- true(BC is enable) or false(BC is disable)
EXPORTS Lua code examples for Server Side
local jobs = { "police", "ems" } -- what units should receive dispatchlocal street ="XYZ" -- The street where the report was sent from or falselocal code ="ROB" -- Report codelocal gps =vector3(0.0, 0.0, 0.0) -- The location where the report was sent fromlocal description="Shop robbery" -- examplelocal blipData = { sprite =161, color =43, scale =0.8, label ='# Shop robbery', timeInSeconds =60, -- how long the blip should be displayed on the map (in seconds)} -- blipData can be falselocal source = false -- source player or false - if you provide the source, the police officer will be able to respond to the report on dispatch
local limit =10-- number or nil - displays the limit of police officers for a given reportexports["sfpolice"]:sendDispatch(jobs, street, code, gps, description, blipData, source, limit)
In your radio script, add export so that the tablet shows data on which radio the officer is on
local source = sourcelocal channel =1-- for e.g.exports["sfpolice"]:setChannelRadio(source, channel)
Checking the number of officers who have the status 'available'