# Evidence

![](https://dunb17ur4ymx4.cloudfront.net/packages/images/92a3463c3f9ba1baa608af6dc68030006b560f6a.png)

[Trailer](https://youtu.be/4PfvoikLx74)

\
[Showcase](https://youtu.be/RvYVP8YPJrg)

\
[BUY HERE](https://d-labs.tebex.io/package/6628541)

### General benefits and script support

* [Modification of script functions](https://d-labs-scripts.gitbook.io/docs/advantages/open-server-client-function)
* [Simple translation](https://d-labs-scripts.gitbook.io/docs/advantages/translations)

### Dependencies & Installation

* Insert icons and items into your invatars which you can find in d\_labs\_evidence\items
* Put the script in the server and add `ensure "script_name"` to server.cfg
* enjoy...

{% hint style="info" %}
**Edit Functions** means that the script can be integrated with any of yours, using [this](https://d-labs-scripts.gitbook.io/docs/advantages/open-server-client-function)
{% endhint %}

## Framework

|                                             Resource                                            |   Status  |
| :---------------------------------------------------------------------------------------------: | :-------: |
|                                            qbx\_core                                            | Supported |
|                                               ESX                                               | Supported |
|                                             QB-Core                                             | Supported |
|                                             OX-Core                                             | Supported |
| [Edit Functions](https://d-labs-scripts.gitbook.io/docs/advantages/open-server-client-function) |    YES    |

## Inventory

|                                             Resource                                            |   Status  |
| :---------------------------------------------------------------------------------------------: | :-------: |
|                                          ox\_inventory                                          | Supported |
|                                           qb-inventory                                          | Supported |
|                                           lj-inventory                                          | Supported |
|                                           ps-inventory                                          | Supported |
|                                           qs-inventory                                          | Supported |
|                                         tgiann-inventory                                        | Supported |
|                                         codem-inventory                                         | Supported |
| [Edit Functions](https://d-labs-scripts.gitbook.io/docs/advantages/open-server-client-function) |    YES    |

## Notify / ProgressBar etc.

|                                             Resource                                            |   Status  |
| :---------------------------------------------------------------------------------------------: | :-------: |
|                                             ox\_lib                                             | Supported |
|                                      based on the framework                                     | Supported |
| [Edit Functions](https://d-labs-scripts.gitbook.io/docs/advantages/open-server-client-function) |    YES    |

## Target

|                                             Resource                                            |   Status  |
| :---------------------------------------------------------------------------------------------: | :-------: |
|                                            ox\_target                                           | Supported |
|                                            qb-target                                            | Supported |
|                                         basic gta input                                         | Supported |
| [Edit Functions](https://d-labs-scripts.gitbook.io/docs/advantages/open-server-client-function) |    YES    |

## Screenshot

|     Resource     |  Status |
| :--------------: | :-----: |
| screenshot-basic | Optimal |

## Exports

### Open Evidence

```js
exports["d_labs_evidence"]:openEvidenceByID(idEvidence, fullUI)
```

```js
exports["d_labs_evidence"]:openEvidenceByID(source, idEvidence, fullUI)
```

**Parameters:**

* **source** (number, optional)
  * If calling from the server, add the `source` value first, followed by the remaining parameters as usual.
* **idEvidence** (number)
  * The ID of the specific evidence.
* **fullUI** (boolean)
  * `true` to display the full tablet UI, `false` to show only the specific evidence.

***

### Open Tablet

```js
exports["d_labs_evidence"]:openTablet(tablet)
```

```js
exports["d_labs_evidence"]:openTablet(source, tablet)
```

**Parameters:**

* **source** (number, optional)
  * If calling from the server, add the `source` value first, followed by the remaining parameters as usual.
* **tablet** (boolean)
  * `true` enables tablet mode, allowing Forensics and photo capture; `false` disables it.

***

### Open UI

```js
exports["d_labs_evidence"]:openTablet(tablet)
```

```js
exports["d_labs_evidence"]:openTablet(source, tablet)
```

**Parameters:**

* **source** (number, optional)
  * If calling from the server, add the `source` value first, followed by the remaining parameters as usual.
* **tablet** (boolean)
  * `true` enables tablet mode, allowing Forensics and photo capture; `false` disables it.

***

### Cancel Bleeding from Ped

```js
exports["d_labs_evidence"]:cancelDropBlood()
```

```js
exports["d_labs_evidence"]:cancelDropBlood(source)
```

**Parameters:**

* **source** (number, optional)
  * If calling from the server, add the `source` value first, followed by the remaining parameters as usual.
* This function can be used to interfere with the custom bloodletting logic.

***

### Repairing Vehicle (Removing Bullets)

```js
exports["d_labs_evidence"]:fixCar(netId)
```

**Parameters:**

* **netId** (number)
  * The `netId` of the vehicle entity.

This function can be called from both the client and server in the same way, as it does not rely on `source`.

<details>

<summary>Example Usage</summary>

```js
RegisterCommand("fixcar", function()
{
    local ped = PlayerPedId()
    if IsPedInAnyVehicle(ped, false) then
        local vehicle = GetVehiclePedIsIn(ped, false)
        local netId = NetworkGetNetworkIdFromEntity(vehicle)
        exports["d_labs_evidence"]:fixCar(netId)

        print('Vehicle repaired after gunshots')
    else
        print("You are not in the vehicle!")
    end
end)
```

</details>

***

### **Creating Custom Evidence at Specific Coordinates**

```js
exports["d_labs_evidence"]:addEvidenceToCoords(class, coords, classType, label, weaponHash, weaponSerial)
```

```js
exports["d_labs_evidence"]:addEvidenceToCoords(source, class, coords, classType, label, weaponHash, weaponSerial)
```

**Parameters:**

* **source** (number, optional)
  * If calling from the server, add the `source` value first, followed by the remaining parameters as usual.
* **class** (string)
  * Specifies the type of evidence:
    * `"Projectile"`
    * `"Cartridge"`
    * `"Blood"`
    * `"Fingerprints"`
    * `"Fragments"`
* **classType** (string)
  * A subcategory related to `class`, defined in `Config.Templates`.
* **label** (string)
  * The label of the evidence, which will be displayed in the menu.
* **weaponHash** (string)
  * The weapon hash used for game evaluation.
* **weaponSerial** (string)
  * The serial number of the weapon.

***

### **Adding a person record of DNA testing or fingerprinting**

```js
exports["d_labs_evidence"]:addPersonRecordBySrc(source, finger, dna, ofc)
```

```js
exports["d_labs_evidence"]:addPersonRecordBySrc(source, finger, dna, ofc)
```

**Parameters:**

* **source** (number, optional)
  * If calling from the server, add the `source` value first, followed by the remaining parameters as usual.
* **finger** (boolean)
  * whether you want to add a record of the fingerprint taken
  * true / false
* **dna** (boolean)
  * whether you want to add a record of the dna taken
  * true / false
* **ofc** (string)&#x20;
  * The name or description of the office that will be listed for the subscription can be left as nil.

***

## Custom NUI icon

#### PNG

* You can upload the icon to the script in this way
  * `d_labs_evidence\html\image`
  * icon must be .png
* in config.lua edit the icon name according to the file
  * `icon = 'projectile.png'`

#### fas icon

* just pick an icon here <https://fontawesome.com/icons>
  * `icon = 'fa-solid fa-droplet'`

## MDT integrations

{% tabs %}
{% tab title="Redutzu" %}

* Go this way `redutzu-mdt/server/custom/evidence`
  * find the `custom.lua` file
* Paste this code:

{% code title="custom.lua" %}

```lua
Config.Evidence ~= 'd_labs_evidence' then
     return
end

function SearchArchiveEvidence(query)
    local results = MySQL.Sync.fetchAll('SELECT id FROM d_labs_evidence WHERE id LIKE ?', { '%' .. query .. '%' })
    return results
end

RegisterNetEvent('redutzu-mdt:server:openArchiveEvidence', function(id)
    exports["d_labs_evidence"]:openEvidenceByID(source,id,false)
end)    
```

{% endcode %}

* edit the `redutzu-mdt/config` file
  * find the `config.lua` file
  * overwrite the Config.Evidence entry in it as follows:

```lua
Config.Evidence = 'd_labs_evidence'
```

* Restart the script and enjoy
  {% endtab %}

{% tab title="Soon..." %}
Soon...
{% endtab %}
{% endtabs %}

***
