> For the complete documentation index, see [llms.txt](https://aero-labs.gitbook.io/aero-labs-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aero-labs.gitbook.io/aero-labs-docs/scripts/atintman.md).

# ATintman

Let police measure a vehicle's window tint with a close-up camera and progress bar.

![ATintman](https://3178353394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm2Hc1pmEtJtEBI0blIeE%2Fuploads%2FjTTE7UeOwIgNkHAJvEYu%2FATintman.png?alt=media)

A window tint meter for police roleplay. The officer walks up to a vehicle and runs a check, the camera zooms to the nearest window, and after a short progress bar they get the percentage of light that passes through the glass.

## Requirements

| Dependency                                        | Required | Notes                          |
| ------------------------------------------------- | -------- | ------------------------------ |
| [ox\_lib](https://github.com/overextended/ox_lib) | Yes      | Progress bar and notifications |
| QBCore / QBox / TMC                               | Optional | Job / on-duty check            |
| ox\_inventory / TMC                               | Optional | Required-item check            |

ATintman is **client-side only**. There is no server file.

## Installation

1. Drag the `ATintman` folder into your `resources` folder.
2. Add it to your `server.cfg` after ox\_lib:

   ```cfg
   ensure ox_lib
   ensure ATintman
   ```
3. Set your framework, job and required item in `config.lua`.

## Configuration

```lua
Config.Debug = true

Config.Framework = "Standalone" -- "Standalone", "QBCore", "QBox", "TMC"
Config.Inventory = "ox"         -- "ox", "tmc"

Config.Tint = {
    job = "police",
    itemRequired = {
        enabled = true,
        item = "phone",
        notification = "You need a tint checker to check window tint",
    },
}

Config.Command = {
    enabled = true,
    command = "checktint",
}
```

| Option                      | Description                                                                                                                      |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Tint.job`           | Job that may check tint. Players must be **on duty** (QBCore / QBox / TMC). Ignored in Standalone.                               |
| `Config.Tint.itemRequired`  | Require an item to use the meter. Change `item` to your tint meter item, such as `tintmeter`. Checked with ox\_inventory or TMC. |
| `Config.TintPercentages`    | Maps GTA's tint index to the percentage shown. Edit it to match your server's tint rules.                                        |
| `Config.Titles.progressBar` | Progress bar label, duration (ms) and result text.                                                                               |
| `Config.Command`            | Registers `/checktint`.                                                                                                          |
| `Config.Debug`              | Prints debug output. Set to `false` on a live server.                                                                            |

## Usage

1. Stand next to the vehicle, within **5 metres**, ideally beside a window.
2. Type `/checktint`.
3. The camera zooms to the closest window and a *"Checking tint percentage"* bar runs for 5 seconds. Don't move.
4. You get a notification such as *"Tint Percentage is: 20%"*.
5. Press **Backspace** to return to the normal camera.

## Using it as an item

ATintman doesn't register a usable item itself. To open it from an item, radial menu or target option, trigger the client event:

```lua
-- client side
TriggerEvent("MDXTintman:Client:CheckWindowTint")

-- or from a server-side usable item
TriggerClientEvent("MDXTintman:Client:CheckWindowTint", source)
```
