> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fzd-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Contextual menus

> Open one-off menus for shops, vehicles and other interactions.

A contextual menu belongs to one interaction and does not modify the player's normal action registry.

```lua theme={null}
local function openCheckout(registerId)
    if GetResourceState('fzd_actionwheel') ~= 'started' then return end

    local ok, reason = exports.fzd_actionwheel:open({
        {
            id = 'my_shop:pay',
            label = 'Pay for items',
            icon = 'cash-register',
            serverEvent = 'my_shop:requestPayment',
            payload = { registerId = registerId }
        },
        {
            id = 'my_shop:return',
            label = 'Put items back',
            icon = 'basket-shopping',
            clientEvent = 'my_shop:returnItems',
            payload = { registerId = registerId }
        }
    }, {
        title = 'SHOP',
        position = { x = 70, y = 50 }
    })

    if not ok then
        print(('[my_shop] Wheel failed: %s'):format(tostring(reason)))
    end
end
```

Call `openCheckout(theRegisterId)` from your existing target, proximity or interaction handler. FzD Action Wheel does not create interaction zones itself.

## Open options

| Option     | Description                         |
| ---------- | ----------------------------------- |
| `title`    | Centre text, maximum 32 bytes       |
| `position` | `{ x, y }` wheel-centre percentages |

## Closing a contextual menu

```lua theme={null}
if exports.fzd_actionwheel:isOpen() then
    exports.fzd_actionwheel:close()
end
```

<Warning>
  There is only one visible wheel per client. `close()` does not track which resource opened the current menu, so avoid delayed unconditional closes that could close a newer menu.
</Warning>

## Security

Payloads and visibility checks are client-controlled. A real server event must independently validate price, money, items, permissions, distance and transaction state.
