Evidences

Here, you'll find key exports for managing evidences. These exports allow you to create, update, and delete evidences as needed.


Type

type Evidence = {
    id: number,
    name: string,
    description: string,
    vehicles?: string[],
    archive?: number[],
    weapons?: {
        serial: string,
        label: string
    }[],
    images: {
        id: number,
        value: string,
        description: string
    }[],
    players: {
        identifier: string,
        name: string
    }[],
    cops: {
        identifier: string,
        name: string
    }[],
    createdAt: string
}

Exports

Search for evidence

-- It returns the incident data
exports['redutzu-mdt']:SearchEvidence(id)
local evidence = exports['redutzu-mdt']:SearchEvidence(1)
print(evidence.name)

Create new evidence

exports['redutzu-mdt']:CreateEvidence({
  name = 'Evidence name',
  description = 'Evidence description',
  players = { 'license:1234' },  -- array of identifiers/citizenids
  cops = { 'license:1234', 'license:4321' }, -- array of identifiers/citizenids
  vehicles = { 'ABC123' }, -- array of plate numbers
  weapons = { 'serialNumber' }, -- array of serial numbers
  images = { 1, 8 } -- array of gallery image ids
}) -- number (id)

Update evidence

-- It returns a boolean (if it was successfully updated)
exports['redutzu-mdt']:UpdateEvidence(id, {
  name = 'New evidence name',
  players = { 'license:4321' }
}) -- boolean
local success = exports['redutzu-mdt']:UpdateEvidence(1, {
    name = 'Evidence Example',
    players = { 'license:4321' }
})

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

print('Evidence updated')

Delete evidence

-- It returns a boolean (if it was successfully deleted)
exports['redutzu-mdt']:DeleteEvidence(id: number) // boolean
local success = exports['redutzu-mdt']:DeleteEvidence(1)

if not success then
    print('There was an error deleting the evidence')
    return
end

print('Evidence deleted')

Last updated