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

# Player & EMS usage

> How players, EMS, and the hospital medic NPC interact with the system in-game.

How players, EMS, and the hospital medic NPC interact with the system in-game.

## Player — using a crutch item

1. Get a `crutch` item in your inventory (bought, given, prescribed).
2. Use the item to toggle the crutch on. Your walk style switches to the configured `clipSet` (`move_lester_CaneUp` by default).
3. Use the item again to put it away.

The crutch can be used `Config.TimeUsedBeforeDelete` times (default 5) before the item breaks and is removed from the inventory. Each use shows a "uses left" message.

### When the crutch refuses to come out

The script blocks crutch use in situations where it would look broken — each shows a chat message:

| Block        | Message                                              |
| ------------ | ---------------------------------------------------- |
| Ragdoll      | *You can't use a crutch while you are in ragdoll!*   |
| Falling      | *You can't use a crutch while you are falling!*      |
| In combat    | *You can't use a crutch while you are in combat!*    |
| Dead         | *You can't use a crutch while you are dead!*         |
| In a vehicle | *You can't use a crutch while you are in a vehicle!* |
| Weapon drawn | *You can't use a crutch while having a weapon out!*  |

Customise the strings in `locales/en.lua`.

## Player — picking the crutch back up

When you put the crutch down, it stays at your feet for a moment. Press the configured pickup key (default the FiveM "pickup" control) to put it back away. Walk away from it and it auto-cleans.

## EMS — prescribing a crutch

If your job is in `Config.AllowedJobs` and you carry a `crutch` item:

1. Look at a player within `Config.GiveDistance` (5m default) → **ox\_target** option **Give crutch**.
2. Confirm in the EMS menu (or `ox_lib` prompt if `Config.UI.EmsMenu = false`).
3. One crutch is taken from your inventory.
4. The patient is force-equipped for `Config.ForceDuration` seconds (10 minutes default).

While force-locked, the patient can't manually unequip the crutch. They get a HUD showing the time left if `Config.UI.PatientHUD = true`.

If `Config.ForceGiveItem = true`, the patient also gets a `crutch` item in their inventory — useful so they can keep limping after the force lock expires.

## EMS — removing a crutch

If your job is in `Config.AllowedJobs`:

1. Look at a player within `Config.RemoveDistance` (5m default) → **ox\_target** option **Remove crutch**.
2. The crutch is immediately unequipped and the force lock is cleared.

EMS removal **does not** charge the patient and **does not** require the medic NPC.

## Hospital medic NPC

The NPC spawns at any configured `MedicLocations` entry once the player walks within `Config.SpawnDistance` (60m default). A map blip shows wherever a location has `blip.enabled = true`.

Two interaction modes (set via `Config.Interaction`):

### `target` (default)

Requires `ox_target`. Walk up to the NPC → third-eye option **Remove Crutch**. The option only shows if you currently have a crutch equipped.

### `textui`

No `ox_target` needed. Walk within `Config.TextUI.distance` (2m default) of the NPC → `ox_lib` text prompt appears (`[E] Remove Crutch`). Press the configured key (default `E`, control id 38).

### The removal flow

```
You confirm at the NPC
  → medic dialog opens (or ox_lib progressBar if UI disabled)
  → "Pay $X" / "Remove Crutch"
    → server validates: price + has-crutch + near-medic + has-money
    → NPC plays the animation
    → progress bar runs for Config.Animation.duration
    → server charges money + clears the crutch
    → legacy hooks fire (wasabi_crutch, ak47_crutch — if running)
```

Every server step re-validates the player's state. Spoofing the NUI events on the client can't bypass any of the gates — money, proximity, and the crutch-equipped check are all re-checked server-side.

If `Config.ChargeMoney = false`, the same flow runs without the money check. If the player can't afford the removal, the dialog shows the `notEnoughMoney` notification and closes.

## Patient HUD

When the patient is force-locked, an anchored HUD shows the time remaining. Anchor with `Config.UI.HUDPosition`:

```
'top'         'top-left'      'top-right'
'right'                       'bottom-right'
'bottom'      'bottom-left'
'left'
```

Set `Config.UI.PatientHUD = false` to hide it entirely.
