Tablet Beta
Script integration
Shared exports
⚠️
You are viewing the documentation for the LB Tablet Beta.

AddCheck

Types
---@alias CheckEvent "triangulatePhone" | "unlockPhone" | "createWiretap" | "listenToWiretap" | "openTablet"
---@param event CheckEvent
---@param handler fun(...: any): boolean
---@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
---@return number id
exports["lb-tablet"]:AddCheck(event, handler)

RemoveCheck

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

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" | "manage" | string
 
---@alias MDTPermission 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 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" | "manage" | string
 
---@alias MDTPermission 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 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)

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?)