🔄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 seconds

  • reason (string) - Reason for jailing

  • jailed_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 ID

  • license_type (string) - Type of license

  • status (string) - License status (valid/suspended/revoked)

  • issue_date (string) - Date issued

  • expiry_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 ID

  • amount (number) - Fine amount

  • reason (string) - Reason for fine

  • status (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 ID

  • warrant_type (string) - Type of warrant (arrest/search)

  • reason (string) - Reason for warrant

  • status (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 ID

  • crime_type (string) - Type of crime

  • description (string) - Crime description

  • officer (string) - Arresting officer

  • date (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 identifier

  • name (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 identifier

  • licenseType (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 data

    • identifier (string) - Player identifier

    • license_type (string) - License type

    • issued_by (string, optional) - Who issued the license

    • expiry_date (string, optional) - Expiry date

Returns: boolean - Success status

Example:


RevokeLicense

Revokes a player's license.

Parameters:

  • identifier (string) - Player identifier

  • licenseType (string) - License type to revoke

Returns: boolean - Success status

Example:


SuspendLicense

Suspends a player's license.

Parameters:

  • identifier (string) - Player identifier

  • licenseType (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 data

    • identifier (string) - Player identifier

    • amount (number) - Fine amount

    • reason (string) - Reason for fine

    • issued_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 data

    • identifier (string) - Player identifier

    • warrant_type (string) - Warrant type ('arrest' or 'search')

    • reason (string) - Reason for warrant

    • issued_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 data

    • identifier (string) - Player identifier

    • crime_type (string) - Type of crime

    • description (string, optional) - Crime description

    • officer (string, optional) - Arresting officer

    • sentence (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 data

    • case_number (string) - Unique case number

    • title (string) - Case title

    • plaintiff_id (string, optional) - Plaintiff identifier

    • defendant_id (string, optional) - Defendant identifier

    • description (string, optional) - Case description

    • filed_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 ID

  • status (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 data

    • citizen_id (string) - Citizen identifier

    • attorney_id (string, optional) - Attorney identifier

    • appointment_type (string) - Type of appointment

    • appointment_date (string, optional) - Date and time

    • notes (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 identifier

  • time (number) - Jail time in seconds

  • reason (string, optional) - Reason for jailing

  • jailedBy (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 data

    • document_type (string) - Type of document

    • title (string) - Document title

    • content (string, optional) - Document content

    • issued_by (string, optional) - Who issued the document

    • recipient_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 data

    • business_name (string) - Business name

    • business_type (string, optional) - Type of business

    • owner_id (string) - Owner identifier

    • tax_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 identifier

  • examType (string) - Exam type

Returns: boolean - Whether player passed

Example:


RecordExamResult

Records an exam result.

Parameters:

  • identifier (string) - Player identifier

  • examType (string) - Exam type

  • score (number) - Score percentage

  • passed (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 data

    • taxpayer_id (string) - Taxpayer identifier

    • tax_year (number, optional) - Tax year

    • tax_type (string, optional) - Type of tax

    • amount (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 identifier

  • electionId (number) - Election ID

Returns: boolean - Whether player has voted

Example:

Last updated