Client
toggleUI
exports.tk_dispatch:toggleUI(page)Toggles a UI page
page: 'callManager' 'sidebar' 'map'
getPlayerData
exports.tk_dispatch:getPlayerData()Returns a table of data that can be used for example for call message
return:
data:
tablegender:
stringlocation:
stringdirection:
stringvehicle?:
tablewill only return if player is in a vehiclemodel:
stringcolor:
stringplate:
string
weapon?:
stringwill only return if player is holding a weapon
addCall
exports.tk_dispatch:addCall(data)Adds a call with given data
data:
tabletitle:
stringcode?:
stringpriority?:
stringcoords:
vec3coordsOffset?:
numberwill randomise call coords by given amountimage?:
stringtakePhoto?:
booleanshould the call data include a photo of player screenmessage?:
stringshowLocation?:
booleanshowDirection?:
booleanshowGender?:
booleanshowVehicle?:
booleanplatePercentage?:
numberthe percentage of plate characters to show (0-100), missing characters will be replaced with a "?"showWeapon?:
booleanshowPerson?:
booleanshowNumber?:
booleanremoveTime?:
numbertime in milliseconds to remove callshowTime?:
numbertime in milliseconds the call will show as a notificationcolor?:
stringcolor for notification left sideflash?:
booleanplaySound?:
booleanplaySoundAll?:
booleanwill play a sound that all players can hearjobs:
string[]blip?:
tablesprite:
numberscale:
numbercolor:
numberflash?:
booleandisplay?:
numbershortRange?:
booleanradius?:
number
Examples
exports.tk_dispatch:addCall({
title = 'Burglary',
code = '10-58',
priority = 'Priority 3',
coords = GetEntityCoords(PlayerPedId()),
showLocation = true,
showGender = true,
playSound = true,
blip = {
color = 3,
sprite = 357,
scale = 1.0,
},
jobs = {'police'},
})exports.tk_dispatch:addCall({
title = 'Shooting',
code = '10-11',
priority = 'Priority 2',
coords = GetEntityCoords(PlayerPedId()),
showLocation = true,
showDirection = true,
showGender = true,
showVehicle = true,
platePercentage = 50,
showWeapon = true,
takePhoto = true,
coordsOffset = 20,
removeTime = 1000 * 60 * 10,
showTime = 10000,
blip = {
color = 3,
sprite = 110,
scale = 1.0,
radius = 40.0,
},
jobs = {'police', 'sheriff'},
})local data = exports.tk_dispatch:getPlayerData()
exports.tk_dispatch:addCall({
title = 'Shooting',
code = '10-11',
priority = 'Priority 2',
message = 'A ' .. data.gender .. ' is shooting at ' .. data.location .. ' with a ' .. data.weapon,
coords = GetEntityCoords(PlayerPedId()),
coordsOffset = 20,
removeTime = 1000 * 60 * 10,
showTime = 10000,
blip = {
color = 3,
sprite = 110,
scale = 1.0,
radius = 40.0,
},
jobs = {'police', 'sheriff'},
})Last updated