Citizens

Here, you'll find key exports for managing citizens. These exports allow you to register and update citizens as needed.


Type

type Citizen = {
    identifier: string,
    firstname: string,
    lastname: string,
    gender: string,
    image?: string,
    notes?: string,
    birthdate: string,
    job: string,
    job_grade: string,
    vehicles: string[],
    images: {
        id: number,
        value: string,
        description: string
    }[],
    incidents: {
        id: number,
        createdAt: string
    }[],
    evidences: {
        id: number,
        createdAt: string
    }[],
    warrants: {
        id: number,
        createdAt: string
    }[],
    bolos: {
        id: number,
        createdAt: string
    }[],
    weapons: {
        serial: string,
        label: string
    }[]
}

Exports

The exports can contain data from the type field.

SearchCitizen

exports['redutzu-mdt']:SearchCitizen(identifier: string) // CitizenType | null

RegisterCitizen

exports['redutzu-mdt']:RegisterCitizen({
  identifier = 'license:1234',
  firstname = 'Firstname',
  lastname = 'Lastname',
  gender = 'm',
  birthdate = '10/05/2000',
  job = { name = 'police', label = 'Law Enforcement', grade = 'Chief' },
  fingerprint = 'abc123',
  notes = 'Citizen notes',
  image = 'https://yourwebsite.com/'
}) -- boolean

UpdateCitizen

-- It returns a boolean (if it was successfully updated)
exports['redutzu-mdt']:UpdateCitizen(identifier, {
  notes = 'New notes',
  incidents = { 1, 7, 10 }
}) -- boolean
local success = exports['redutzu-mdt']:UpdateCitizen('license:1234', {
    image = 'https://i.pinimg.com/736x/98/1d/6b/981d6b2e0ccb5e968a0618c8d47671da.jpg',
    vehicles = { 'XYZ987' }
})

if not success then
    print('There was an error updating the citizen')
    return
end

print('Citizen updated')

Last updated