> For the complete documentation index, see [llms.txt](https://docs.redutzu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redutzu.com/resources/redutzu-mdt/exports-events/server-exports/evidences.md).

# Evidences

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

***

## Type

```typescript
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

<pre class="language-lua"><code class="lang-lua"><strong>-- It returns the incident data
</strong><strong>exports['redutzu-mdt']:SearchEvidence(id)
</strong></code></pre>

```lua
local evidence = exports['redutzu-mdt']:SearchEvidence(1)
print(evidence.name)
```

### Create new evidence

```lua
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

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

```lua
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

```lua
-- It returns a boolean (if it was successfully deleted)
exports['redutzu-mdt']:DeleteEvidence(id: number) // boolean
```

```lua
local success = exports['redutzu-mdt']:DeleteEvidence(1)

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

print('Evidence deleted')
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.redutzu.com/resources/redutzu-mdt/exports-events/server-exports/evidences.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
