Browse docs
Exports
Dispatch
Create a dispatch for the MDT Tablet.
exports["sky_jobs_base"]:createDispatch(
"Suspicious activity", -- title
"Caller reports suspicious behavior near Legion Square.", -- description
GetEntityCoords(PlayerPedId()), -- coords (vector3)
{ "police", "sheriff" } -- jobs
)
exports["sky_jobs_base"]:createDispatch(
"Suspicious activity", -- title
"Caller reports suspicious behavior near Legion Square.", -- description
vector3(215.9, -810.2, 30.7), -- coords (vector3)
{ "police", "sheriff" } -- jobs
)
Client exports
Open the menu to put someone in jail.
exports.sky_policejob:openJailMenu()
Toggle cuff state for the nearest player.
exports['sky_policejob']:cuffPlayer()
Remove cuffs from the nearest player.
exports['sky_policejob']:uncuffPlayer()
Use cuffs or zipties from another resource without requiring the player to be a police officer. This still respects Config.CivilianUse.
exports['sky_policejob']:useCuffPlayer('cuffs') -- or 'zipties'
exports['sky_policejob']:useUncuffPlayer()
Use a head bag on the nearest player without requiring the player to be a police officer. This still respects Config.CivilianUse.headBag.
exports['sky_policejob']:useHeadBag()
Check local cuff state for a player.
local cuffed = exports['sky_policejob']:isPlayerCuffed(serverId)
Start or stop escorting a player.
exports['sky_policejob']:escortToggle()
Put the escorted player into a vehicle.
exports['sky_policejob']:escortPutInVehicle()
Take the escorted player out of a vehicle.
exports['sky_policejob']:escortTakeOutVehicle()
Client events
TriggerEvent('sky_policejob:client:cuffPlayer')
TriggerEvent('sky_policejob:client:uncuffPlayer')
TriggerEvent('sky_policejob:client:useCuffPlayer', 'cuffs') -- or 'zipties'
TriggerEvent('sky_policejob:client:useUncuffPlayer')
TriggerEvent('sky_policejob:client:useHeadBag')
TriggerEvent('sky_policejob:client:escortToggle')
TriggerEvent('sky_policejob:client:escortPutInVehicle')
TriggerEvent('sky_policejob:client:escortTakeOutVehicle')
Server exports
Apply cuffs or zipties to a target player from another resource.
local success, reason = exports['sky_policejob']:cuffPlayer(sourceId, targetId, 'cuffs', {
ignoreItemCheck = false,
allowSelf = false
})
Remove cuffs or zipties from a target player.
local success, reason = exports['sky_policejob']:uncuffPlayer(sourceId, targetId)
Use or remove a head bag on a target player.
local success, reason = exports['sky_policejob']:useHeadBag(sourceId, targetId, 'toggle')
local isHeadBagged = exports['sky_policejob']:isPlayerHeadBagged(targetId)
Manual tablet registry exports
When Config.PoliceTablet.autoFillFromDatabase.citizens = false and/or Config.PoliceTablet.autoFillFromDatabase.vehicles = false, other scripts can manage the manual tablet registry entries through server exports.
If the matching autofill setting is still enabled, these exports return:
{
success = false,
error = "auto_fill_enabled"
}
Citizens
Create a manual citizen profile entry.
local result = exports["sky_policejob"]:RegisterCitizen({
identifier = "char1:abcd",
name = "Max Mustermann",
gender = "male",
dob = "1999-04-15",
job = "Unemployed",
tags = { "Wanted" },
notes = {
{ title = "Note", text = "Manual record" }
},
fingerprint = "FP-12345",
dna = "DNA-12345"
})
Update an existing manual citizen profile entry.
local result = exports["sky_policejob"]:UpdateCitizen({
identifier = "char1:abcd",
name = "Max Mustermann",
image_url = "https://example.com/citizen.png",
tags = { "Wanted", "VIP" }
})
Read or delete a manual citizen profile entry.
local citizen = exports["sky_policejob"]:GetCitizen("char1:abcd")
local deleted = exports["sky_policejob"]:DeleteCitizen("char1:abcd")
Supported citizen payload fields:
identifiernamegenderdobjobimage_urlorurlimage_idtagsnotesfingerprintdna
Vehicles
Create a manual vehicle profile entry.
local result = exports["sky_policejob"]:RegisterVehicle({
plate = "B-EMS-12",
model = "ambulance",
owner_name = "Sky Medical",
owner_identifier = "society:ambulance",
color = {
primary = "white",
secondary = "red"
}
})
Update an existing manual vehicle profile entry.
local result = exports["sky_policejob"]:UpdateVehicle({
plate = "B-EMS-12",
tags = { "Fleet" },
cases = { "CASE-1024" },
notes = {
{ title = "Storage", text = "Assigned to EMS fleet" }
}
})
Read or delete a manual vehicle profile entry.
local vehicle = exports["sky_policejob"]:GetVehicle("B-EMS-12")
local deleted = exports["sky_policejob"]:DeleteVehicle("B-EMS-12")
Supported vehicle payload fields:
platemodelownerNameorowner_nameownerIdentifierorowner_identifiercolorimage_urlorurlimage_idtagsnotescases
Salary
Pause or resume salary payouts for police employees. These exports are provided by sky_jobs_base and work for all job types.
pausePlayerSalary(playerId)
- Purpose: Pauses salary payouts for the given player.
- Arguments:
playerId(number) — the server ID of the player.
- Returns:
boolean—trueon success.
resumePlayerSalary(playerId)
- Purpose: Resumes salary payouts for the given player.
- Arguments:
playerId(number) — the server ID of the player.
- Returns:
boolean—trueon success.
isPlayerSalaryPaused(playerId)
- Purpose: Checks whether salary payouts are currently paused.
- Arguments:
playerId(number) — the server ID of the player.
- Returns:
boolean—trueif paused.
-- Pause salary (e.g. when player is AFK)
exports["sky_jobs_base"]:pausePlayerSalary(playerId)
-- Resume salary (e.g. when player returns)
exports["sky_jobs_base"]:resumePlayerSalary(playerId)
-- Check if paused
local paused = exports["sky_jobs_base"]:isPlayerSalaryPaused(playerId)