๐Ÿงพ
docs.scriptsfivem.com
  • ๐Ÿ‘‹Welcome
  • ๐ŸงพResources
    • ๐Ÿ“ฑsfphone
      • Installations
      • Config
      • Exports
      • Open phone
    • ๐Ÿš—sfracing
      • Installations
      • Config
      • Exports
    • ๐Ÿ’ตsfbanking
      • Installations
      • Config
      • Exports
    • ๐Ÿ’ปsfctab
      • Installations
      • Config
      • Open tablet
      • Exports // Triggers
    • ๐Ÿ› ๏ธsfcrafting
      • Installations
      • Config
      • Open crafting table
    • ๐Ÿ””sfnotify
      • Installations
      • Config
      • Exports // Triggers
    • ๐Ÿ‘ทโ€โ™‚๏ธsfjob
      • Installations
      • Config
      • Exports // Triggers
    • ๐Ÿ’ปsfjobtab
      • Installations
      • Config
      • Triggers
    • โŒšsfgps
      • Installations
      • Config
      • Exports
    • ๐Ÿ‘ฎsfpolice
      • Installations
      • Config
      • Exports/Triggers
    • ๐Ÿฅsfems
      • Installations
      • Config
      • Exports/Triggers
    • ๐Ÿ…ฟ๏ธsfgarages
      • Installations
      • Config
      • Exports/Triggers
    • ๐Ÿ›๏ธsfdoj
      • Installations
      • Config
      • Exports/Triggers
    • ๐ŸŽฃsffishing
      • Installations
      • Config
      • Triggers
    • ๐Ÿš—sfvehicleshop
      • Installations
      • Config
    • ๐Ÿ”งsfmechanic
      • Installations
      • Config
      • Exports/Triggers
    • ๐Ÿฐsfjail
      • Installations
      • Config
      • Exports
    • ๐Ÿ”‘sfkeys
      • Exports
Powered by GitBook
On this page
  • TRIGGERS/EXPORTS Lua code examples for Client Side
  • EXPORTS Lua code examples for Server Side
  1. Resources
  2. sfpolice

Exports/Triggers

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)
local coords = vec4(0.0, 0.0, 0.0, 0.0) -- vec3(x, y, z) or vec4(x, y, z, w)
local maxSeconds = false -- false or time in seconds f.g.: 
exports["sfpolice"]:setFingerprint(coords, maxSeconds)

EXPORTS Lua code examples for Server Side

local jobs = { "police", "ems" } -- what units should receive dispatch
local street = "XYZ" -- The street where the report was sent from or false
local code = "ROB" -- Report code
local gps = vector3(0.0, 0.0, 0.0) -- The location where the report was sent from
local description= "Shop robbery" -- example
local 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 false
local 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 report
exports["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 = source
local channel = 1 -- for e.g.
exports["sfpolice"]:setChannelRadio(source, channel)

Checking the number of officers who have the status 'available'

exports["sfpolice"]:getFreePolice()

To imprint player fingerprints on a surface you can use this function

local coords = vec4(0.0, 0.0, 0.0, 0.0) -- vec3(x, y, z) or vec4(x, y, z, w)
local maxSeconds = false -- false or time in seconds f.g.: 60
exports["sfpolice"]:setFingerprint(source, coords, maxSeconds)

PreviousConfigNextsfems

Last updated 14 days ago

๐Ÿงพ
๐Ÿ‘ฎ