# Installation

Follow the steps below to properly install and configure the `cad-citations`script.

## Step-by-Step Guide

1. **Download the latest update**  
   Get the resource from [Keymaster ](https://keymaster.fivem.net/)or the [Cfx Portal](https://portal.cfx.re/assets/granted-assets).
2. **Configure the Notepad**  
   Set up the player list options from the Configuration section.
3. **Add to your ****`server.cfg`**  
   Insert the following line into your `server.cfg` file:

   ```
   ensure cad-citations
   ```
4. **You're all set!**

## Dependencies

Make sure the following requirements are met:

- Server Artifacts (Latest) – [Windows ](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/)/ [Linux](https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/)
- [Onesync ](https://docs.fivem.net/docs/scripting-reference/onesync/#what-is-onesync-infinity)(enabled in your server configuration)

## Database

- Once script is started it will auto create tables in your database
- For people porting from v0.8 and above run below sql

   ```sql
   ALTER TABLE citations
       ADD COLUMN officer_citizen_id VARCHAR(255) NOT NULL AFTER street_name,
       MODIFY COLUMN citizen_id VARCHAR(255) NOT NULL;
   ```

## Inventory Items

### ox\_inventory

- ox\_inventory/data/items.lua

```lua
['citationreceipt'] = {
	label = 'Citation Receipt',
	description = "Written document informing the individual of the violation.",
	weight = 100,
	consume = 0,
	stack = false,
	server = {
		export = 'cad-citations.useItem'
	}
},

['citation'] = {
	label = 'Citation Notepad',
	description = "Has many pages of citations for writing information of violations by a individual.",
	weight = 100,
	consume = 0,
	stack = false,
	server = {
		export = 'cad-citations.useItem'
	}
},
```

- ox\_inventory/web/images

### qb-inventory / ps-inventory

- qb-core/shared/items.lua

{% code fullWidth="false" %}

```lua
citationreceipt = {
	name = 'citationreceipt',
	label = 'Citation Receipt',
	description = "Written document informing the individual of the violation.",
	weight = 10,
	type = 'item',
	image = 'citationreceipt',
	unique = true,
	useable = true,
	shouldClose = true,
	combinable = nil,
	server = {
		export = 'cad-citations.useItem'
	}
},

citation = {
	name = 'citation',
	label = 'Citation Notepad',
	description = "Has many pages of citations for writing information of violations by a individual.",
	weight = 100,
	type = 'item',
	image = 'citation',
	unique = true,
	useable = true,
	shouldClose = true,
	combinable = nil,
	server = {
		export = 'cad-citations.useItem'
	}
},
```

{% endcode %}

- qb-inventory/html/images

### qs-inventory

- qs-inventory/shared/items.lua

{% code fullWidth="false" %}

```lua
['citationreceipt'] = {
    ['name'] = 'citationreceipt',
    ['label'] = 'Citation Receipt',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'citationreceipt.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'Written document informing the individual of the violation.'
},
['citation'] = {
    ['name'] = 'citation',
    ['label'] = 'Citation Notepad',
    ['weight'] = 100,
    ['type'] = 'item',
    ['image'] = 'citation.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'Has many pages of citations for writing information of violations by a individual.'
},
```

{% endcode %}

- qs-inventory/html/images
