# Installation

***

### Configuration

In `public/shared/config.lua`:

```lua
Shift = {
    item = {
        name = 'hotdog_cart',
        removeOnStart = true,
        returnOnEnd = true,
    },
},
```

| Option          | Type      | Description                                                           |
| --------------- | --------- | --------------------------------------------------------------------- |
| `name`          | `string`  | Item name in your inventory. Must match the entry you add below.      |
| `removeOnStart` | `boolean` | Remove one item when the cart is successfully placed. Default `true`. |
| `returnOnEnd`   | `boolean` | Give one item back when the shift ends. Default `true`.               |

Set `removeOnStart` or `returnOnEnd` to `false` to turn that behavior off.

If you change `name`, update your inventory item definition to use the same name.

***

### ox\_inventory

Add this to `ox_inventory/data/items.lua` (or your merged items file):

```lua
['hotdog_cart'] = {
    label = 'Hotdog Cart',
    weight = 5000,
    stack = false,
    close = true,
    description = 'Portable hotdog cart - use to start a shift',
},
```

* `stack = false` is recommended so each cart is a separate item.
* `close = true` closes the inventory when used.

No extra `client.export` or usable hook is required. The resource registers the item on start through `Bridge.Inventory.registerUsableItem`.

***

### QBCore (qb-inventory / ps-inventory)

Add this to `qb-core/shared/items.lua`:

```lua
hotdog_cart = {
    name = 'hotdog_cart',
    label = 'Hotdog Cart',
    weight = 5000,
    type = 'item',
    image = 'hotdog_cart.png',
    unique = true,
    useable = true,
    shouldClose = true,
    combinable = nil,
    description = 'Portable hotdog cart - use to start a shift',
},
```

***

### ESX

Register the item in your ESX items table or items resource using the same name as `Shift.item.name` (default `hotdog_cart`). The bridge calls `ESX.RegisterUsableItem` when ESX inventory is active.

Match `name` in config to your ESX item name.

***

### Flow

1. Player uses the item in inventory.
2. Client opens cart **placement** (same as export `startHotdog`).
3. When placement succeeds and the cart is registered on the server, one item is removed if `removeOnStart` is `true`.
4. When the shift ends, one item is returned if `returnOnEnd` is `true` and the player can carry it.

If placement is cancelled, the item is not removed.

If the player disconnects while the item was consumed, the script attempts to return it on drop.

***

### Shifts without the item

Shifts do **not** require the inventory item when started another way:

* Client export `startHotdog`
* Server export `startHotdog`
* Configured keybinds in `public/shared/config.lua` (`Keybinds`)

In those cases `removeOnStart` / `returnOnEnd` do not run because the item was never used.

***


---

# 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.axiam.shop/axiam_hotdogcart/installation.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.
