Server Exports

Here you will find the list of usable exports for Police MDT, you can use them if you have basic or advanced programming knowledge, we do not recommend using these if you do not have such knowledge.

RegisterWeapon

Use following export to add weapon to registry.

exports['piotreq_gpt']:RegisterWeapon(data)
  • data: table

    • model: string | weapon model name

    • owner: string | player identifier / citizenid

    • serial: string | random serial numbers


GetDangerCode

Use following export to get current danger code.

exports['piotreq_gpt']:GetDangerCode(getLabel)
  • getLabel?: boolean

    • Should return label of code?

Return:

  • code: string


onCodeChange

Use this event handler to follow code change.

RegisterNetEvent('piotreq_gpt:onCodeChange', function(playerId, data)
    -- do something
end)
  • playerId: number

    • Player id who change danger code

  • data: table

    • code: string | current code name

    • label: string | current code label

    • color: string | current code hex color


getLicenses

Get police licenses from config.

exports['piotreq_gpt']:getLicenses()

Return:

  • object: { [licenseType]: licenseData }

    • licenseType: string

    • licenseData: table[label: string, access: { [jobName]: jobGrade }]


CheckPlayerLicense

Use following export to check if player has some police license.

exports['piotreq_gpt']:CheckPlayerLicense(playerId, licenseName)
  • playerId: number

    • Existing player server id to check

  • licenseName: string

    • Police license name from config

Return:

  • state: boolean


GetPlayerLicenses

Use following export to get all player police licenses.

exports['piotreq_gpt']:GetPlayerLicenses(playerId)
  • playerId: number

    • Existing player server id to check

Return:

  • licenses: licenseData

licenseData

  • id: number

  • owner: string | player identifier

  • type: string | license name

  • label: string | license label

Last updated