🔄Exports
📚 m-CourtSystem - Exports Documentation
Complete reference for all available exports to integrate m-CourtSystem with your other scripts.
Client Exports
🖥️ UI Management
OpenUI
Opens the courthouse UI for players with authorized jobs.
exports['m-CourtSystem']:OpenUI()Returns: boolean - Success status
Example:
RegisterCommand('opencourtui', function()
local success = exports['m-CourtSystem']:OpenUI()
if success then
print("Courthouse UI opened")
end
end)CloseUI
Closes the courthouse UI.
Returns: boolean - Success status
Example:
IsUIOpen
Checks if the courthouse UI is currently open.
Returns: boolean - Whether the UI is open
Example:
🔒 Jail Management
GetJailStatus
Gets the player's current jail status.
Returns: table|nil - Jail information or nil if not jailed
time(number) - Remaining jail time in secondsreason(string) - Reason for jailingjailed_by(string) - Who jailed the player
Example:
IsJailed
Checks if the player is currently jailed.
Returns: boolean - Whether the player is jailed
Example:
GetJailTimeRemaining
Gets the remaining jail time in seconds.
Returns: number - Remaining time in seconds (0 if not jailed)
Example:
👤 Player Information
GetMyLicenses
Gets all of the player's licenses.
Returns: table - Array of license objects
id(number) - License IDlicense_type(string) - Type of licensestatus(string) - License status (valid/suspended/revoked)issue_date(string) - Date issuedexpiry_date(string|nil) - Expiry date if applicable
Example:
HasLicense
Checks if the player has a specific valid license.
Parameters:
licenseType(string) - License type to check (e.g., 'driver', 'weapon', 'bar')
Returns: boolean - Whether the player has the license
Example:
GetMyFines
Gets all of the player's fines.
Returns: table - Array of fine objects
id(number) - Fine IDamount(number) - Fine amountreason(string) - Reason for finestatus(string) - Payment status (paid/unpaid)issue_date(string) - Date issued
Example:
GetTotalUnpaidFines
Gets the total amount of unpaid fines.
Returns: number - Total unpaid amount
Example:
GetMyWarrants
Gets all of the player's warrants.
Returns: table - Array of warrant objects
id(number) - Warrant IDwarrant_type(string) - Type of warrant (arrest/search)reason(string) - Reason for warrantstatus(string) - Warrant status (active/executed/cancelled)issue_date(string) - Date issued
Example:
HasActiveWarrants
Checks if the player has any active warrants.
Returns: boolean - Whether the player has active warrants
Example:
GetMyCriminalRecord
Gets the player's criminal record.
Returns: table - Array of criminal record objects
id(number) - Record IDcrime_type(string) - Type of crimedescription(string) - Crime descriptionofficer(string) - Arresting officerdate(string) - Date of record
Example:
📝 Exams
GetAvailableExams
Gets all available exam types.
Returns: table - Array of exam type names
Example:
HasPassedExam
Checks if the player has passed a specific exam.
Parameters:
examType(string) - Exam type to check (e.g., 'bar', 'attorney', 'judge')
Returns: boolean - Whether the player passed the exam
Example:
📅 Appointments
GetMyAppointments
Gets all of the player's appointments.
Returns: table - Array of appointment objects
Example:
GetUpcomingAppointments
Gets upcoming appointments (next 7 days).
Returns: table - Array of upcoming appointment objects
Example:
📋 Citations
GetMyCitations
Gets the player's citations (requires m-Citations).
Returns: table - Array of citation objects
Example:
🚗 Vehicles
GetVehicleInsurance
Gets vehicle insurance status (requires m-Insurance).
Parameters:
plate(string) - Vehicle plate number
Returns: table|nil - Insurance information or nil
Example:
GetVehicleInspection
Gets vehicle inspection status (requires m-Inspection).
Parameters:
plate(string) - Vehicle plate number
Returns: table|nil - Inspection information or nil
Example:
Server Exports
👥 Player Profile
GetPlayerProfile
Gets complete player profile.
Parameters:
identifier(string) - Player identifier
Returns: table|nil - Complete profile data or nil
Example:
GetPlayerInfo
Gets basic player information.
Parameters:
source(number) - Player server ID
Returns: table - Player info
identifier(string) - Player identifiername(string) - Player name
Example:
📜 Licenses
GetPlayerLicenses
Gets all licenses for a player.
Parameters:
identifier(string) - Player identifier
Returns: table - Array of license objects
Example:
HasLicense
Checks if a player has a specific valid license.
Parameters:
identifier(string) - Player identifierlicenseType(string) - License type to check
Returns: boolean - Whether the player has the license
Example:
AddLicense
Adds a license to a player.
Parameters:
data(table) - License dataidentifier(string) - Player identifierlicense_type(string) - License typeissued_by(string, optional) - Who issued the licenseexpiry_date(string, optional) - Expiry date
Returns: boolean - Success status
Example:
RevokeLicense
Revokes a player's license.
Parameters:
identifier(string) - Player identifierlicenseType(string) - License type to revoke
Returns: boolean - Success status
Example:
SuspendLicense
Suspends a player's license.
Parameters:
identifier(string) - Player identifierlicenseType(string) - License type to suspend
Returns: boolean - Success status
Example:
💰 Fines
GetPlayerFines
Gets all fines for a player.
Parameters:
identifier(string) - Player identifier
Returns: table - Array of fine objects
Example:
GetPlayerUnpaidFines
Gets total unpaid fines for a player.
Parameters:
identifier(string) - Player identifier
Returns: number - Total unpaid amount
Example:
CreateFine
Creates a fine for a player.
Parameters:
data(table) - Fine dataidentifier(string) - Player identifieramount(number) - Fine amountreason(string) - Reason for fineissued_by(string, optional) - Who issued the fine
Returns: number|nil - Fine ID or nil on failure
Example:
PayFine
Marks a fine as paid.
Parameters:
fineId(number) - Fine ID to mark as paid
Returns: boolean - Success status
Example:
⚖️ Warrants
GetPlayerWarrants
Gets all warrants for a player.
Parameters:
identifier(string) - Player identifier
Returns: table - Array of warrant objects
Example:
HasActiveWarrants
Checks if a player has active warrants.
Parameters:
identifier(string) - Player identifier
Returns: boolean - Whether player has active warrants
Example:
CreateWarrant
Creates a warrant for a player.
Parameters:
data(table) - Warrant dataidentifier(string) - Player identifierwarrant_type(string) - Warrant type ('arrest' or 'search')reason(string) - Reason for warrantissued_by(string, optional) - Who issued the warrant
Returns: number|nil - Warrant ID or nil on failure
Example:
ExecuteWarrant
Executes/closes a warrant.
Parameters:
warrantId(number) - Warrant ID
Returns: boolean - Success status
Example:
CancelWarrant
Cancels a warrant.
Parameters:
warrantId(number) - Warrant ID
Returns: boolean - Success status
Example:
📁 Criminal Records
GetCriminalRecord
Gets criminal record for a player.
Parameters:
identifier(string) - Player identifier
Returns: table - Array of criminal record objects
Example:
AddCriminalRecord
Adds a criminal record entry.
Parameters:
data(table) - Record dataidentifier(string) - Player identifiercrime_type(string) - Type of crimedescription(string, optional) - Crime descriptionofficer(string, optional) - Arresting officersentence(string, optional) - Sentence given
Returns: number|nil - Record ID or nil on failure
Example:
DeleteCriminalRecord
Deletes a criminal record entry.
Parameters:
recordId(number) - Record ID to delete
Returns: boolean - Success status
Example:
📋 Cases
GetPlayerCases
Gets all cases for a player.
Parameters:
identifier(string) - Player identifier
Returns: table - Array of case objects
Example:
CreateCase
Creates a new court case.
Parameters:
data(table) - Case datacase_number(string) - Unique case numbertitle(string) - Case titleplaintiff_id(string, optional) - Plaintiff identifierdefendant_id(string, optional) - Defendant identifierdescription(string, optional) - Case descriptionfiled_by(string, optional) - Who filed the case
Returns: number|nil - Case ID or nil on failure
Example:
UpdateCaseStatus
Updates case status.
Parameters:
caseId(number) - Case IDstatus(string) - New status ('open', 'in_progress', 'closed', 'dismissed')
Returns: boolean - Success status
Example:
📅 Appointments
GetPlayerAppointments
Gets all appointments for a player.
Parameters:
identifier(string) - Player identifier
Returns: table - Array of appointment objects
Example:
CreateAppointment
Creates an appointment.
Parameters:
data(table) - Appointment datacitizen_id(string) - Citizen identifierattorney_id(string, optional) - Attorney identifierappointment_type(string) - Type of appointmentappointment_date(string, optional) - Date and timenotes(string, optional) - Additional notes
Returns: number|nil - Appointment ID or nil on failure
Example:
CancelAppointment
Cancels an appointment.
Parameters:
appointmentId(number) - Appointment ID
Returns: boolean - Success status
Example:
🔒 Jail
JailPlayer
Jails a player.
Parameters:
identifier(string) - Player identifiertime(number) - Jail time in secondsreason(string, optional) - Reason for jailingjailedBy(string, optional) - Who jailed the player
Returns: boolean - Success status
Example:
ReleasePlayer
Releases a player from jail.
Parameters:
identifier(string) - Player identifier
Returns: boolean - Success status
Example:
GetJailTime
Gets player's remaining jail time.
Parameters:
identifier(string) - Player identifier
Returns: number - Remaining time in seconds (0 if not jailed)
Example:
IsPlayerJailed
Checks if a player is jailed.
Parameters:
identifier(string) - Player identifier
Returns: boolean - Whether player is jailed
Example:
📄 Documents
GetPlayerDocuments
Gets all documents for a player.
Parameters:
identifier(string) - Player identifier
Returns: table - Array of document objects
Example:
CreateDocument
Creates a document.
Parameters:
data(table) - Document datadocument_type(string) - Type of documenttitle(string) - Document titlecontent(string, optional) - Document contentissued_by(string, optional) - Who issued the documentrecipient_id(string, optional) - Recipient identifier
Returns: number|nil - Document ID or nil on failure
Example:
RevokeDocument
Revokes a document.
Parameters:
documentId(number) - Document ID
Returns: boolean - Success status
Example:
🏢 Businesses
GetBusinessInfo
Gets business information.
Parameters:
businessId(number) - Business ID
Returns: table|nil - Business data or nil
Example:
GetPlayerBusinesses
Gets all businesses owned by a player.
Parameters:
identifier(string) - Player identifier
Returns: table - Array of business objects
Example:
RegisterBusiness
Registers a new business.
Parameters:
data(table) - Business databusiness_name(string) - Business namebusiness_type(string, optional) - Type of businessowner_id(string) - Owner identifiertax_id(string, optional) - Tax ID
Returns: number|nil - Business ID or nil on failure
Example:
CloseBusiness
Closes a business.
Parameters:
businessId(number) - Business ID
Returns: boolean - Success status
Example:
📝 Exams
HasPassedExam
Checks if a player passed an exam.
Parameters:
identifier(string) - Player identifierexamType(string) - Exam type
Returns: boolean - Whether player passed
Example:
RecordExamResult
Records an exam result.
Parameters:
identifier(string) - Player identifierexamType(string) - Exam typescore(number) - Score percentagepassed(boolean) - Whether passed
Returns: boolean - Success status
Example:
💵 Taxes
GetPlayerTaxes
Gets player's tax records.
Parameters:
identifier(string) - Player identifier
Returns: table - Array of tax record objects
Example:
CreateTaxRecord
Creates a tax record.
Parameters:
data(table) - Tax datataxpayer_id(string) - Taxpayer identifiertax_year(number, optional) - Tax yeartax_type(string, optional) - Type of taxamount(number) - Tax amount
Returns: number|nil - Tax record ID or nil on failure
Example:
🗳️ Elections
GetActiveElections
Gets all active elections.
Returns: table - Array of active election objects
Example:
HasVoted
Checks if a player has voted in an election.
Parameters:
identifier(string) - Player identifierelectionId(number) - Election ID
Returns: boolean - Whether player has voted
Example:
Last updated