Skip to Content

Shared Exports

Checks

AddCheck

Types

---@alias CheckEvent "triangulatePhone" | "unlockPhone" | "createWiretap" | "listenToWiretap" | "openTablet" | "createDispatch" | "playNativeSound" ---@class NewDispatchOptions ---@field priority 'high' | 'medium' | 'low' ---@field code string ---@field title string ---@field description string ---@field location { label: string, coords: { x: number, y: number } | vector2 } ---@field time number ---@field notificationTime? number ---@field image? string ---@field job? string | string[] ---@field mdt? string ---@field mdts? string[] ---@field sound? string ---@field fields? { icon: string, label: string, value?: string }[] ---@field blip? DispatchBlip ---@field responders? string[] ---@class DispatchBlip ---@field type? "default" | "radius" ---@field handle? number ---@field sprite? number ---@field color? number ---@field size? number ---@field shortRange? boolean ---@field label? string ---@field radius? number ---@field randomCoords? boolean
---@param event CheckEvent ---@param handler fun(...: any): boolean ---@overload fun(event: "openTablet", handler: fun(): boolean): number ---@overload fun(event: "triangulatePhone", handler: fun(source: number, phoneNumber: string): boolean): number ---@overload fun(event: "unlockPhone", handler: fun(source: number, phoneNumber: string): boolean): number ---@overload fun(event: "createWiretap", handler: fun(source: number, phoneNumber: string): boolean): number ---@overload fun(event: "listenToWiretap", handler: fun(source: number, phoneNumber: string): boolean): number ---@overload fun(event: "createDispatch", handler: fun(dispatchData: NewDispatchOptions): boolean): number ---@overload fun(event: "playNativeSound", handler: fun(soundType: string, soundName?: string): boolean): number ---@return number id exports["lb-tablet"]:AddCheck(event, handler)

RemoveCheck

---@param id number ---@return boolean success exports["lb-tablet"]:RemoveCheck(id)

Configuration

GetConfig

---@param key? string | string[] exports["lb-tablet"]:GetConfig(key?)

GetMDTs

Types

---@class MDT ---@field copy? string ---@field disabledTabs? string[] ---@field name string ---@field department string ---@field deviceName string ---@field appicon string ---@field icon string ---@field colorTheme string ---@field options MDTOptions ---@field callsign? MDTCallsignConfig ---@field defaultPermissions { [string]: { [MDTPermissionKey]: MDTPermission? } } ---@field tabs MDTTab[] ---@field jobsArray string[] ---@class MDTOptions ---@field dutyBlips boolean ---@class MDTCallsignConfig ---@field enabled boolean ---@field format? string ---@field requireTemplate? boolean ---@field allowChange? boolean ---@field autoGenerate? boolean ---@alias MDTPermissionKey "view" | "create" | "edit" | "delete" | "stash" | "fine" | "pin" | "kick" | "invite" | "private" | "triangulate" | "unlock" | "callHistory" | "createWiretap" | "listenWiretap" | "messageWiretap" | "removeWiretap" ---@alias MDTPermission boolean | number | number[] ---@alias MDTTab MDTBaseTab | MDTHomeTab | MDTUnitsTab | MDTUsersTab | MDTReportsTab | MDTPhoneTab ---@class MDTBaseTab ---@field id? string ---@field permissions? { [string]: { [MDTPermissionKey]: MDTPermission? } } ---@field type MDTTabType ---@field icon string ---@field label string ---@alias MDTTabType "home" | "bulletin" | "dispatch" | "users" | "vehicles" | "reports" | "phone" | "properties" | "weapons" | "logs" | "chat" | "catalog" ---@class MDTHomeTab : MDTBaseTab ---@field type "home" ---@field content string[] ---@class MDTUnitsTab ---@field type "units" ---@field default { status: string, units: { name: string, status: string }[] } ---@field statuses { [string]: { label: string, color: string } } ---@class MDTUsersTab : MDTBaseTab ---@field type "users" ---@field fields (MDTBaseUsersField | MDTUsersEntityField)[] ---@class MDTBaseUsersField ---@field id string ---@field type string ---@field label string ---@field editable? boolean ---@class MDTUsersEntityField : MDTBaseUsersField ---@field type "entity" ---@field entityType "profile" ---@field entityFields MDTUsersEntityFieldField[] ---@class MDTUsersEntityFieldField ---@field id string ---@field label string ---@field value? string ---@field copyable? string ---@field type? string ---@field check? MDTProfileEntityFieldsCheck ---@class MDTProfileEntityFieldsCheck ---@field tabType "reports" ---@field id string ---@field type "field" ---@field field? string ---@field value string ---@field involvement? string ---@class MDTReportsTab : MDTBaseTab ---@field type "reports" ---@field name? string ---@field shared? boolean ---@field mdt? string ---@field fields (MDTReportInvolvedField | MDTReportPhotoField | MDTReportLinkedField | MDTReportTextField | MDTDropdownField | MDTReportTargetField)[] ---@class MDTReportInvolvedField : MDTBaseReportField ---@field type "person" | "vehicle" | "weapon" | "employee" | "property" ---@field multiple boolean ---@field catalog? boolean ---@class MDTBaseReportField ---@field id string ---@field label string ---@class MDTReportPhotoField : MDTBaseReportField ---@field type "photo" ---@field multiple boolean ---@class MDTReportLinkedField : MDTBaseReportField ---@field type "linked" ---@field linkType "reports" ---@field linkId? string ---@field multiple boolean ---@class MDTReportTextField : MDTBaseReportField ---@field type "text" ---@field template? string ---@class MDTDropdownField : MDTBaseReportField ---@field type "dropdown" ---@field showInList? boolean ---@field options (string | { id: string, label: string, color?: string })[] ---@class MDTReportTargetField : MDTBaseReportField ---@field type "target" ---@field vehicle boolean ---@field person boolean ---@class MDTPhoneTab : MDTBaseTab ---@field type "phone" ---@field triangulation? MDTTriangulationOptions ---@field unlock? MDTUnlockOptions ---@field wiretap? MDTWiretapOptions ---@class MDTTriangulationOptions ---@field requireCall boolean ---@field cellTowerTime number ---@field successRate number ---@field rangeMultiplier number ---@class MDTUnlockOptions ---@field time? [number, number] ---@field chance? number ---@field attempts? number ---@class MDTWiretapOptions ---@field minCallDuration? number
---@return { [string]: MDT } exports["lb-tablet"]:GetMDTs()

GetMDT

Types

---@class MDT ---@field copy? string ---@field disabledTabs? string[] ---@field name string ---@field department string ---@field deviceName string ---@field appicon string ---@field icon string ---@field colorTheme string ---@field options MDTOptions ---@field callsign? MDTCallsignConfig ---@field defaultPermissions { [string]: { [MDTPermissionKey]: MDTPermission? } } ---@field tabs MDTTab[] ---@field jobsArray string[] ---@class MDTOptions ---@field dutyBlips boolean ---@class MDTCallsignConfig ---@field enabled boolean ---@field format? string ---@field requireTemplate? boolean ---@field allowChange? boolean ---@field autoGenerate? boolean ---@alias MDTPermissionKey "view" | "create" | "edit" | "delete" | "stash" | "fine" | "pin" | "kick" | "invite" | "private" | "triangulate" | "unlock" | "callHistory" | "createWiretap" | "listenWiretap" | "messageWiretap" | "removeWiretap" ---@alias MDTPermission boolean | number | number[] ---@alias MDTTab MDTBaseTab | MDTHomeTab | MDTUnitsTab | MDTUsersTab | MDTReportsTab | MDTPhoneTab ---@class MDTBaseTab ---@field id? string ---@field permissions? { [string]: { [MDTPermissionKey]: MDTPermission? } } ---@field type MDTTabType ---@field icon string ---@field label string ---@alias MDTTabType "home" | "bulletin" | "dispatch" | "users" | "vehicles" | "reports" | "phone" | "properties" | "weapons" | "logs" | "chat" | "catalog" ---@class MDTHomeTab : MDTBaseTab ---@field type "home" ---@field content string[] ---@class MDTUnitsTab ---@field type "units" ---@field default { status: string, units: { name: string, status: string }[] } ---@field statuses { [string]: { label: string, color: string } } ---@class MDTUsersTab : MDTBaseTab ---@field type "users" ---@field fields (MDTBaseUsersField | MDTUsersEntityField)[] ---@class MDTBaseUsersField ---@field id string ---@field type string ---@field label string ---@field editable? boolean ---@class MDTUsersEntityField : MDTBaseUsersField ---@field type "entity" ---@field entityType "profile" ---@field entityFields MDTUsersEntityFieldField[] ---@class MDTUsersEntityFieldField ---@field id string ---@field label string ---@field value? string ---@field copyable? string ---@field type? string ---@field check? MDTProfileEntityFieldsCheck ---@class MDTProfileEntityFieldsCheck ---@field tabType "reports" ---@field id string ---@field type "field" ---@field field? string ---@field value string ---@field involvement? string ---@class MDTReportsTab : MDTBaseTab ---@field type "reports" ---@field name? string ---@field shared? boolean ---@field mdt? string ---@field fields (MDTReportInvolvedField | MDTReportPhotoField | MDTReportLinkedField | MDTReportTextField | MDTDropdownField | MDTReportTargetField)[] ---@class MDTReportInvolvedField : MDTBaseReportField ---@field type "person" | "vehicle" | "weapon" | "employee" | "property" ---@field multiple boolean ---@field catalog? boolean ---@class MDTBaseReportField ---@field id string ---@field label string ---@class MDTReportPhotoField : MDTBaseReportField ---@field type "photo" ---@field multiple boolean ---@class MDTReportLinkedField : MDTBaseReportField ---@field type "linked" ---@field linkType "reports" ---@field linkId? string ---@field multiple boolean ---@class MDTReportTextField : MDTBaseReportField ---@field type "text" ---@field template? string ---@class MDTDropdownField : MDTBaseReportField ---@field type "dropdown" ---@field showInList? boolean ---@field options (string | { id: string, label: string, color?: string })[] ---@class MDTReportTargetField : MDTBaseReportField ---@field type "target" ---@field vehicle boolean ---@field person boolean ---@class MDTPhoneTab : MDTBaseTab ---@field type "phone" ---@field triangulation? MDTTriangulationOptions ---@field unlock? MDTUnlockOptions ---@field wiretap? MDTWiretapOptions ---@class MDTTriangulationOptions ---@field requireCall boolean ---@field cellTowerTime number ---@field successRate number ---@field rangeMultiplier number ---@class MDTUnlockOptions ---@field time? [number, number] ---@field chance? number ---@field attempts? number ---@class MDTWiretapOptions ---@field minCallDuration? number
---@param mdtName string ---@return MDT? exports["lb-tablet"]:GetMDT(mdtName)

MDT

IsEmployeeOfMDT

---@param mdtName string ---@param source? number # The source, if checking on the server ---@return boolean exports["lb-tablet"]:IsEmployeeOfMDT(mdtName, source?)

GetMDTPermissions

---@param mdtName string ---@param source? number ---@return { [string]: { [string]: boolean } } | false exports["lb-tablet"]:GetMDTPermissions(mdtName, source?)