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

# Installation

> Step by step instructions to install the Burner Phone resource

## Installation Steps

<Steps>
  <Step title="Install dependencies">
    <Warning>
      Verify all dependencies below are started **before** this script in your `server.cfg`.
    </Warning>

    <Card title="ox_lib" icon="book" href="https://github.com/CommunityOx/ox_lib/releases/latest">
      Download ox\_lib
    </Card>
  </Step>

  <Step title="Extract and place the resource">
    Extract the script from the zip file and place it into your standalone folder or a folder that starts before your scripts.
  </Step>

  <Step title="Add items to your inventory (Optional)">
    Add the items from below and the images from the `images` folder to your inventory. This is optional if you want to use the contacts history feature.

    <Tabs>
      <Tab title="ox_inventory">
        ```lua theme={null}
        ["x_burner"] = {
            label = "Burner Phone",
            weight = 100,
            stack = false,
            close = false,
            description = "Nothing suspicious about this phone..",
        }
        ```
      </Tab>

      <Tab title="qb-inventory">
        ```lua theme={null}
        ["x_burner"] = {["name"] = "x_burner", ["label"] = "Burner Phone", ["weight"] = 100, ["type"] = "item", ["image"] = "x_burner.png", ["unique"] = true, ["useable"] = false, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "To receive anonymous calls"},
        ```
      </Tab>
    </Tabs>

    <Info>
      The image is provided in the folder that you downloaded.
    </Info>
  </Step>

  <Step title="Configure the resource">
    Open `config.lua` and adjust the settings to your liking. See the configuration section below for details.
  </Step>

  <Step title="Add to server.cfg">
    Make sure that the Framework, ox\_lib, and Inventory are started before the script.

    ```cfg theme={null}
    ensure ox_lib
    ensure projectx-burner
    ```
  </Step>
</Steps>

## Configuration

Below is the full configuration file with explanations for each option.

```lua theme={null}
Config = Config or {}

Config = {
    Position = 'right',
    Duration = 10,
    DurationBasedOnLength = false,
    EnableProfilePics = true,

    ContactsHistory = {
        EnableItem = true,
        NoContactsNotification = "You don't have any active contacts",
        Duration = 15
    }
}
```

### General Settings

<ParamField path="Position" type="string" default="right">
  The position of the phone on the screen. Options: `"left"` or `"right"`
</ParamField>

<ParamField path="Duration" type="number" default="10">
  Duration in seconds that the phone will stay on screen after receiving a message
</ParamField>

<ParamField path="DurationBasedOnLength" type="boolean" default="false">
  If enabled, the duration will be calculated based on the length of the message instead of using the fixed `Duration` value
</ParamField>

<ParamField path="EnableProfilePics" type="boolean" default="true">
  Enable or disable the profile picture displayed above the sender name
</ParamField>

### Contacts History Settings

<ParamField path="ContactsHistory.EnableItem" type="boolean" default="true">
  Enable the burner phone item for viewing contact history. If enabled, you need a supported framework (QBX, QB, ESX) or implement your own logic in `server.lua`. Don't forget to add the item to your inventory!
</ParamField>

<ParamField path="ContactsHistory.NoContactsNotification" type="string" default="You don't have any active contacts">
  The notification message shown when the player has no active contacts (no messages received)
</ParamField>

<ParamField path="ContactsHistory.Duration" type="number" default="15">
  Duration in seconds that the contact history UI will stay open after selecting a contact
</ParamField>
