Server Exports
Misc
GetEquippedTablet
---@param source number
---@return string | nil
local tabletId = exports["lb-tablet"]:GetEquippedTablet(source)
GetSourceFromTablet
---@param tabletId string
---@return number | nil
local source = exports["lb-tablet"]:GetSourceFromTablet(tabletId)
GetSettings
---@param tabletId string
---@return table | nil
local settings = exports["lb-phone"]:GetSettings(tabletId)
Notifications
SendNotification
---@class Notification
---@field tabletId? string
---@field source? number
---@field app string
---@field title string
---@field content? string
---@field thumbnail? string
---@field avatar? string
---@field showAvatar? boolean
---@param notification Notification
---@return number
local notificationId = exports["lb-tablet"]:SendNotification(notification)
NotifyEveryone
---@param notification Notification
---@param saveToDatabase? boolean # If this is set to true, people who are not online will also receive a notification
exports["lb-tablet"]:NotifyEveryone(notification, saveToDatabase)
NotifyTablets
---@param tabletIds string[]
---@param notification Notification
---@param excludeTablets? string[]
exports["lb-tablet"]:NotifyTablets(tabletIds, notification, excludeTablets)
Dispatch
AddDispatch
Add a dispatch to the tablet. For icons, use Ionicons 5 (opens in a new tab) or Font Awesome (opens in a new tab).
---@class Dispatch
---@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 # The duration of the dispatch in seconds
---@field image? string
---@field job? 'police' | 'ambulance'
---@field fields? { icon: string, label: string, value?: string }[]
---@param dispatch Dispatch
---@return number
local dispatchId = exports["lb-tablet"]:AddDispatch(dispatch)
UpdateDispatch
---@param id number
---@param dispatch Dispatch
---@return boolean
local success = exports["lb-tablet"]:UpdateDispatch(id, dispatch)
GetDispatch
---@param dispatchId number
---@return Dispatch | nil
local dispatch = exports["lb-tablet"]:GetDispatch(dispatchId)
RemoveDispatch
---@param dispatchId number
---@return boolean
local success = exports["lb-tablet"]:RemoveDispatch(dispatchId)
Police Misc
RegisterWeapon
Register a weapon. Optionally, the owner (identifier/citizenid) and weapon name (e.g. "WEAPON_PISTOL"
) can be provided.
---@param serialNumber string
---@param data? { owner?: string, weaponName?: string }
exports["lb-tablet"]:RegisterWeapon(serialNumber, data)
GetPoliceAvatar
---@param identifier string
---@return string | nil
local avatar = exports["lb-tablet"]:GetPoliceAvatar(identifier)
GetPoliceCallsign
---@param identifier string
---@return string | nil
local callsign = exports["lb-tablet"]:GetPoliceCallsign(identifier)
SetPoliceCallsign
---@param identifier string
---@param callsign string
---@param ignoreCallsignCheck? boolean # If set to true, the callsign will be set without checking if it follows the format
---@return boolean success
local success = exports["lb-tablet"]:SetPoliceCallsign(identifier, callsign, ignoreCallsignCheck)
Police Jail
LogJailed
---@param prisoner string # The player's identifier
---@param jailedBy? string # The police officer's identifier, or name
---@param reason string
---@param jailTime number The jail time in seconds
---@param relatedCase? number # The case ID
---@return false | number
local jailId = exports["lb-tablet"]:LogJailed(prisoner, jailedBy, reason, jailTime, relatedCase)
GetJailed
---@class JailData
---@field id number
---@field identifier string
---@field name string
---@field jailedBy string
---@field originalTime number
---@field remainingTime number
---@field jailedAt number
---@field releasedAt number
---@field case? { id: number, title: string }
---@field avatar? string
---@field description? string
---@param identifier string
---@return JailData | false
local jailed = exports["lb-tablet"]:GetJailed(identifier)
UpdateJailSentence
---@param identifier string
---@param time number # The new jail time in seconds
---@return boolean
local success = exports["lb-tablet"]:UpdateJailSentence(identifier, time)
Police Reports
CreatePoliceReport
---@class PoliceReport
---@field id? number
---@field title string
---@field description string
---@field type string
---@field tags? number[] # tag ids
---@field gallery? string[] # image URLs
---@field officers? string[] # identifiers
---@field civilians? string[] # identifier
---@field suspects? string[] # identifiers
---@param source number # The author of the report
---@param report PoliceReport
---@return number | false
---@return string? # Error message
local reportId, errorMessage = exports["lb-tablet"]:CreatePoliceReport(source, report)
GetPoliceReport
---@param reportId number
---@return table
local report = exports["lb-tablet"]:GetPoliceReport(reportId)
UpdatePoliceReport
Make sure to include the report id in the data object when updating a report.
---@param source number
---@param data PoliceReport
---@return number | false
---@return string? # Error message
local reportId, errorMessage = exports["lb-tablet"]:UpdatePoliceReport(source, data)
DeletePoliceReport
---@param id number
---@return boolean
local success = exports["lb-tablet"]:DeletePoliceReport(id)
Police Warrants
CreatePoliceWarrant
---@class PoliceWarrant
---@field id? number
---@field title string
---@field description string
---@field type string
---@field status 'active' | 'expired' | 'cancelled'
---@field priority 'low' | 'medium' | 'high'
---@field tags? number[]
---@field gallery? string[]
---@field reports? number[]
---@param source number # The author of the warrant
---@param data PoliceWarrant
---@return number | false
---@return string? # Error message
local warrantId, errorMessage = exports["lb-tablet"]:CreateWarrant(source, data)
GetPoliceWarrant
---@param warrantId number
---@return table
local warrant = exports["lb-tablet"]:GetPoliceWarrant(warrantId)
UpdatePoliceWarrant
Make sure to include the warrant id in the data object when updating a warrant.
---@param source number
---@param data PoliceWarrant
---@return number | false
---@return string? # Error message
local warrantId, errorMessage = exports["lb-tablet"]:UpdatePoliceWarrant(source, data)
DeletePoliceWarrant
---@param id number
---@return boolean
local success = exports["lb-tablet"]:DeletePoliceWarrant(id)
Police Cases
CreatePoliceCase
---@class PoliceCase
---@field id? number
---@field title string
---@field description string
---@field evidence? string[]
---@field vehicles? string[]
---@field officers? string[]
---@field civilians? string[]
---@field criminals? Criminal[]
---@field tags? number[]
---@param source number # The author of the case
---@param data PoliceCase
---@return number | false
---@return string? # Error message
local caseId, errorMessage = exports["lb-tablet"]:CreatePoliceCase(source, data)
GetPoliceCase
---@param caseId number
---@return table
local case = exports["lb-tablet"]:GetPoliceCase(caseId)
UpdatePoliceCase
Make sure to include the case id in the data object when updating a case.
---@param source number
---@param data PoliceCase
---@return number | false
---@return string? # Error message
local caseId, errorMessage = exports["lb-tablet"]:UpdatePoliceCase(source, data)
DeletePoliceCase
---@param id number
---@return boolean
local success = exports["lb-tablet"]:DeletePoliceCase(id)
Ambulance Misc
GetAmbulanceAvatar
---@param identifier string
---@return string | nil
local avatar = exports["lb-tablet"]:GetAmbulanceAvatar(identifier)
GetAmbulanceCallsign
---@param identifier string
---@return string | nil
local callsign = exports["lb-tablet"]:GetAmbulanceCallsign(identifier)
SetAmbulanceCallsign
---@param identifier string
---@param callsign string
---@param ignoreCallsignCheck? boolean # If set to true, the callsign will be set without checking if it follows the format
---@return boolean success
local success = exports["lb-tablet"]:SetAmbulanceCallsign(identifier, callsign, ignoreCallsignCheck)
Ambulance Reports
CreateAmbulanceReport
---@class AmbulanceReport
---@field id? number
---@field title string
---@field description string
---@field type string
---@field patient string
---@field gallery? string[]
---@field doctors? string[]
---@field tags? number[]
---@field injuries? number[]
---@param source number # The author of the report
---@param data AmbulanceReport
---@return number | false
---@return string? # Error message
local reportId, errorMessage = exports["lb-tablet"]:CreateAmbulanceReport(source, data)
GetAmbulanceReport
---@param reportId number
---@return table
local report = exports["lb-tablet"]:GetAmbulanceReport(reportId)
UpdateAmbulanceReport
Make sure to include the report id in the data object when updating a report.
---@param source number
---@param data AmbulanceReport
---@return number | false
---@return string? # Error message
local reportId, errorMessage = exports["lb-tablet"]:UpdateAmbulanceReport(source, data)
DeleteAmbulanceReport
---@param id number
---@return boolean
local success = exports["lb-tablet"]:DeleteAmbulanceReport(id)