> For the complete documentation index, see [llms.txt](https://swampys.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://swampys.gitbook.io/docs/resources/voting-system/installation.md).

# Installation

{% stepper %}
{% step %}

### Download and organize the files :

* Go to [Cfx.re Portal](https://portal.cfx.re/).
* Authenticate with your login details.
* In your [Granted Assets](https://portal.cfx.re/assets/created-assets), you’ll find the Complete Election & Campaign System V2.
* Download the script files via Cfx.re Portal.
* Drag\&Drop the `sVoting` folder into your `resources` folder.
  {% endstep %}

{% step %}

<figure><img src="https://3512431981-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmRjmSlXkF8gHNXcHd9ec%2Fuploads%2F9zcTawpafjFmhTRvO4KZ%2F2026-02-2223-29-09-ezgif.com-video-to-gif-converter.gif?alt=media&amp;token=d91d802f-c20d-4e34-bb34-e0ae241e05b5" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configuration Features :

The **Election Voting** script provides flexibility for configuring multiple aspects of the election system. Below are the key features you can adjust:

* **No-Escrowed files:**
  * ```lua
        'sVoting/shared/*.lua',
        'sVoting/client/nui.lua',
        'sVoting/install/*'
    ```

    <br>
* **Voting Settings:**
  * **Framework:** Switch between ESX or QBCore, or let the script auto-detect.
  * **Notification System:** Choose from ox\_lib, ESX, or Mythic for notifications.
  * **Interaction System:** Select from ox\_target, qb-target, or ESX interaction.<br>
* **Voting & Election Settings:**
  * **Framework:** Set to `'esx'`, `'qbcore'`, or `'auto'` for automatic detection based on your server's framework.
  * **Command Control:** Configure the command to control who can manage elections with the `CommandPrincipal` field (e.g., `'group.admin'`).
* **Cost and Registration:**
  * **Registration Fee:** Set the cost of registering a candidate using the `CandidateRegistrationFee` variable.
  * **Poster Cost:** Configure the cost of printing posters for candidates via `PosterCost`.
* **Voting Booth & Locations:**
  * Set the coordinates and labels for various locations such as the **Voting Booth**, **Registration Office**, and **Poster Printing** areas. Customize the model and position of props like the voting booth and printer.
* **Election Duration:**
  * Set the election duration in seconds (default is 7 days) with the `ElectionDuration` setting (use /elections start or end).
* **UI Settings:**
  * Adjust the number of posters a candidate can print with the `MaxPosterPerCandidate` setting.
  * Customize the theme of your UI (dark mode is default).
* **Database Settings:**
  * Customize table names for storing election data. By default, it uses tables like `svoting_elections`, `svoting_candidates`, `svoting_votes`, and `svoting_placements`.
* **Install and Configure ox\_lib**
* Download the latest version of `ox_lib` from the [official GitHub page](https://github.com/overextended/ox_lib).
* Extract the files to your `resources` folder.&#x20;
* In your `server.cfg`, make sure to start `ox_lib` before the Complete Election & Campaign! script by adding the following line:
  {% endstep %}

{% step %}

### Add Script to Server Configuration

* **Edit server.cfg**
  * Open the `server.cfg` file located in the root directory of your FiveM server.
* **Add the Following Lines** To ensure the script loads correctly, add the following lines to your `server.cfg`:

  ```lua
  ensure ox_lib
  ensure ox_target
  ensure your_inventory_resources
  ensure sVoting
  ```
* **Note:** Ensure that `ox_lib` and `ox_target` are installed and loaded before the Election Voting script for smooth functionality.
  {% endstep %}

{% step %}

### Add items to ox\_inventory

Add this code intro `ox_inventory/data/items.lua` :

```lua
	['election_poster'] = {
		label = 'Poster',
		weight = 500,
		stack = false,
		client = {
			export = 'sVoting.election_poster'
		}
	}
```

{% endstep %}
{% endstepper %}
