# Events

## Client

### Open tuning menu

Can be used to open the tuning menu at a specific location

```lua
-- mechanicId: string         (The mechanic id from the config)
-- mechanicLabel: string      (The label which will show in the menu)
TriggerEvent("jg-mechanic:client:open-customisation-menu", mechanicId, mechanicLabel)
```

#### Example Usage

```lua
ReigsterCommand('openmechmenu', function() -- This creates a command called openmechmenu (maybe for admins?)
    TriggerEvent("jg-mechanic:client:open-customisation-menu", 'bennys', 'bennys') -- Trigger Actual event
end, true) -- Is it locked? (https://natives.avarian.dev/?native=0x5FA79B0F&game=gta5)
```

### Open tablet

Can be used to open the tablet

<pre class="language-lua"><code class="lang-lua"><strong>TriggerEvent("jg-mechanic:client:use-tablet")
</strong></code></pre>

#### Example usage

```lua
exports.ox_target:addBoxZone({
    coords = vector3(0.0, 0.0, 0.0), -- Vector of where you wanted the box zone
    size = vec3(1.0, 1.0, 2.0),
    rotation = 0,
    debug = false,
    options = {
        {
            label = "Use Tablet",
            icon = "fa-solid fa-tablet-screen-button",
            onSelect = function()
                TriggerEvent("jg-mechanic:client:use-tablet")
            end,
        }
    }
})
```

### Open admin menu

Can be used to open the admin menu

```lua
TriggerEvent("jg-mechanic:client:open-admin")
```

#### Example Usage

```lua
exports.ox_target:addBoxZone({
    coords = vector3(0.0, 0.0, 0.0), -- Vector of where you wanted the box zone
    size = vec3(1.0, 1.0, 2.0),
    rotation = 0,
    debug = false,
    options = {
        {
            label = "Open Admin",
            icon = "fa-solid fa-tablet-screen-button",
            onSelect = function()
                TriggerEvent("jg-mechanic:client:open-admin")
            end,
        }
    }
})
```

### Listeners

#### Listen to toggling of tablet being hidden

```lua
AddEventHandler("jg-mechanic:client:tablet-hidden-for-interaction", function()
end)
```

#### Example usage

```lua
AddEventHandler("jg-mechanic:client:tablet-hidden-for-interaction", function()
    -- Example: Print something random when tablet is hidden
    print('Scorpion is the best support member')
end)
```

#### Listen to toggling of tablet being shown

```lua
AddEventHandler("jg-mechanic:client:tablet-shown-after-interaction", function()
end)
```

```lua
AddEventHandler("jg-mechanic:client:tablet-shown-after-interaction", function()
    print('James is cool')
end)
```


---

# Agent Instructions: 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:

```
GET https://docs.jgscripts.com/mechanic/commands-events-and-exports/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
