# Gw Multi Job Install

Welcome to the installation guide for the **GW Multijob** script. This script is designed to link Discord roles to in-game jobs automatically, providing a seamless multi-job management experience for your players.

***

## 🛠️ Dependencies

Ensure the following resources are installed and running correctly on your server:

* **vorp\_core**
* **vorp\_character**
* **oxmysql**

***

## 📥 Installation Steps

{% stepper %}
{% step %}

### Place the Resource

* Extract the folder and place it in your `resources` directory.
* **CRITICAL:** The folder name MUST be `gw_multijob` for the script to function correctly due to built-in protection.
  {% endstep %}

{% step %}

### Discord Bot Setup

The script requires a Discord bot to fetch player roles. Follow these steps:

1. Open [server\_config.lua](broken://pages/2c9193aa64a815beebf38f92764d1f25d7f4bf14).
2. Paste your bot's token into `ServerConfig.DiscordBot.BotToken`.
3. Paste your Discord Server ID into `ServerConfig.DiscordBot.GuildId`.
4. **Important:** Enable the `Server Members Intent` in your bot's settings on the [Discord Developer Portal](https://discord.com/developers/applications).
   {% endstep %}

{% step %}

### Job Mapping

1. Open [config.lua](broken://pages/e99fbcf27eb84d426ee6517957d16e3b7baa3ba3).
2. Locate the `Config.DiscordRoleToJob` table.
3. Add your Discord **Role IDs** and map them to the corresponding in-game job and grade:

{% code title="config.lua" %}

```lua
["123456789012345678"] = {job = "police", grade = 2}, -- Example: Deputy Sheriff
```

{% endcode %}
{% endstep %}

{% step %}

### Server Activation

* Add the following line to your `server.cfg`:

{% code title="server.cfg" %}

```cfg
ensure gw_multijob
```

{% endcode %}
{% endstep %}
{% endstepper %}

***

## ⚙️ Configuration

### [config.lua](broken://pages/e99fbcf27eb84d426ee6517957d16e3b7baa3ba3)

* **Config.Command**: The command used to open the menu (Default: `/job`).
* **Config.UI**: Customize colors, titles, and fonts to match your server's branding.

### [server\_config.lua](broken://pages/2c9193aa64a815beebf38f92764d1f25d7f4bf14)

* Contains sensitive bot credentials. **Never share this file** as it contains your private token.

***

## 🎮 How to Use

1. Ensure you have the required role assigned to you on Discord.
2. In-game, type the command `/job` (or your custom command).
3. The menu will display all jobs available to you based on your Discord roles.
4. Select a job to switch instantly. Your job and grade will be updated in the database.

***

## 🆘 Troubleshooting (FAQ)

<details>

<summary>Q: The menu won't open. What's wrong?</summary>

* Verify the folder name is exactly `gw_multijob`.
* Check if your Discord ID is correctly linked to your game identifier.

</details>

<details>

<summary>Q: I don't see all my jobs?</summary>

* Ensure the Role IDs in [config.lua](broken://pages/e99fbcf27eb84d426ee6517957d16e3b7baa3ba3) match your Discord roles perfectly.
* Make sure the bot is present in your Discord server and has the necessary permissions.

</details>

***

{% hint style="info" %}
To achieve a premium look, use coordinated HEX color codes in the UI settings inside [config.lua](broken://pages/e99fbcf27eb84d426ee6517957d16e3b7baa3ba3).
{% endhint %}


---

# 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://gw-studio-1.gitbook.io/installation/gw-multi-job-install.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.
