Kartik Scripts

Exports

Other scripts or custom resources (e.g., custom radial menus, interactive menus, heists, or jail scripts) can integrate with kartik-policejob using these public client and server exports.

๐Ÿ”’ Restraints & Compliance

Client-Side Exports

-- Interact with the nearest player
exports['kartik-policejob']:PoliceCuff('back') -- Cuff the nearest player (hands in back)
exports['kartik-policejob']:PoliceEscort()      -- Start/stop escorting the nearest cuffed player
exports['kartik-policejob']:PoliceVehicle(true) -- Put the nearest cuffed player in the vehicle (rear seats first)
exports['kartik-policejob']:PoliceVehicle(true, 'rr') -- Same, in a chosen seat: 'front', 'rl', 'rr' or a seat number

-- Interact with a specific player server ID
local targetPlayerId = 12
exports['kartik-policejob']:CuffPlayer(targetPlayerId, 'back')
exports['kartik-policejob']:EscortPlayer(targetPlayerId)
exports['kartik-policejob']:VehiclePlayer(targetPlayerId, true)  -- Put in vehicle
exports['kartik-policejob']:VehiclePlayer(targetPlayerId, false) -- Pull out of vehicle

-- Check local player restraint status
local isCuffed = exports['kartik-policejob']:IsCuffed()       -- Returns boolean
local isEscorted = exports['kartik-policejob']:IsEscorted()   -- Returns boolean

Server-Side Exports

-- Check target player restraint status
local isCuffed = exports['kartik-policejob']:IsCuffed(targetSrc)     -- Returns boolean
local isEscorted = exports['kartik-policejob']:IsEscorted(targetSrc) -- Returns boolean

-- Cuff/Uncuff players
exports['kartik-policejob']:CuffPlayer(targetSrc, style, kind, officerSrc)
exports['kartik-policejob']:UncuffPlayer(targetSrc)

-- Escort & Transport
exports['kartik-policejob']:EscortPlayer(targetSrc, officerSrc)
exports['kartik-policejob']:VehiclePlayer(targetSrc, put) -- true = put in, false = pull out
exports['kartik-policejob']:VehiclePlayer(targetSrc, true, 1) -- Put in a chosen passenger seat (0 front, 1 rear left, 2 rear right)

-- Handcuff Security Status
local isDoubleLocked = exports['kartik-policejob']:IsDoubleLocked(targetSrc) -- Returns boolean
local officerId = exports['kartik-policejob']:GetCuffOwner(targetSrc)       -- Returns officer source ID
exports['kartik-policejob']:ClearDoubleLock(targetSrc)

๐Ÿ“‹ Duty & Officers

Server-Side Exports

-- Get all configured police departments
local depts = exports['kartik-policejob']:GetPoliceDepts()

-- Get list of on-duty officers
local officers = exports['kartik-policejob']:GetOnDutyOfficers()

-- Check if a player is on-duty
local onDuty = exports['kartik-policejob']:IsOnDuty(source) -- Returns boolean

๐Ÿ‘ฃ Ankle Monitor

Server-Side Exports

-- Check whether a player has an ankle monitor. Returns boolean.
local tracked = exports['kartik-policejob']:IsAnkleMonitored(targetSrc)

Client-Side Exports

-- Check whether the local player has an ankle monitor. Returns boolean.
local tracked = exports['kartik-policejob']:IsAnkleMonitored()

๐Ÿš“ Pursuit Mode

Client-Side Exports

-- Toggle current vehicle pursuit stage
exports['kartik-policejob']:TogglePursuitMode()

-- Get current pursuit mode stage index
local stage = exports['kartik-policejob']:GetCurrentPursuitStage() -- Returns integer (e.g. 0, 1, 2)

๐Ÿš Surveillance Drone

Client-Side Exports

These take the same arguments ox_inventory passes to a client.export, so they can be used straight from an item definition (client = { export = 'kartik-policejob.useRemote' }).

-- Deploy or pack up the drone in the given item slot
exports['kartik-policejob']:useDrone(itemData, slotData)

-- Use a drone remote: opens the remote menu for its paired drone
exports['kartik-policejob']:useRemote(itemData, slotData)

slotData is { name, slot, metadata }. When calling them yourself you can pass a single item table with slot and metadata instead. See Surveillance Drone.


๐ŸŽ“ Training Academy

Server-Side Exports

-- Check if cadet has completed a specific certification
local hasCert = exports['kartik-policejob']:HasAcademyCert(source, certType) -- Returns boolean

On this page