TK Scripts
  • Welcome
  • Common questions
  • Common problems
  • esx_tk_mechanicjob
    • Common questions & problems
  • tk_bosstablet
    • Common questions & problems
  • tk_jail
    • Common questions & problems
    • Exports
      • Client
      • Server
  • tk_laptop
    • Common Problems
    • Config
    • Exports
      • Client
      • Server
  • tk_mdt
    • Fivemanage setup (for images)
    • Common questions & problems
    • Config
    • Exports
      • Client
      • Server
  • tk_dispatch
    • Setup
    • Common Problems
    • Config
    • Exports
      • Client
      • Server
  • tk_housing
    • Setup
    • Common Problems
    • Config
    • Exports
      • Client
      • Server
  • tk_drugs
    • Common Questions & Problems
    • Config
  • tk_zipline
    • Config
  • tk_houserobbery
    • Config
  • tk_evidence
    • Config
    • Exports
      • Client
      • Server
  • tk_policejob
    • Config
    • Exports
      • Client
      • Server
Powered by GitBook
On this page
  • toggleUI
  • getPlayerData
  • addCall
  • Examples
  1. tk_dispatch
  2. Exports

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: table

    • gender: string

    • location: string

    • direction: string

    • vehicle?: table will only return if player is in a vehicle

      • model: string

      • color: string

      • plate: string

    • weapon?: string will only return if player is holding a weapon

addCall

exports.tk_dispatch:addCall(data)

Adds a call with given data

  • data: table

    • title: string

    • code?: string

    • priority?: string

    • coords?: vec3

    • coordsOffset?: number will randomise call coords by given amount

    • image?: string

    • takePhoto?: boolean should the call data include a photo of player screen

    • message?: string

    • showLocation?: boolean

    • showDirection?: boolean

    • showGender?: boolean

    • showVehicle?: boolean

    • platePercentage?: number the percentage of plate characters to show (0-100), missing characters will be replaced with a "?"

    • showWeapon?: boolean

    • showPerson?: boolean

    • showNumber?: boolean

    • removeTime?: number time in milliseconds to remove call

    • showTime?: number time in milliseconds the call will show as a notification

    • color?: string color for notification left side

    • flash?: boolean

    • playSound?: boolean

    • playSoundAll?: boolean will play a sound that all players can hear

    • jobs?: string[]

    • blip?: table

      • sprite: number

      • scale: number

      • color: number

      • flash?: boolean

      • display?: number

      • shortRange?: boolean

      • radius?: 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 -- will be removed after 10 minutes
    showTime = 10000 -- will be shown on screen (as notification) for 10 seconds
    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 -- will be removed after 10 minutes
    showTime = 10000 -- will be shown on screen (as notification) for 10 seconds
    blip = {
        color = 3,
        sprite = 110,
        scale = 1.0,
        radius = 40.0,
    },
    jobs = {'police', 'sheriff'}
})

PreviousExportsNextServer

Last updated 7 months ago