Server

This page lists all the available server-side events and exports.

Events (General)

SetBodyCamState

  • Registers a server-side event to manually control a player's bodycam state, typically used in scenarios such as temporary permission overrides or anti-cheat bypasses.

chevron-rightrcore_police:server:SetBodyCamStatehashtag
  • Params:

    Name
    Type
    Description

    playerId

    number

    Target playerId which you want to set permission

    state

    boolean

    Used for listening for player state.

  • Example:

AddEventHandler('rcore_police:server:SetBodyCamState', function(playerId, state)
    -- REGISTER PLAYER TEMP PERMISSION
end)

Exports (Listeners)

onGroups

  • Used for listening for any onGroups actions

chevron-rightonGroupshashtag
  • Params:

    Name
    Type
    Description

    listenerName

    string

    Name of the listener to register for onGroups events

  • Returns:

    • string: Type - current action/task being done

    • table: The data of player in that group

  • Example:

-- return: type: string, data: table
exports["rcore_police"]:registerListener("onGroups", function(type, data)
    print("Received 'onGroups' event:")
    print("Type:", type)
    print("Data:", json.encode(data))
end)

onState

  • Used for listening for any interaction actions on players

chevron-rightonStatehashtag
  • Params:

    Name
    Type
    Description

    listenerName

    string

    Name of the listener to register for onState events

  • Returns:

    • type: Current type (string)

    • action: Current action (string)

    • playerId: Performed state change on playerId (number)

  • Example:

Exports (States)

IsPlayerCuffed

  • Used for checking if player is cuffed

chevron-rightIsPlayerCuffedhashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which you want to get state of cuffed

  • Returns:

    • boolean: true if player is cuffed, otherwise false.

  • Example:

IsPlayerEscorted

  • Used for checking if player is escorted

chevron-rightIsPlayerEscortedhashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which you want to get state of escort

  • Returns:

    • boolean: true if player is escorted, otherwise false.

  • Example:

IsPlayerHeadBagged

  • Used for checking if player is head bagged

chevron-rightIsPlayerHeadBaggedhashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which you want to get state of head bag

  • Returns:

    • boolean: true if player is head bagged, otherwise false.

  • Example:

Exports (Actions)

JailPlayer

  • Used for jailing player, it will open Dialog form to put specific player in jail

chevron-rightJailPlayerhashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which is starting the interaction

    target

    number

    ID of player which you want to get jailed

  • Returns:

    • boolean: true if player is jailed, otherwise false.

    • string: Status code or error message

  • Example:

SearchPlayer

  • Used for searching player, it will try to open search of target player inventory

chevron-rightSearchPlayerhashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which is starting the interaction

    target

    number

    ID of player which you want to search inventory

  • Returns:

    • boolean: true if player is searched, otherwise false.

    • string: Status code or error message

  • Example:

Escort

  • Used for setting/unsetting escort to target player

chevron-rightEscorthashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which is starting the interaction

    target

    number

    ID of player which you want to get escorted

  • Returns:

    • boolean: true if player is escorted, otherwise false.

    • string: Status code or error message

  • Example:

Zipties

  • Used for setting/unsetting Zipties to target player

chevron-rightZiptieshashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which is starting the interaction

    target

    number

    ID of player which you want to set zipties

  • Returns:

    • boolean: true if player is ziptied, otherwise false.

    • string: Status code or error message

  • Example:

Handcuff

  • Used for setting/unsetting Handcuff to target player

chevron-rightHandcuffhashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which is starting the interaction

    target

    number

    ID of player which you want to set handcuffs

  • Returns:

    • boolean: true if player is handcuffs, otherwise false.

    • string: Status code or error message

  • Example:

PutPlayerInVehicle

  • Used for PutPlayerInVehicle target player into nearby vehicle seat

chevron-rightPutPlayerInVehiclehashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which is starting the interaction

    target

    number

    ID of player which you want to set into vehicle

  • Returns:

    • boolean: true if player is set into vehicle, otherwise false.

    • string: Status code or error message

  • Example:

TakePlayerFromVehicle

  • Used for TakePlayerFromVehicle target player from nearby vehicle

chevron-rightTakePlayerFromVehiclehashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which is starting the interaction

    target

    number

    ID of player which you want to get from vehicle

  • Returns:

    • boolean: true if player is outside of vehicle, otherwise false.

    • string: Status code or error message

  • Example:

RemoveHandcuff

  • Used for removing handcuffs/zipties from target player

chevron-rightRemoveHandcuffhashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    playerId

    number

    ID of player which is starting the interaction

    target

    number

    ID of player which you want to remove handcuffs/zipties

  • Returns:

    • boolean: true if player handcuffs/zipties are removed, otherwise false.

    • string: Status code or error message

  • Example:

ForceUncuff

  • Used for removing zipties/cuffs

chevron-rightForceUncuffhashtag
  • Type: boolean

  • Default value:: false

  • Params:

    Name
    Type
    Description

    target

    number

    ID of player which you want to remove handcuffs/zipties

  • Returns:

    • boolean: true if player handcuffs/zipties are removed, otherwise false.

    • string: Status code or error message

  • Example:

Exports (General)

GetPoliceOnline

  • Used for getting all police officers online

chevron-rightGetPoliceOnlinehashtag
  • Type: number

  • Default value:: 0

  • Returns:

    • number: Number of officers online, by default returns 0 when not any online

  • Example:

CreateInvoiceByServer

⚠️ Warning: This export is not a replacement for your invoice system. It is a hook over the rcore_police invoice system when using the standalone bridge or a supported invoice system.

ℹ️ Configuration: The distribution of invoice payments depends on the InvoiceSystem.WhenInvoiceSentBalanceToAllDepartmentJobs setting in your config:

  • true: The invoice amount will be split equally among all department society accounts

  • false: Only the issuing job's society account receives the money

  • Used for creating an invoice for a player directly from the server-side (e.g., for automated billing systems, admin commands, or integration with other resources)

chevron-rightCreateInvoiceByServerhashtag
  • Params:

    Name
    Type
    Description

    targetId

    number

    Player ID of the user who should receive the invoice

    amount

    number

    The amount the player should pay

    metadata

    table

    Additional data containing job and reason

  • Metadata Table:

    Name
    Type
    Description

    job

    string?

    The job/department issuing the invoice (e.g., "police", "taxi"). Must be a valid department group defined in your configuration with an existing society account. If not provided, all department groups are used or defaults to "police"

    reason

    string

    The reason for the invoice

  • Returns:

    • boolean: true if the invoice was created successfully, otherwise false

  • Example:

Last updated