> ## 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.

# Conditions and requirements

> Show, hide or disable actions based on current player state.

Built-in requirements combine with **AND**. Parent requirements also restrict descendants.

## Vehicle state

```lua theme={null}
inVehicle = true
```

* `true` — player must be inside any vehicle, including as a passenger.
* `false` — player must be on foot.

## Job and grade

```lua theme={null}
job = 'police',
jobGrade = 2
```

`job` is the exact, case-sensitive active job name. `jobGrade` is a minimum numeric grade and requires `job` on the same action.

## Items

Require one item:

```lua theme={null}
items = 'radio'
```

Require quantities of multiple items:

```lua theme={null}
items = {
    radio = 1,
    bandage = 2
}
```

These checks never consume items.

## Player metadata

```lua theme={null}
metadata = {
    isdead = false,
    licences = {
        weapon = true
    }
}
```

Metadata refers to framework **player metadata**, not metadata attached to an inventory item.

## Custom callback

```lua theme={null}
condition = function(context)
    return {
        visible = context.inVehicle,
        disabled = (context.items.repairkit or 0) < 1
    }
end
```

The context contains:

| Field       | Type                    |
| ----------- | ----------------------- |
| `job`       | string or nil           |
| `jobGrade`  | number or nil           |
| `inVehicle` | boolean                 |
| `items`     | item-name → count table |
| `metadata`  | player metadata table   |

Return promptly. Do not use `Wait`, promises, network/database calls, wheel open/close calls or gameplay side effects inside `condition`.

<Warning>
  Conditions improve the UI; they are not server authorization. Sensitive events still require server-side validation.
</Warning>
