# Getting Started

This Support Centre is the go-to place for installation, configuration, and troubleshooting for all Hamz products. This is available 24 hours a day, whilst our volunteer support team is available via a Discord support ticket during limited hours.

Please make sure you have read this documentation carefully before contacting our support team. Whilst we're more than happy to assist you in any way we can, please note that we have other customers' tickets ahead of yours - so there may be a delay in getting to your ticket.

### Hosting

All our products are compatible with running on Shared Web Hosting. We are unable to verify the full compatibility with every hosting provider, however, we recommend using [**SimplisticNode**](https://simplisticnode.com/index.php?rp=/store/shared-web-hosting) for hosting. Our products have been tried and tested on the platform and are known to have worked.

The team at SimplisticNode can also fully install and complete a basic configuration of your product, so it's ready to go within minutes of purchasing. Contact their team via [**Discord**](https://discord.gg/8tpX9SKsx6) for more information.

### Prerequisites

* Web Server to host our product on, such as Nginx, Apache, Shared Hosting (cPanel or DirectAdmin)
* Must support PHP versions 7.2 or 7.4
* MySQL Databases
* [Discord Developer Tools](https://discord.com/developers/applications)

### Sub-Domain Setup

#### This guide assumes you're using cPanel hosting

Head to the **Domains** section within cPanel, and click **Domains**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FluwGvcI1npqVig0oCPLw%2Fdomains.png?alt=media&amp;token=47c3f471-9a26-462c-88ca-8691574bb10f" alt=""><figcaption></figcaption></figure>

Select **Create A New Domain**

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FzXlMJxLr33lj1QKY358y%2Fdomains-1.png?alt=media&amp;token=f39f8c57-5c87-43d0-b559-892780d559fd" alt=""><figcaption></figcaption></figure>

Enter the subdomain you'd like, followed by your domain.

Example:

**Sub-domain:** cad

**Domain:** hamzcad.com

**cPanel Domain Box:** cad.hamzcad.com

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FKTmX0nF3Hr8v4FbBaab6%2Fdomains-2.png?alt=media&amp;token=52f57922-e5ad-40d5-aaac-47970e3420d8" alt=""><figcaption></figcaption></figure>

Once it's all correctly filled out, click the **Submit** button.


# Common Problems

## **Issue 1 - HTTP 500 ERROR**

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FBJvT9uDZKRYMc3uJ7J9F%2Fimage.png?alt=media&amp;token=1ddcdb5f-3a5b-480e-b7dc-77d9344d04ac" alt=""><figcaption></figcaption></figure>

If you get this issue when you go to your domain, do the following:

* Copy the contents of your config.php and put it through a [PHP syntax checker](https://phpcodechecker.com/), if an error comes up, just fix the issue, usually you probably removed the ' or ; by accident.
* If thats, not the issue, then its to do with your SQL connection. Recheck all your SQL details in the config and make sure they are correct. Make sure the SQL file is imported into your database and if your on cpanel, make sure to add your user privileges to the database.

If you are still receiving this error then make sure you have correctly Licensed your domain.

[License Portal ](https://license.hamzcad.com/login.php)

Do not add `http://` or `https://` in front of it and no `/` at the end!

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FeYGtvBg0zvB19ToFFYbH%2Fd6c55b6dfaf816ecae0fe950c045c6c8.png?alt=media&amp;token=01cd8047-353b-49d6-a3d1-00ccbd6d3646" alt=""><figcaption></figcaption></figure>

## **Issue 2 - Invalid Redirect URL**

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F25dX4azRWvHIQOIOLw8u%2Fimage%20(1).png?alt=media&amp;token=9b28ba80-d736-4a3a-8ad7-8fd9414c1ae9" alt=""><figcaption></figcaption></figure>

If you get this issue when logging in, do the following:

* In your config.php. check the domain is correct spelled and in the correct format. Eh. *<https://cad.domain.tld>  (There cant be any / at the end)*
* *Then go to the* [*discord developer portal*](https://discord.com/developers/applications)\_, navigate to your bot -> oauth2. Make sure the link is correct. Eg. <https://cad.domain.tld/actions/register.php_&#x20>;

## **Issue 3 - Discord count not working on Community Site**

If your Discord count is not working on your community site then what you can do is -&#x20;

Login to your Discord Developer Portal, access your bot used in your config then ensure that all intents are enabled on your bot.


# 🎥 Video Tutorial

{% embed url="<https://www.youtube.com/watch?v=8YxcrYmah7s>" %}


# Installation

This documentation is written using SimplisticNode's cPanel web hosting.

## Downloading

Once you've purchased the product, head over to [**store.hamz.dev**](https://store.hamz.dev), in the top right click your Discord ID then you'll be presented with the products you own. Click the **Download** button next to Hamz CAD.

## Choosing a Domain

You now have to decide if you want to access your CAD via your main domain, or a sub-domain.

A main domain would be **hamzcad.com**

A sub-domain would be **cad.hamzcad.com**

If you want to use the main domain, please continue with the instructions below. However, if you want to use a sub-domain, pause here, and [click here](https://docs.hamz.dev/#sub-domain-setup) to learn how to set up a sub-domain.

<details>

<summary>PHP Configuration Requirements</summary>

For this product, you must use:&#x20;

* PHP Version 7.4 (If you are using the In-Game UI, use PHP 7.2)
* PHP `output_buffering` set to 4096

</details>

## Uploading the Files

Next, head into your Web Hosting control panel.

Under the **Files** tab, select **File Manager**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FnFcPnT5yt58fZ3n2yEYn%2Fuploading.png?alt=media&amp;token=ceac44a0-d047-4909-b6e4-ec6b36c77941" alt=""><figcaption></figcaption></figure>

Once the **File Manager** has opened in a separate tab, select **public\_html**

If you wish to use a sub-domain, select the appropriate folder otherwise click **Upload** in the menu at the top.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2Fiva3myDihQ1WFSxGTwow%2Fuploading-1.png?alt=media&amp;token=4ce636cb-e189-45bb-a0eb-bb5e3f48ee78" alt=""><figcaption></figcaption></figure>

Select the .zip folder that you previously downloaded from the store.

## Extracting the Files

Once the files have been uploaded, right-click on the new .zip folder and click **Extract**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FQ7NU6OYaVRHBRjRnTwmd%2Fextract.png?alt=media&amp;token=12421f71-74c1-4047-94a3-be39c180a0b9" alt=""><figcaption></figcaption></figure>

Once you've accepted the following Extract prompts, you'll then be presented with two folders. One is your .zip file, and one is the folder you just extracted; you can now delete the .zip folder.

## File Management

Enter the "HAMZ CAD V3" folder, and then enter the "WEB FILES" folder.

Click "Select All" from the above menu, and drag them all into the correct folder in the structure on the left. Example: **public\_html**

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FrcU0khO5Kd6CNVoOeJIY%2Ffile-management.png?alt=media&amp;token=bdf3cb92-9963-4eed-8df9-2c2210361808" alt=""><figcaption></figcaption></figure>

## MySQL Database

You now need to create a database and user for the CAD system to run on.&#x20;

Head back into cPanel, and look for **MySQL Databases**

Under the **New Database**, enter a unique name for the CAD database. Example: **cad**

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FnpW573ZQFSFbt7pwqJfg%2Fimage.png?alt=media&amp;token=7520cfde-5983-401f-b493-5e63b2da51e6" alt=""><figcaption></figcaption></figure>

Once the name is chosen, select **Create Database**.

Next, you'll need to make a MySQL Use&#x72;**.** Scroll down on the same page to the **Add New User** section. Again, choose a unique name for the username. Example: **admin**

Use cPanel to generate a unique password, and save it to a notepad document.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FzM7oDiQO6e0RRtejjrQq%2Fimage.png?alt=media&amp;token=f6deb961-8489-4738-ace8-6962e4b764b4" alt=""><figcaption></figcaption></figure>

Once you've got the password, saved, click **Use Password** which will then fill out the form fully, and hit **Create User**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FP1bov1cFDDWlaaCNGlfl%2Fimage.png?alt=media&amp;token=5d57bf2b-22b5-49f6-91c8-4bb72ddfbb31" alt=""><figcaption></figcaption></figure>

Next, we need to add the permissions to the user to that database we've just created. At the bottom of the page select the **User** and **Database** and then click **Add**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F0Sq2YTSxVbtbT5HtizP0%2Fimage.png?alt=media&amp;token=6f3bdde5-dc27-4023-b8ee-bebb06a7fb77" alt=""><figcaption></figcaption></figure>

Ensure that **All Privileges** are selected, so that it has full permissions to that database. Once completed click **Make Changes**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F5CY65vIvdnQwZQwEK235%2Fimage.png?alt=media&amp;token=cae57a61-44d6-443a-ba4f-ccacc5ca7f1b" alt=""><figcaption></figcaption></figure>

## Database Import

Now that we have the database created, we're going to want to import the database that comes with the CAD system to that database we've just made.&#x20;

Head back into cPanel, but this time select **PHPMyAdmin**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FjLFuCP4tGCMLlASIG9gT%2Fimage.png?alt=media&amp;token=5bd06037-2a88-4ba2-a9ed-1990d25bc062" alt=""><figcaption></figcaption></figure>

Select the database you've just created from the left menu.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FXoZOltQIUFfs4vuKhFl8%2Fimage.png?alt=media&amp;token=2d8adb58-4de7-414a-b596-511453db6171" alt=""><figcaption></figcaption></figure>

Select **Import** from the menu bar

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FQJ5d48ySwLDqww9tNnyq%2Fimage.png?alt=media&amp;token=2f14c36f-cedf-48b8-b7ff-433a5b73406f" alt=""><figcaption></figcaption></figure>

Select the **.mysql** file that was in the downloaded folder.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FjrYadlUDbcwHEQ64wcoZ%2Fimage.png?alt=media&amp;token=9d25e0a1-20dd-4305-a697-0d3a2f88d7d9" alt=""><figcaption></figcaption></figure>

Lastly, click **Import**.&#x20;


# Configuration

## Configuring the config.php file

Firstly, find the **config.php** file within the **File Manager**. Right-click, and click **Edit**.

### 1 - Base URL

On line 7, you will find:

```
define('BASE_URL', 'https://cad.domain.tld');
```

You need to replace the domain with your domain, where you want your players to access the CAD from. For example, **<https://cad.hamzcad.com>** - please ensure you do not put a slash `/` at the end of the domain.

### 2 - MySQL Database

On line 9, you will find:

```
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_NAME', 'hamzcad');
```

If you're using SimplisticNode, you can keep the `DB_HOST` as `localhost`, however, if you're using a third party, confirm with them what their host needs to be.

**IMPORTANT:** If you are using cPanel web hosting, ensure you put the full username and database user/name. Example: `coobikxy_cad`

Next, enter your MySQL database info in the table. If you haven't already created one, click here to be taken to that documentation.&#x20;

### 3 - Discord OAuth

On line 15, you will find:

```
define('TOKEN', 'INSERT_HERE');
define('GUILD_ID', 'INSERT_HERE');
define('OAUTH2_CLIENT_ID', 'INSERT_HERE');
define('OAUTH2_CLIENT_SECRET', 'INSERT_HERE');
```

Similar to the MySQL Database information above, enter your Discord bot information as per your Developer portal.&#x20;

**Token** - This is your Bot token, found within Discord Developers > Bot > Token

**Guild ID** - Ensure you have Developer mode turned on in Discord, right-click the server icon, click Copy Server ID, and paste it into the table.

**OAuth Client ID** - This is your Bot token, found within Discord Developers > OAuth2 > General > Client ID

**OAuth Client Secret** - This is your Bot token, found within Discord Developers > OAuth2 > General > Client Secret

***

Whilst we're here, you can also go ahead and add your Redirect link for the CAD.&#x20;

Click **Add Redirect** on the OAuth2 page

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FX8kBVOfE6ivuRnEwTk3d%2Foauth2.png?alt=media&amp;token=6dc2b511-06ca-4db0-96db-3ce3241540f7" alt=""><figcaption></figcaption></figure>

In the URL box, using the **Base URL** above, copy that link but add the following to it:&#x20;

```
/actions/register.php
```

So, once it's fully put together it'll look like **<https://cad.hamzcad.com/actions/register.php>**

### **4 - Discord Admin Permissions**

```
$ADMINROLES = [
	"ROLEIDHERE", // Replace with role ID
	"ROLEIDHERE", // Replace with role ID
];
```

Replace `RoleIDHERE` with a Discord Role ID which will be granted full administrator access.

### 5 - Discord Logs

```
// DISCORD LOGS \\
define('LOGS_COLOR', '#00B2FF'); // Change color code
define('LOGS_IMAGE', 'direct_image_link'); // Replace with a direct image link

define('MISC_LOGS', 'CHANNELID'); // Replace CHANNELID with a Channel ID
define('CHARACTER_LOGS', 'CHANNELID'); // Replace CHANNELID with a Channel ID
define('LAW_BREAKING_LOGS', 'CHANNELID'); // Replace CHANNELID with a Channel ID
define('DEPARTMENT_LOGS', 'CHANNELID'); // Replace CHANNELID with a Channel ID
define('ADMIN_LOGS', 'CHANNELID'); // Replace CHANNELID with a Channel ID
define('DISPATCH_LOGS', 'CHANNELID'); // Replace CHANNELID with a Channel ID
define('STATUS_LOGS', 'CHANNELID'); // Replace CHANNELID with a Channel ID
```

Replace `CHANNELID` with the Channel ID to which you want that specific log to report. Please ensure the bot you previously created has the ability to view and type in that channel.

### 6 - General Settings

```
// GENERAL SETTINGS \\
define('SERVER_SHORT_NAME', 'HAMZ');
define('SERVER_LOGO', 'https://imgur.com/yaHpliD.png');
define('PENAL_CODE_LINK', 'https://docs.hamz.dev'); // # to Disable
define('LIVEMAP_LINK', 'https://docs.hamz.dev'); // # to Disable
define('MAX_CHARACTERS', '10');
define('ALLOW_DUPLICATE_CHARACTER_NAMES', '1'); // 0 to Disable | 1 to Allow
define('GALLERY', '1'); // 0 to Disable | 1 to Enable
define('PRELOADER', '0'); // 0 to Disable | 1 to Enable
define('CALLPANEL911', '1'); // 0 to Disable | 1 to Enable
define('CIVILIAN_PERM_PUBLIC', '0'); // 0 to Disable | 1 to Enable 
define('DMV_SYSTEM', '1'); // 0 to Disable | 1 to Enable 
define('DISABLE_CIV_LICENSE_EDIT', '0'); // 0 to Disable | 1 to Enable // Disable if DMV is 0
define('POINTS_FOR_DRIVING_SUSPENSION', '6'); // 0 to Disable | 1 or any other digit to set points
define('UPDATE_IDENTIFIER_ON_LOGIN', false); // Update the Identifier with Discord Nickname, Each time a user logs in.
define('IDENTIFIER_CHECK', true); // Displays pop up asking user to verify if they have the correct identifier & department before allowing to access department dashboard.
define('ALLOW_EMS_MARK_CHARACTER_DEAD', true); // If true, allows ems to mark characters as dead or alive.
```

### 7 - 10 Codes

Enter your community's 10 codes that fit your server. Please make sure to keep the format.

`"10Code | Explination" => "#HEXColour"`

Example: `"10-11 | Traffic Stop" => "#FF0000"`

### 9 - Fire & EMS Apparatus

```
$FIREEMS_APPARATUS = [
	"Engine",
	"Tower",
	"Medic",
];
```

Ensure to keep the same format.

### 10 - LEO Statuses

```
$LEO_STATUSES = [
	"10-6 | Busy" => "10-6",
	"10-11 | Traffic Stop" => "10-11",
	"10-15 | En-Route to Station" => "10-15",
	"10-23 | Arrived on Scene" => "10-23",
	"10-97 | In Route" => "10-97",
	"10-99 | In Distress" => "10-99",
];
```

Ensure to keep the same format.

### 11 - Fire & EMS Statuses

```
$FIREEMS_STATUSES = [
	"Roaming" => "Roaming",
	"10-6 | Busy" => "10-6",
	"10-15 | En-Route to Station" => "10-15",
	"10-23 | Arrived on Scene" => "10-23",
	"10-97 | In Route" => "10-97",
	"10-99 | In Distress" => "10-99",
];
```

Ensure to keep the same format.

### 12 - Servers

Configure your server information, here. Please ensure it's correct as it can produce slowness on the CAD system performance if incorrect.

```
$SERVERS = array(
	[
		'server_ip' => '149.202.88.5',
		'server_port' => '30120'
	],
	// [
	// 	'server_ip' => '127.0.0.1',
	// 	'server_port' => '30121'
	// ]
);
```

### 13 - Colouring

```
define('ACCENT_COLOR', '#00B9FF');
define('BACKGROUND_COLOR', '#000000');
define('CARD_COLOR', '#191c24');
define('TEXT_COLOR', '#ffffff');
define('INPUTBOX_COLOR', '#2A3038');
define('SCROLLBAR_COLOR', '#6c7293');
```

### 14 - API Key

`define('SECRET_KEY', 'apitest123'); // Used in some API's`

Replace apitest123 with any key you want, this can include letters and numbers.


# 🎥 Video Tutorial

{% embed url="<https://youtu.be/47rhXYEUQS8>" %}


# Requirements

This page will list the requirements that are required to run any Hamz Development product.

* Web Server to host the site such as Nginx, Apache, Shared Hostings (cPanel or DirectAdmin) or Other Web Hosting.
* Web Server must have PHP installed and modules.
* Must support php version 7.2 or 7.4
* MySQL Server.


# Installation


# Database and SQL

We will be using a Shared Hosting package, login to cPanel. \
(Recommended hosting - [SimplisticNode](https://simplisticnode.com))

Head to the MySQL Databases in cPanel.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FUsRzMs2SkmSrQN9Lw5k5%2FScreenshot_1.png?alt=media&amp;token=3b43f256-8ee1-457f-bbcf-1fdb648678c7" alt=""><figcaption></figcaption></figure>

Now, after clicking on the button you will create a new MySQL Database. You can do so by simply typing the name of your Database and hitting "Create Database".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F6207R1QYlAq7LZx3Iqr7%2FScreenshot_2.png?alt=media&amp;token=501fd84c-cb5c-4e07-861a-3060fc240fdf" alt=""><figcaption></figcaption></figure>

Fill in the name that you want to call your database and then we will create the admin user that can access the Database, you will need this for the next few steps.

You now want to head to the bottom of the page in your MySQL Databases and "Create a user".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FxGbtx3L3gis5N0W1Pn7a%2FScreenshot_3.png?alt=media&amp;token=bf0bd2c0-9c97-42a4-8e74-4afd1bf8d1f7" alt=""><figcaption></figcaption></figure>

Ensure that the password you put here is written down elsewhere and put aside for further steps.

After creating your admin user, you now want to give that user admin access to your chosen Database. On the same page, navigate "Add User To Database", you will see the "user" and the "database".&#x20;

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FhfoI2yQHNj9hhnWgex7C%2FScreenshot_4.png?alt=media&amp;token=7e6a6a64-db1d-4855-b95e-fe97b1066358" alt=""><figcaption></figcaption></figure>

After adding the user, you will be prompted with a Privileges page, you will want to chose the top option "All Privileges". You then want to press "Make Changes".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F2afEVapl72FDUd24u6uD%2FScreenshot_5.png?alt=media&amp;token=9ca1f762-319e-4965-ab11-581284e1e45f" alt=""><figcaption></figcaption></figure>

Now that you have created your Database and your Admin user, you want to upload your SQL. You can head back to the main page in cPanel and find the "PHPMyAdmin" button right near your "MySQL Databases" button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FeyLDS7og8Fh9x6g1HLF7%2FScreenshot_6.png?alt=media&amp;token=ca417df1-f503-421a-88e2-12f8bbacd3cd" alt=""><figcaption></figcaption></figure>

When you have logged into your PHPMyAdmin, you will see a list of Databases on the left side of your screen. You will see the Database you created, click on it. After clicking on your Database, you will see a few options at the top as shown in the picture below. You want to chose the "Import" option.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F8CVHEf6dTzUDhVvlt4x2%2FScreenshot_7.png?alt=media&amp;token=73fbdefd-0877-40f1-9a0f-9178e43d866e" alt=""><figcaption></figcaption></figure>

After clicking into "Import" you will be asked to "Choose File", You can find your SQL file provided in your downloaded product typically in it's own "SQL" folder. You will select and upload that file.

You've now completed your Database and SQL installation, please continue.


# SubDomain

Feel free to skip to the next step if you do not wish to use a SubDomain.

For your Subdomain, head to the main page of cPanel and look for "Domains" or "Sub Domains" (Depending on what cPanel theme you are on).

<div align="center"><figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F1UzZnhvsmiBVmcPexZQc%2FScreenshot_8.png?alt=media&amp;token=a7709dc0-4174-4c07-b787-3ab77623334d" alt=""><figcaption></figcaption></figure> <figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FGkzsgkj3LqoHjpkcS7Ru%2FScreenshot_9.png?alt=media&amp;token=3507d869-e089-4f8d-91f4-b0e091f67686" alt=""><figcaption></figcaption></figure></div>

When inside your Subdomain page, you'll want to chose your subdomain by simply typing the phrase it's self. example: "cad".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FqmhAlSEtlrB1CD7CNi4U%2FScreenshot_10.png?alt=media&amp;token=d9934620-c241-4d09-bb81-9718102e6785" alt=""><figcaption></figcaption></figure>

cPanel will automatically generate the file directory for this subdomain. (Can be changed and customized at anytime)


# Uploading Files

Now, to upload your files you will want to head back to the main page of cPanel and locate your "File Manager".

Now inside of your File Manager you will want to navigate into public\_html. (If you are using a SubDomain then locate to it's file location set upon creation).&#x20;

Once inside your file location, to upload your files you will have to chose the "Upload Files" button at the top and chose your Hamz Product .zip file. You will now want to extract those files and move everything from "WebFiles" into your main directory. (Public\_html or your SubDomain file location).


# SSL Certification

Now you want to secure your website by install a "SSL", you can do this by going back to the home page of cPanel and locating the "SSL/TLS Status" Button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F6u7xP9gFWm3ygIoCuKR5%2FScreenshot_11.png?alt=media&amp;token=813ac410-ee86-49d3-a3f4-a844cee1fccf" alt=""><figcaption></figcaption></figure>

Once inside, chose the top option that selects all domains. Once you have them all selected, click "Run AutoSSL".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F1b99N0WCl6kZE7eeuA3Y%2FScreenshot_12.png?alt=media&amp;token=c47f5919-e03d-4d0d-a866-aabc29e5383f" alt=""><figcaption></figcaption></figure>

Now after a few minutes, your SSL will be installed and your website will be secure!

**Installation now complete, please move to the Configuration setup.**


# Configuration

**Step 1 - Locating the config.php file**

Locate the config.php file inside of File Manager. This will be in public\_html or the sub folder. When you have located the config file double click it to open the file and edit it.

**Step 2 - Base URL**

The base url can be located at the top of the config file

```
// CAD URL \\
define('BASE_URL', 'https://localhost/hamzcommuntiy');
```

Replace the base url with your link. IMPORTANT: Make sure there is no `/` at the end of the base url.

**Step 3 - SQL DATABASE CONNECTION**

```
// SQL DATABASE CONNECTION \\
define('DB_HOST', 'localhost'); // Keep this unless your db is hosted elsewhere
define('DB_USER', 'root'); // Replace root with DB username
define('DB_PASSWORD', ''); // Add DB Password inside of the ''
define('DB_NAME', 'hamzcad'); // Replace hamzcad with DB name
```

**Step 4 - DISCORD OAUTH2**

```
// DISCORD OAUTH2 \\
define('TOKEN', 'TOKEN-HERE');
define('GUILD_ID', 'GUILD-ID-HERE');
define('OAUTH2_CLIENT_ID', 'CLIENT-ID-HERE');
define('OAUTH2_CLIENT_SECRET', 'CLIENT-SECRET-HERE');
```

Head to the [Discord Developer Portal](https://discord.com/developers/applications).

Create a application.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2Fajmd5GKJgYtgmFoCcUHt%2Fnewapp.png?alt=media&amp;token=ecf8c3d0-fea4-42b1-bba2-2deaa621925c" alt=""><figcaption></figcaption></figure>

First we will get the bot token. Head to the bot navigation on your application and create the bot. When you have created the bot click on the Copy button under the token.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FzudrqqzlglqqD4Ezh0T0%2Ftoken.png?alt=media&amp;token=791664d1-935e-4cd1-915f-f39ca9c93e5b" alt=""><figcaption></figcaption></figure>

Now that you have that copied replace TOKEN-HERE with the token you have copied.

Guild ID. = Right click on your servers profile image on discord and press COPY ID if this is not a option you will have to enable developer mode in the discord settings.

Now replace GUILD-ID-HERE with the ID you now have copied.

OAUTH2 CLIENT ID. = On the dev portal head to OAuth2 section.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F4J05iHagzjF80mRE232N%2Fauth2.png?alt=media&amp;token=253398d8-0b60-4f77-95ea-4924c4415cb5" alt=""><figcaption></figcaption></figure>

Now head to the client id and press the copy button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FnV4gozqrcpwb18as0xrm%2F9c27828eeca433d37709300a0690fbf7.png?alt=media&amp;token=e033912e-d9ea-449f-89bd-b396f954abfb" alt=""><figcaption></figcaption></figure>

Now replace the OAUTH2\_CLIENT\_ID with the ID you have copied.

OAUTH2 CLIENT SECRET = On the dev portal OAuth2 section copy the secret key.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FpK7skQwUfUUfYkrErC0V%2Fsecret.png?alt=media&amp;token=ea0c5f9a-dc05-4a89-8709-f39c04c5c2bb" alt=""><figcaption></figcaption></figure>

Now replace OAUTH2\_CLIENT\_SECRET with what you have copied.

Make sure that the application is inside your discord server. You can do that via the below link.

> [https://discordapp.com/oauth2/authorizeclient\_id=CLIENT\_ID\_HERE\&scope=bot\&permissions=0](https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID_HERE\&scope=bot\&permissions=0)\
> Replace CLIENTIDHERE with the applications client ID.

Finally, Set the **OAuth2 Redirect** here: (link + /actions/register.php)

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FMtdAKWbTrcXZs9iiKZN0%2Fredir.png?alt=media&amp;token=e7473720-a70b-4c0f-9888-fa6fe3fc7d3f" alt=""><figcaption></figcaption></figure>

## php.ini File Configuration

Making the session timeout longer, now became easier!

1. Head into cPanel
2. In the Search Bar, type in **MultiPHP INI Editor**, and choose the option\
   ![](https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FvSBLeigW1ri1bbHTcOqR%2Fimage.png?alt=media\&token=8e4f8df2-d182-4131-9162-81d71f4844c1)
3. Select **Editor Mode**\
   ![](https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2Fa4een2T5igCT0PDqNRGk%2Fimage.png?alt=media\&token=9d7f231f-06f8-4222-a72e-3656daa1463d)
4. Select your Community Site domain from the dropdown
5. Paste the following inside of the textbox, under anything else that is already pre-generated or pre-entered:\
   `session.gc_maxlifetime = 86400`\
   `session.cookie_lifetime = 86400`\
   \
   86400 will allow the website to remember you for up to 24 hours.
6. Once you've entered that, select **Save**.


# Web Installation

This documentation is written using SimplisticNode's cPanel web hosting.

## Downloading <a href="#downloading" id="downloading"></a>

Once you've purchased the product, head over to [**store.hamz.dev**](https://store.hamz.dev/), in the top right click your Discord ID then you'll be presented with the products you own. Click the **Download** button next to Hamz Staff Elite Panel.

To download the in-game assets, head to your [keymaster](https://keymaster.fivem.net/) and download it from there. It should be named "**Report & Staff Menu - FiveM Resource".**

## Choosing a Domain <a href="#choosing-a-domain" id="choosing-a-domain"></a>

You now have to decide if you want to access your staff panel via your main domain, or a sub-domain.

A main domain would be **hamz.dev**

A sub-domain would be **staff.hamz.dev**

If you want to use the main domain, please continue with the instructions below. However, if you want to use a sub-domain, pause here, and [click here](https://docs.hamz.dev/#sub-domain-setup) to learn how to set up a sub-domain.

## Licensing&#x20;

Go to <https://license.hamzcad.com/> and add your domain there or else you wont be able to login!

## Minimum Requirements

1. PHP Version 7.4
2. Ability to run cron jobs (scheduled tasks) by the minute, and hourly

## Uploading the Files

Next, head into your Web Hosting control panel.

Under the **Files** tab, select **File Manager**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FqJo3JLB7zAQEUT1sKIPR%2Fimage.png?alt=media&amp;token=fd2cace2-0141-440a-80ee-0a2426abebc4" alt=""><figcaption></figcaption></figure>

Once the **File Manager** has opened in a separate tab, select **public\_html**

If you wish to use a sub-domain, select the appropriate folder otherwise click **Upload** in the menu at the top.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2Fzz5Jf9bQrzEVeVLAoB5U%2Fimage.png?alt=media&amp;token=17abb0e6-121f-4cdb-81cc-493d96bad089" alt=""><figcaption></figcaption></figure>

Select the .zip folder that you previously downloaded from the store.

## Extracting the Files <a href="#extracting-the-files" id="extracting-the-files"></a>

Once the files have been uploaded, right-click on the new .zip folder and click **Extract**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2Fbo2FwOXPHArOIbJEVCEk%2Fimage.png?alt=media&amp;token=719c609c-e795-411e-9015-524317c78c6c" alt=""><figcaption></figcaption></figure>

Once you've accepted the following Extract prompts, you'll then be presented with two folders. One is your .zip file, and one is the folder you just extracted; you can now delete the .zip folder.

## File Management <a href="#file-management" id="file-management"></a>

Enter the "WEB FILES" folder.

Click "Select All" from the above menu, and drag them all into the correct folder in the structure on the left. Example: **public\_html**

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2Fg17Pd6BUS0WwuoGJR5pi%2FScreenshot%202024-04-21%20153809.png?alt=media&amp;token=22a0d259-964a-4d4e-84d4-3ebcdcdb838e" alt=""><figcaption></figcaption></figure>

## MySQL Database

You now need to create a database and user for the staff panel to run on.

Head back into cPanel, and look for **MySQL Databases**

Under the **New Database**, enter a unique name for the CAD database. Example: **staffpanel**

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F0e48KQ7SZ91Ed4qactd6%2Fimage.png?alt=media&amp;token=aa81c775-f311-4b6f-8ccc-0e33cec24a6c" alt=""><figcaption></figcaption></figure>

Once the name is chosen, select **Create Database**.

Next, you'll need to make a MySQL Use&#x72;**.** Scroll down on the same page to the **Add New User** section. Again, choose a unique name for the username. Example: **admin**

Use cPanel to generate a unique password, and save it to a notepad document.

<figure><img src="https://docs.hamz.dev/~gitbook/image?url=https:%2F%2F1343677498-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fmh5jQDhFVLCuJsqAc1xh%252Fuploads%252FzM7oDiQO6e0RRtejjrQq%252Fimage.png%3Falt=media%26token=f6deb961-8489-4738-ace8-6962e4b764b4&#x26;width=768&#x26;dpr=1&#x26;quality=100&#x26;sign=2caa2a10f7238332a1d9901bc4eab3460dc20501d5dd8ae7f7cb30b4e61d2794" alt=""><figcaption></figcaption></figure>

Once you've got the password, saved, click **Use Password** which will then fill out the form fully, and hit **Create User**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2Fx2L14XXwO2U1sXF1VKJc%2Fimage.png?alt=media&amp;token=bc90e9f9-6755-4004-a074-5576af78b956" alt=""><figcaption></figcaption></figure>

Next, we need to add the permissions to the user to the database we've just created. At the bottom of the page select the **User** and **Database** and then click **Add**.

<br>

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FVRrmJQurhQjekQtIqQUc%2FScreenshot%202024-04-21%20154413.png?alt=media&amp;token=21a701f0-2889-4c83-b9c8-78bc30ac020c" alt=""><figcaption></figcaption></figure>

Ensure that **All Privileges** are selected, so that it has full permissions to that database. Once completed click **Make Changes**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FJqBCuYVqqiIhrrx1IfpG%2FScreenshot%202024-04-21%20154522.png?alt=media&amp;token=4c5ccb5b-d024-4eba-8fd5-ae71b90e4eb7" alt=""><figcaption></figcaption></figure>

## Database Import <a href="#database-import" id="database-import"></a>

Now that we have the database created, we're going to want to import the database that comes with the CAD system to that database we've just made.

Head back into cPanel, but this time select **PHPMyAdmin**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FcogKqqEsjxqpM72IT5VF%2Fimage.png?alt=media&amp;token=751bed0a-42a5-49eb-9c42-7f0de2ae297e" alt=""><figcaption></figcaption></figure>

Select the database you've just created from the left menu.

<br>

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FqKKsZwmHQxmDmqzzemjC%2FScreenshot%202024-04-21%20154716.png?alt=media&amp;token=02c738c2-b0c1-4f4c-bbd7-b2f3e1917d0f" alt=""><figcaption></figcaption></figure>

Select **Import** from the menu bar

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FzBoNTc3MlFgyUVIsgyNA%2Fimage.png?alt=media&amp;token=c647d677-9b98-4cbc-8d13-cb7d869d2a5d" alt=""><figcaption></figcaption></figure>

Select the **.mysql** file that was in the downloaded folder.

<br>

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F7RsdIK1ae8OuT60FjRbK%2Fimage.png?alt=media&amp;token=9d66423a-b07b-483c-aab2-bd72c78ad7b0" alt=""><figcaption></figcaption></figure>

Lastly, click **Import**.


# Web Configuration

This documentation is written using SimplisticNode's cPanel web hosting.

### Configuring the config.php file <a href="#configuring-the-config.php-file" id="configuring-the-config.php-file"></a>

Firstly, find the **config.php** file within the **File Manager**. Right-click, and click **Edit**.

### 1 - Default Timezone

You can set the default timezone of which you'd like the panel to run under. By default it's set to GMT, however, you can change this to your servers' primary timezone. Example: EST.

### 2 - Base URL

You'll want to set the Base URL to the primary domain that your staff panel will run under. For example, if you've created a sub-domain as `staff.hamz.dev`, set it to `https://staff.hamz.dev`. Do not add a trailing slash.

### 3 - MySQL Connection

Going back to the database information you previously created in the [Web Installation](/hamz-staff-elite-panel/web-installation) step. Add the information below.

```
// SQL DATABASE CONNECTION \\
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_NAME', 'hamzpanel');
```

If you're using SimplisticNode, you can keep the `DB_HOST` as `localhost`, however, if you're using a third party, confirm with them what their host needs to be.

**IMPORTANT:** If you are using cPanel web hosting, ensure you put the full username and database user/name. Example: `coobikxy_staffpanel`

### 4 - Discord OAuth

Next, you'll need to add your Discord bot information here.

```
define('TOKEN', 'INSERT_HERE');
define('GUILD_ID', 'INSERT_HERE');
define('OAUTH2_CLIENT_ID', 'INSERT_HERE');
define('OAUTH2_CLIENT_SECRET', 'INSERT_HERE');
```

Similar to the MySQL Database information above, enter your Discord bot information as per your Developer portal.

**Token** - This is your Bot token, found within Discord Developers > Bot > Token

**Guild ID** - Ensure you have Developer mode turned on in Discord, right-click the server icon, click Copy Server ID, and paste it into the table.

**OAuth Client ID** - This is your Bot token, found within Discord Developers > OAuth2 > General > Client ID

**OAuth Client Secret** - This is your Bot token, found within Discord Developers > OAuth2 > General > Client Secret

Whilst we're here, you can also go ahead and add your Redirect link for the Staff Panel.

Click **Add Redirect** on the OAuth2 page

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F5ZRVQRKF43JYd8LcdA8p%2Fimage.png?alt=media&amp;token=65e311d6-297a-4b76-8503-77bd64feeaaa" alt=""><figcaption></figcaption></figure>

In the URL box, using the **Base URL** above, copy that link but add the following to it:

```
/actions/register.php
```

So, once it's fully put together it'll look like **<https://staff.hamz.dev/actions/register.php>**

### 5 - General Server Config

Starting with Line 21, you'll want to create a secret code. This can be a word you remember, but ideally, create it as a string of letters and numbers. A [password generator](https://www.random.org/passwords/?num=5\&len=16\&format=html\&rnd=new) usually helps with this.

```
define('SECRET', 'Cgz6cvhmuRjUz9Ns');
```

Next, you'll need to generate a Steam API key, if your server doesn't already have one. Head over to the [Steam Developers portal](https://steamcommunity.com/dev/apikey) to create one.

### 6 - Server Information

Within the array for the server information, fill it out carefully.

```
[
   'server_name' => 'vMenu', // This should match the ingame script config.lua
   'server_ip' => '0.0.0.0',
   'server_port' => '30120',
   'server_rcon_pass' => 'Cgz6cvhmuRjUz9Ns'
]
```

The `server_rcon_pass` needs to be set to the same as what is set in the `server.cfg`.

### 7 - Discord Permissions

Lastly, line 36, enter the Role IDs for users who will have **full** admin access on the panel.

```
$ADMINROLES = [
	"1163293348874956840", // Community Director
	"1191593655224516689" // Developer
];
```


# Web Cronjob

This documentation is written using SimplisticNode's cPanel web hosting.

## Setting up Cronjob

Firstly, head into **cPanel**, and under **Advanced**, look for **Cron Jobs**.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FZHn9AksDE8YNeRI6oXqT%2Fimage.png?alt=media&amp;token=353b59c5-addf-4724-b140-f9756a5828f9" alt=""><figcaption></figcaption></figure>

You'll need to setup 2 cronjobs, one for the playtime hourly, and one per minute.

{% hint style="info" %}
Make sure to replace **YOUR\_DOMAIN** and **YOUR\_SECRET** with the information you've set in the in-game configuration file.
{% endhint %}

### Per Minute

Under **-- Common Settings --**, select **Once Per Minute (\* \* \* \* \*)**

Command:

{% code overflow="wrap" %}

```php
/usr/bin/wget -O /dev/null "https://YOUR_DOMAIN/actions/cron-playtime.php?secret=YOUR_SECRET" > /dev/null 2>&1
```

{% endcode %}

Then click **Add New Cron Job**

### Per Hour

Under **-- Common Settings --**, select **Once Per Hour (0 \* \* \* \*)**

Command:

{% code overflow="wrap" %}

```php
/usr/bin/wget -O /dev/null "https://YOUR_DOMAIN/actions/cron-hourly.php?secret=YOUR_SECRET" > /dev/null 2>&1
```

{% endcode %}

Then click **Add New Cron Job**


# In-Game Requirements

{% hint style="info" %}
The FiveM script should appear in your Keymaster under the name **Report & Staff Menu - FiveM Resource**
{% endhint %}

Some requirements for the in-game resources:

* [ox\_lib](https://github.com/overextended/ox_lib/releases/tag/v3.22.2)
* [Badger\_Discord\_API](https://github.com/JaredScar/Badger_Discord_API), I think other similar Discord API scripts might work, as long as they have the same exports.
* [screenshot-basic](https://github.com/citizenfx/screenshot-basic)


# In-Game Configuration - Report Menu

If you are stuck, or run into problems. Just go over this and make sure you didn't do anything wrong.

The configuration for the report menu is pretty straightforward.

### Example Config:

```lua
minutes = 60000 -- DO NOT CHANGE THIS VALUE
--[[
    To open the menu, use /reports.

    To create a report, use /report
]]
CONFIG = {
    DEBUG = false, -- If you want to see debug messages, set this to true.
    URL = 'https://store.hamz.dev/', -- Panel Link, with a "/" at the end of the link
    SERVER = 'YOUR SERVER NAME', -- Server name, this is the same name you entered on the panel
    TOKEN = 'YOUR SECRET KEY', -- Same token/secretkey from the config.php
    DISCORD_IMAGE = '', -- Discord image
    LOGS = {
        WEBHOOK = 'https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz1234567890' -- Log for actions within the report menu
    },
    REPORT_COOLDOWN = 2 * minutes, -- How long till a player can create another report
    PERMISSIONS = {
        TYPE = 'DISCORD', -- 'DISCORD' or 'ACE'
        ACE = {
            VIEW_REPORTS = 'hamzstaff.viewreports',
            USE_PLAYER_ACTIONS = 'hamzstaff.useplayeractions',
            USE_REPORT_ACTIONS = 'hamzstaff.usereportactions'
        },
        DISCORD = {
            DISCORD_RESOURCE_NAME = 'Badger_Discord_API',
            VIEW_REPORTS = {
                '1125449225069666377'
            },
            USE_PLAYER_ACTIONS = {
                '1125449225069666377'
            },
            USE_REPORT_ACTIONS = {
                '1125449225069666377'
            }
        }
    }
}
```

### Things to be aware of

Below are some things you need to know while configuring the Report Menu. The configuration is straightforward, but you must be mindful of a few things.

#### Debug

Set this to `true` if you are running into issues, that'll help you find exactly what's happening and what might be causing your problem.

#### URL

Make sure it begins with a "https\://" and ends in a "/". **SSL is required.**

#### Server Name

This must be the **same** name as the one set in your config.php. It must be **identical**. The panel supports multiple servers, so ensure you put in the right one.

Example:

If you have this in your **config.php**:

```php
'server_name' => 'Menu Server',
```

Then your server name would be this in your **config.lua**:

```lua
SERVER = 'Menu Server',
```

**Webhook logs**

This logs most stuff done within the reports menu

#### Report Cooldown

This states how many minutes it takes before a user can create another report. If you do not want this feature, simply do this:

```lua
REPORT_COOLDOWN = 0 * minutes,
```

#### Permissions

Discord Permissions are based on Discord roles and rely on Badger\_Discord\_API or any other script with the **same** exports.&#x20;

Ace permissions work like this:

```lua
add_ace group.admin hamzstaff.viewreports allow
add_ace group.staff hamzstaff.viewreports allow
add_ace group.moderator hamzstaff.viewreports allow

add_ace group.admin hamzstaff.useplayeractions allow
add_ace group.staff hamzstaff.useplayeractions allow
add_ace group.moderator hamzstaff.useplayeractions allow

add_ace group.admin hamzstaff.usereportactions allow
add_ace group.staff hamzstaff.usereportactions allow
add_ace group.moderator hamzstaff.usereportactions allow
```

{% hint style="warning" %}
If you have a large player base, you might get rate limited by Discord, which will prevent users from accessing the Report/Staff Menu.
{% endhint %}

#### Discord Resource Name

Case-sensitive. Note not every discord permissions script will work, only the ones that have the same exports as `Badger_Discord_API`. If you do not know if your discord permissions script has those exports, just download Badger's resource:

If you want to remove the annoying ad's, simply remove this from the server.lua in Badger's resource:

```lua
RegisterNetEvent('Badger_Discord_API:PlayerLoaded')
AddEventHandler('Badger_Discord_API:PlayerLoaded', function()
	if (GetCurrentResourceName() ~= "Badger_Discord_API") then 
		TriggerClientEvent('chatMessage', -1, '^1[^5SCRIPT ERROR^1] ^3The script ^1' .. GetCurrentResourceName() .. ' ^3will not work properly... You must '
	.. 'rename the resource to ^1Badger_Discord_API');
	end
	local license = GetIdentifier(source, 'license');
	if (tracked[license] == nil) then 
		tracked[license] = true;
		TriggerClientEvent('chatMessage', source, 
		'^1[^5Badger_Discord_API^1] ^3The Discord API script was created by Badger. You may join his Discord at: ^6discord.gg/WjB5VFz')
	end
	TriggerClientEvent('chatMessage', source, 
		'^7[^2Zap-Hosting^7] ^3Use code ^5TheWolfBadger-4765 ^3at checkout for ^220% ^3off of selected services. Visit ^5https://zap-hosting.com/badger ^3to get started!');
end)
```


# In-Game Configuration - Admin Menu

If you are stuck, or run into problems. Just review this and ensure you didn't do anything wrong within the config.

### Example Config:

```lua
--[[
    To open the menu, use /admin (can be changed in the config.lua file).
    You can use commands or buttons within the menu to perform actions against players.

    Commands:

        - /ban <id> <duration> <reason> - Bans a player for a specified duration and reason.
        - /kick <id> <reason> - Kicks a player for a specified reason.
        - /commend <id> <reason> - Commends a player for a specified reason.
        - /warn <id> <reason> - Warns a player for a specified reason.
        - /trustscore <id> - Shows the trustscore of a player.
        - /f <id> - Toggle freeze on a player.
        - /s <id> - Summon a player to your location.
        - /tp <id> - Teleport to a player.
        - /tpv <id> - Teleport into a player's vehicle.
        - /ss <id> - Take a screenshot of a player.
        - /playernames - Toggle player names on/off.
]]
CONFIG = {
    DEBUG = false, -- If you want to see debug messages, set this to true.
    URL = 'https://store.hamz.dev/', -- Panel Link, with a "/" at the end of the link
    SERVER = 'YOUR SERVER NAME', -- Server name, this is the same name you entered on the panel
    TOKEN = 'YOUR SECRET KEY', -- Same token/secretkey from the config.php
    DISCORD_LINK = 'https://discord.gg/3DDWp6w', -- Discord link
    DISCORD_WEBHOOK = 'https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz1234567890', -- Discord webhook
    DISCORD_IMAGE = '', -- Just for the logs
    DEFAULT_COMMAND = 'admin', -- Default command to open the menu
    PERMISSIONS = {
        TYPE = 'DISCORD', -- 'DISCORD' or 'ACE'
        ACE = {
            BAN_PLAYER = 'hamzstaff.banplayer',
            KICK_PLAYER = 'hamzstaff.kickplayer',
            NOTE_PLAYER = 'hamzstaff.noteplayer',
            COMMEND_PLAYER = 'hamzstaff.commendplayer',
            WARN_PLAYER = 'hamzstaff.warnplayer',
            GET_PLAYERS = 'hamzstaff.getplayers',
            SUMMON_PLAYER = 'hamzstaff.summonplayer', -- To summon a player
            TELEPORT_PLAYER = 'hamzstaff.teleportplayer', -- To teleport to a player
            FREEZE_PLAYER = 'hamzstaff.freezePlayer', -- To freeze/unfreeze a player
            TP_IN_PLAYER_VEHICLE = 'hamzstaff.teleportinvehicle', -- To teleport into a player's vehicle
            SCREENSHOT_PLAYER = 'hamzstaff.screenshotplayer', -- To screenshot a player
            IMMUNE_STAFF = 'hamzstaff.immune' -- Staff that are immune to staff actions
        },
        DISCORD = {
            DISCORD_RESOURCE_NAME = 'Badger_Discord_API',
            BAN_PLAYER = {
                '1125449225069666377'
            },
            KICK_PLAYER = {
                '1125449225069666377'
            },
            NOTE_PLAYER = {
                '1125449225069666377'
            },
            COMMEND_PLAYER = {
                '1125449225069666377'
            },
            WARN_PLAYER = {
                '1125449225069666377'
            },
            GET_PLAYERS = {
                '1125449225069666377'
            },
            SUMMON_PLAYER = {'1125449225069666377'}, -- To summon a player
            TELEPORT_PLAYER = {'1125449225069666377'}, -- To teleport to a player
            FREEZE_PLAYER = {'1125449225069666377'}, -- To freeze/unfreeze a player
            TP_IN_PLAYER_VEHICLE = {'1125449225069666377'}, -- To teleport into a player's vehicle
            SCREENSHOT_PLAYER = {'1125449225069666377'}, -- To screenshot a player
            IMMUNE_STAFF = {'1125449225069666377'} -- Staff that are immune to staff actions
        }
    },
    UI_SETTINGS = {
        SHOW_STAFF = false, -- If you want to show the staff tag in the player info, set this to true.
        SHOW_INFO_TYPE = false -- If you want "Trustscore"/"Playtime" word to be shown in the info type, set this to true.
    },
    TELL_THE_WORLD = {
        BAN = true, -- If you want to tell the world when a player is banned, set this to true. If not only the target player will see the ban message.
        KICK = true, -- If you want to tell the world when a player is kicked, set this to true. If not only the target player will see the kick message.
        COMMEND = true, -- If you want to tell the world when a player is commended, set this to true. If not only the target player will see the commendation.
        WARN = true -- If you want to tell the world when a player is warned, set this to true. If not only the target player will see the warning.
    },
    USE_TX_ADMIN_WARNING = {
        ENABLED = true, -- If you want to use txAdmins warning message, set this to true.
        SHOW_STAFF_NAME = true -- If you want to show the staff name in the warning message, set this to true. If not it will show "Staff Member"
    },
    KEYBIND = {
        ENABLED = true, -- If you want to use the keybind to open the menu, set this to true.
        KEY = 'F9' -- Keybind to open the menu (https://docs.fivem.net/docs/game-references/controls/) Use the "Default QWERTY" name.
    }
}

CONFIG.OPTIONS = {
    {
        actions = {
            type = 'command',
            action = 'playernames'
        },
        name = 'player_names', -- This is the name of the option, it is used to save the state of the option
        title = 'Player Names (DISCORD PERMS)',
        description = 'Toggle player names on/off.',
        args = {},
        submit = 'Execute',
        permissions = {'1125449225069666377'}
    },
    {
        actions = {
            type = 'command',
            action = 'playernames'
        },
        name = 'player_names_ace',
        title = 'Player Names (ACE PERMS)',
        description = 'Toggle player names on/off.',
        args = {},
        submit = 'Execute',
        permissions = {'hamzstaff.playernames'}
    },
    {
        actions = {
            type = 'event',
            event = 'server',
            action = 'admin:invisible'
        },
        name = 'invisible',
        title = 'Toggle Cloak',
        description = 'Toggle your visibility.',
        args = {},
        submit = 'Execute',
        permissions = {'1125449225069666377'}
    }
}

CONFIG.SCREENSHOT = {
    SCREENSHOT_RESOURCE_NAME = 'screenshot-basic', -- The resource name for the screenshot
    CLIENT_SCREENSHOT_WEBHOOK = 'https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz1234567890', -- Webhook for the client screenshot, make a hidden channel or a channel in another server. Just in case someone abuses it
    SERVER_SCREENSHOT_WEBHOOK = 'https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz1234567890' -- The webhook that is shown to staff, this is the main webhook
}
```

### Things to be aware of

Below are some things you need to know while configuring the Admin Menu. The configuration is straightforward, but you must be mindful of a few things.

#### Debug

Set this to `true` if you are running into issues, that'll help you find exactly what's happening and what might be causing your problem.

#### URL

Ensure it begins with a "https\://" and ends with a "/". **SSL is required.**

#### Server Name

This must be the **same** name as the one set in your config.php. It must be **identical**. The panel supports multiple servers, so ensure you put in the right one.

Example:

If you have this in your **config.php**:

```php
'server_name' => 'Menu Server',
```

Then your server name would be this in your **config.lua**:

```lua
SERVER = 'Menu Server',
```

**Webhook logs**

This logs errors, in the future it'll log more.

#### UI Settings

SHOW\_STAFF - This function shows if a player is a staff member in the player's tab of the admin menu. It does this by checking if the player has logged into the panel.

SHOW\_INFO\_TYPE - Shows the label in the player's tab of the admin menu.&#x20;

#### Tell The World

If any of the values are set to true, this will show the action performed, to everyone in the server.

#### TxAdmin Warning

This utilises the `monitor` resource found in the server by default and triggers an event to display the TxAdmin warning message when someone is warned.

Credits to the txAdmin for making it, we just trigger the event.

#### Permissions

Discord Permissions are based on Discord roles and rely on Badger\_Discord\_API or any other script with the **same** exports.&#x20;

Ace permissions work like this:

```lua
add_ace group.admin hamzstaff.banplayer allow
add_ace group.staff hamzstaff.banplayer allow
add_ace group.moderator hamzstaff.banplayer allow

add_ace group.admin hamzstaff.kickplayer allow
add_ace group.staff hamzstaff.kickplayer allow
add_ace group.moderator hamzstaff.kickplayer allow

add_ace group.admin hamzstaff.noteplayer allow
add_ace group.staff hamzstaff.noteplayer allow
add_ace group.moderator hamzstaff.noteplayer allow

add_ace group.admin hamzstaff.commendplayer allow
add_ace group.staff hamzstaff.commendplayer allow
add_ace group.moderator hamzstaff.commendplayer allow

add_ace group.admin hamzstaff.warnplayer allow
add_ace group.staff hamzstaff.warnplayer allow
add_ace group.moderator hamzstaff.warnplayer allow

add_ace group.admin hamzstaff.getplayers allow # Allow's player to view the admin menu
add_ace group.staff hamzstaff.getplayers allow # Allow's player to view the admin menu
add_ace group.moderator hamzstaff.getplayers allow # Allow's player to view the admin menu

add_ace group.admin hamzstaff.summonplayer allow
add_ace group.staff hamzstaff.summonplayer allow
add_ace group.moderator hamzstaff.summonplayer allow

add_ace group.admin hamzstaff.teleportplayer allow
add_ace group.staff hamzstaff.teleportplayer allow
add_ace group.moderator hamzstaff.teleportplayer allow

add_ace group.admin hamzstaff.freezeplayer allow
add_ace group.staff hamzstaff.freezeplayer allow
add_ace group.moderator hamzstaff.freezeplayer allow

add_ace group.admin hamzstaff.teleportinvehicle allow
add_ace group.staff hamzstaff.teleportinvehicle allow
add_ace group.moderator hamzstaff.teleportinvehicle allow

add_ace group.admin hamzstaff.screenshotplayer allow
add_ace group.staff hamzstaff.screenshotplayer allow
add_ace group.moderator hamzstaff.screenshotplayer allow

add_ace group.admin hamzstaff.immune allow
add_ace group.staff hamzstaff.immune allow
add_ace group.moderator hamzstaff.immune allow
```

#### Discord Resource Name

Case-sensitive. Note not every discord permissions script will work, only the ones that have the same exports as `Badger_Discord_API`. If you do not know if your discord permissions script has those exports, just download Badger's resource: <https://github.com/JaredScar/Badger_Discord_API>

If you want to remove the annoying ad's, simply remove this from the `server.lua` in Badger's resource:

```lua
RegisterNetEvent('Badger_Discord_API:PlayerLoaded')
AddEventHandler('Badger_Discord_API:PlayerLoaded', function()
	if (GetCurrentResourceName() ~= "Badger_Discord_API") then 
		TriggerClientEvent('chatMessage', -1, '^1[^5SCRIPT ERROR^1] ^3The script ^1' .. GetCurrentResourceName() .. ' ^3will not work properly... You must '
	.. 'rename the resource to ^1Badger_Discord_API');
	end
	local license = GetIdentifier(source, 'license');
	if (tracked[license] == nil) then 
		tracked[license] = true;
		TriggerClientEvent('chatMessage', source, 
		'^1[^5Badger_Discord_API^1] ^3The Discord API script was created by Badger. You may join his Discord at: ^6discord.gg/WjB5VFz')
	end
	TriggerClientEvent('chatMessage', source, 
		'^7[^2Zap-Hosting^7] ^3Use code ^5TheWolfBadger-4765 ^3at checkout for ^220% ^3off of selected services. Visit ^5https://zap-hosting.com/badger ^3to get started!');
end)
```

#### Keybind

The keybind can be changed by staff in their FiveM settings even if you set it to a certain key.

#### Screenshot

You'll need screenshot-basic for this, if you renamed it, just change the name here.

### Options

This is a new feature of the admin menu, it allows you to add your own custom events and commands. **Note, that it is recommended to add additional checks to the provided events/commands.**

By default, we give you three custom options (two are the same), invisibility and player names. You can remove one of the player names. One of them uses ACE perms and the other uses Discord roles.

If you set **CONFIG.PERMISSIONS.TYPE** to `ACE`, the options will use ACE perms, if you set it to `DISCORD`, it'll use Discord roles.

This guide explains how to add custom commands and events.&#x20;

Add these new events/commands into your config, see the above config example.

#### Adding a command:

To add a new command to your server, follow these steps:

1. **Actions:**
   * Write `command` for the `type` .
   * The `action` should be the name of your command minus the (`/`). For instance, for `/playernames`, set the action to `playernames`
2. **Command Details:**
   * `name`: This identifier for your command must be unique and cannot contain spaces. Make sure each option has a different `name`.
   * `title`: The name that will appear in the menu.
   * `description`: A brief description of what the command does, this will also appear under the `title` in the menu.
3. **Configure Args** (Optional):

   * Add additional settings such as inputs or checkboxes. Actions are configured with a `type` and a `sortOrder` which determines their order of appearance.&#x20;
   * `sortOrder`: This number indicates the order in which the inputs appear during command configuration.

   Here’s an example of different types:

```lua
args = {
    {
        type = 'input-number',
        title = 'Player ID',
        sortOrder = 1
    },
    {
        type = 'dropdown',
        title = 'Effect',
        sortOrder = 2,
        args = {
            {value = 'sparkle', label = 'Sparkle'},
            {value = 'flash', label = 'Flash'},
            {value = 'glow', label = 'Glow'}
        }
    },
    {
        type = 'checkbox',
        title = 'Enable effect for all?',
        sortOrder = 3
    },
    {
        type = 'input-string',
        title = 'Announcement',
        sortOrder = 4
    }
}

```

4. **Submit Button**:
   * `submit`: This is the label on the button used to execute the command, e.g., `Apply`.
5. **Set Permissions**:
   * `permissions`: Specify permissions needed to view and execute the command. Use role IDs for Discord permissions or specific strings for ACE permissions. Leave it empty if you want anyone who has permission to open the menu to access this option.

Example configuration for a custom command:

```lua
{
    actions = {
        type = 'command',
        action = 'showplayernames'
    },
    name = 'show_player_names',  // Notice no spaces
    title = 'Show Player Names',
    description = 'Toggle visibility of player names.',
    args = {
        {
            type = 'input-number',
            title = 'Player ID',
            sortOrder = 1
        }
    },
    submit = 'Apply',
    permissions = {'1125449225069666377'}
}

```

**Adding a Custom Event**

Adding an event is similar to adding a command, with a few distinctions:

1. **Actions**:
   * Use `event` for the `type`.
   * Specify the `action` as the event name and the `event` as either `server` or `client`.
2. **Event Details**:
   * `name`: The unique identifier for your event, also cannot contain spaces. Make sure each option has a different `name`.
3. **Configure Args** (Optional):
   * Include configurations such as inputs:

```lua
args = {
    {
        type = 'input-number',
        title = 'Target ID',
        sortOrder = 1
    }
}
```

4. **Submit Button**:
   * `submit`: Label the button that triggers the event, such as `Execute`.
5. **Set Permissions**:
   * Define access, in the same way as the commands.

Example configuration for a custom event:

```lua
{
    actions = {
        type = 'event',
        action = 'server:toggleInvisibility',
        event = 'server'
    },
    name = 'toggle_invisibility',  // No spaces
    title = 'Toggle Invisibility',
    description = 'Make yourself invisible.',
    args = {
        {
            type = 'input-number',
            title = 'Target ID',
            sortOrder = 1
        }
    },
    submit = 'Trigger',
    permissions = {}
}
```

By following these instructions, you can effectively add and configure your own commands and events. If any questions arise, feel free to refer back to this guide or create a ticket within our discord.

Your config should now look something like this, of course with your new commands/events.

```lua
CONFIG.OPTIONS = {
    {
        actions = {
            type = 'command',
            action = 'playernames'
        },
        name = 'player_names',
        title = 'Player Names (DISCORD PERMS)',
        description = 'Toggle player names on/off.',
        args = {},
        submit = 'Execute',
        permissions = {'1125449225069666377'}
    },
    {
        actions = {
            type = 'event',
            event = 'server',
            action = 'admin:invisible'
        },
        name = 'invisible',
        title = 'Toggle Cloak',
        description = 'Toggle your visibility.',
        args = {},
        submit = 'Execute',
        permissions = {'1125449225069666377'}
    },
    {
        actions = {
            type = 'command',
            action = 'setweather'
        },
        name = 'set_weather',
        title = 'Change Weather',
        description = 'Allows you to change the current weather on the server.',
        args = {
            {
                type = 'dropdown',
                title = 'Weather Type',
                sortOrder = 1,
                args = {
                    {value = 'sunny', label = 'Sunny'},
                    {value = 'rain', label = 'Rain'},
                    {value = 'fog', label = 'Fog'}
                }
            }
        },
        submit = 'Apply',
        permissions = {'weather.change'}
    },
    {
        actions = {
            type = 'event',
            event = 'server',
            action = 'spawnVehicle'
        },
        name = 'spawnVehicle',
        title = 'Spawn Vehicle',
        description = 'Spawns a selected vehicle near you.',
        args = {
            {
                type = 'input-string',
                title = 'Vehicle Model',
                sortOrder = 1
            },
            {
                type = 'input-number',
                title = 'Number of Vehicles',
                sortOrder = 2
            },
            {
                type = 'checkbox',
                title = 'Spawn with Full Fuel?',
                sortOrder = 3
            }
        },
        submit = 'Spawn',
        permissions = {'vehicle.spawn'}
    }
}
```

*Shout out to my boy chatgpt for the options guide.*


# Common Issues

Common issues and fixes for those issues

{% hint style="danger" %}
If you have any issues, check this page, also make sure you configured the script correctly, and visit:

* &#x20;[In-Game Configuration - Report Menu](/hamz-staff-elite-panel/in-game-configuration-report-menu)
* [In-Game Configuration - Admin Menu](/hamz-staff-elite-panel/in-game-configuration-admin-menu)&#x20;

for help in configuring your resources.
{% endhint %}

### 1. No players in the admin menu

Your server name does not match the one in the config.php. Visit [In-Game Configuration - Admin Menu](/hamz-staff-elite-panel/in-game-configuration-admin-menu), and make sure you set the server name the same way it states.

### 2. Being spammed with an error in my server console!!

Check your config files (config.php and config.lua) and make sure they are set up correctly. Visit [In-Game Configuration - Report Menu](/hamz-staff-elite-panel/in-game-configuration-report-menu) and [In-Game Configuration - Admin Menu](/hamz-staff-elite-panel/in-game-configuration-admin-menu) to confirm that you have done everything right.&#x20;

If everything is correct, you'll most likely need to do the following [\[OPTIONAL\] Apache Headers](/hamz-cad-in-game/optional-apache-headers)

### 3. I get "Missing Parameters" error on the panel.

You are getting this error because the panel cannot access your database; this could be because of incorrect credentials or improper permissions.

### 4. I get duplicated data in the database

If you're using more recent server artifact versions, you'll need to add a code snippet into the `server.cfg` file.

```
sv_exposePlayerIdentifiersInHttpEndpoint 1
```

{% hint style="info" %}
For certain individuals, if you run into an issue. <mark style="color:red;">**DO NOT SKIP THE STEP**</mark>; figure out why it's not working, then move on to the next installation step.
{% endhint %}


# \[OPTIONAL] Apache Headers

{% hint style="warning" %}
It has come to our attention that a limited number of hosting providers may inadvertently strip certain essential headers from incoming requests for security reasons. Unfortunately, this can result in authentication-related problems, causing issues with our product during operation. To fix this issue, follow the guide below.
{% endhint %}

* Open the location of the Staff Panel Web Files.
* Turn on hidden files.
* You should see a `.htaccess` file. Open that file and add the following at the very bottom of the file:

```
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
```


# FAQ

### 1. Can I update the default player trust score?

Yes! Follow the steps below:

1. Login to PHPMyAdmin
2. Select the database that contains the Staff Panel
3. Click on the `players` table
4. Click **"Structure"**
5. On line 13 Trustscore, click **"Change"**
6. In **"Default"** change the value `100` to a number you'd like, for example: `50`
7. Click **"Save"**

### 2. I can't find the FiveM script in my Keymaster.

The FiveM script should appear in your Keymaster under the name **Report & Staff Menu - FiveM Resource**


# Requirements

This page will list the requirements that are required to run any Hamz Development product.

* Web Server to host the site such as Nginx, Apache, Shared Hostings (cPanel or DirectAdmin) or Other Web Hosting.
* Web Server must have PHP installed and modules.
* Must support php version 7.2 or 7.4
* MySQL Server.
* FiveM Server

**Recommended**

Web Hosting: [Hamz Hosting](https://hamzhosting.com)


# Installation


# Database and SQL

We will be using a Shared Hosting package, login to cPanel. \
(Recommened hosting - [HamzHosting](https://hamzhosting.com))

Head to the MySQL Databases in cPanel.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FUsRzMs2SkmSrQN9Lw5k5%2FScreenshot_1.png?alt=media&amp;token=3b43f256-8ee1-457f-bbcf-1fdb648678c7" alt=""><figcaption></figcaption></figure>

Now, after clicking on the button you will create a new MySQL Database. You can do so by simply typing the name of your Database and hitting "Create Database".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F6207R1QYlAq7LZx3Iqr7%2FScreenshot_2.png?alt=media&amp;token=501fd84c-cb5c-4e07-861a-3060fc240fdf" alt=""><figcaption></figcaption></figure>

Fill in the name that you want to call your database and then we will create the admin user that can access the Database, you will need this for the next few steps.

You now want to head to the bottom of the page in your MySQL Databases and "Create a user".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FxGbtx3L3gis5N0W1Pn7a%2FScreenshot_3.png?alt=media&amp;token=bf0bd2c0-9c97-42a4-8e74-4afd1bf8d1f7" alt=""><figcaption></figcaption></figure>

Ensure that the password you put here is written down elsewhere and put aside for further steps.

After creating your admin user, you now want to give that user admin access to your chosen Database. On the same page, navigate "Add User To Database", you will see the "user" and the "database".&#x20;

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FhfoI2yQHNj9hhnWgex7C%2FScreenshot_4.png?alt=media&amp;token=7e6a6a64-db1d-4855-b95e-fe97b1066358" alt=""><figcaption></figcaption></figure>

After adding the user, you will be prompted with a Privileges page, you will want to chose the top option "All Privileges". You then want to press "Make Changes".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F2afEVapl72FDUd24u6uD%2FScreenshot_5.png?alt=media&amp;token=9ca1f762-319e-4965-ab11-581284e1e45f" alt=""><figcaption></figcaption></figure>

Now that you have created your Database and your Admin user, you want to upload your SQL. You can head back to the main page in cPanel and find the "PHPMyAdmin" button right near your "MySQL Databases" button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FeyLDS7og8Fh9x6g1HLF7%2FScreenshot_6.png?alt=media&amp;token=ca417df1-f503-421a-88e2-12f8bbacd3cd" alt=""><figcaption></figcaption></figure>

When you have logged into your PHPMyAdmin, you will see a list of Databases on the left side of your screen. You will see the Database you created, click on it. After clicking on your Database, you will see a few options at the top as shown in the picture below. You want to chose the "Import" option.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F8CVHEf6dTzUDhVvlt4x2%2FScreenshot_7.png?alt=media&amp;token=73fbdefd-0877-40f1-9a0f-9178e43d866e" alt=""><figcaption></figcaption></figure>

After clicking into "Import" you will be asked to "Choose File", You can find your SQL file provided in your downloaded product typically in it's own "SQL" folder. You will select and upload that file.

You've now completed your Database and SQL installation, please continue.


# SubDomain

Feel free to skip to the next step if you do not wish to use a SubDomain.

For your Subdomain, head to the main page of cPanel and look for "Domains" or "Sub Domains" (Depending on what cPanel theme you are on).

<div align="center"><figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F1UzZnhvsmiBVmcPexZQc%2FScreenshot_8.png?alt=media&amp;token=a7709dc0-4174-4c07-b787-3ab77623334d" alt=""><figcaption></figcaption></figure> <figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FGkzsgkj3LqoHjpkcS7Ru%2FScreenshot_9.png?alt=media&amp;token=3507d869-e089-4f8d-91f4-b0e091f67686" alt=""><figcaption></figcaption></figure></div>

When inside your Subdomain page, you'll want to chose your subdomain by simply typing the phrase it's self. example: "cad".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FqmhAlSEtlrB1CD7CNi4U%2FScreenshot_10.png?alt=media&amp;token=d9934620-c241-4d09-bb81-9718102e6785" alt=""><figcaption></figcaption></figure>

cPanel will automatically generate the file directory for this subdomain. (Can be changed and customized at anytime)


# Uploading Files

Now, to upload your files you will want to head back to the main page of cPanel and locate your "File Manager".

Now inside of your File Manager you will want to navigate into public\_html. (If you are using a SubDomain then locate to it's file location set upon creation).&#x20;

Once inside your file location, to upload your files you will have to chose the "Upload Files" button at the top and chose your Hamz Product .zip file. You will now want to extract those files and move everything from "WebFiles" into your main directory. (Public\_html or your SubDomain file location).


# SSL Certification

Now you want to secure your website by install a "SSL", you can do this by going back to the home page of cPanel and locating the "SSL/TLS Status" Button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F6u7xP9gFWm3ygIoCuKR5%2FScreenshot_11.png?alt=media&amp;token=813ac410-ee86-49d3-a3f4-a844cee1fccf" alt=""><figcaption></figcaption></figure>

Once inside, chose the top option that selects all domains. Once you have them all selected, click "Run AutoSSL".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F1b99N0WCl6kZE7eeuA3Y%2FScreenshot_12.png?alt=media&amp;token=c47f5919-e03d-4d0d-a866-aabc29e5383f" alt=""><figcaption></figcaption></figure>

Now after a few minutes, your SSL will be installed and your website will be secure!

**Installation now complete, please move to the Configuration setup.**


# Cron Job

Setup a 1-minute cron job to the `actions/cron-playtime.php` location.


# Configuration

**Step 1 - Locating the config.php file**

Locate the config.php file inside of File Manager. This will be in public\_html or the sub folder. When you have located the config file double click it to open the file and edit it.

**Step 2 - Base URL**

The base url can be located at the top of the config file

```
// Panel URL \\
define('BASE_URL', 'https://localhost/hamzcad');
```

Replace the base url with your link. IMPORTANT: Make sure there is no `/` at the end of the base url.

**Step 3 - SQL DATABASE CONNECTION**

```
// SQL DATABASE CONNECTION \\
define('DB_HOST', 'localhost'); // Keep this unless your db is hosted elsewhere
define('DB_USER', 'root'); // Replace root with DB username
define('DB_PASSWORD', ''); // Add DB Password inside of the ''
define('DB_NAME', 'hamzproduct'); // Replace hamzcad with DB name
```

**Step 4 - DISCORD OAUTH2**

```
// DISCORD OAUTH2 \\
define('TOKEN', 'TOKEN-HERE');
define('GUILD_ID', 'GUILD-ID-HERE');
define('OAUTH2_CLIENT_ID', 'CLIENT-ID-HERE');
define('OAUTH2_CLIENT_SECRET', 'CLIENT-SECRET-HERE');
```

Head to the [Discord Developer Portal](https://discord.com/developers/applications).

Create a application.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2Fajmd5GKJgYtgmFoCcUHt%2Fnewapp.png?alt=media&amp;token=ecf8c3d0-fea4-42b1-bba2-2deaa621925c" alt=""><figcaption></figcaption></figure>

First we will get the bot token. Head to the bot navigation on your application and create the bot. When you have created the bot click on the Copy button under the token.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FzudrqqzlglqqD4Ezh0T0%2Ftoken.png?alt=media&amp;token=791664d1-935e-4cd1-915f-f39ca9c93e5b" alt=""><figcaption></figcaption></figure>

Now that you have that copied replace TOKEN-HERE with the token you have copied.

Guild ID. = Right click on your servers profile image on discord and press COPY ID if this is not a option you will have to enable developer mode in the discord settings.

Now replace GUILD-ID-HERE with the ID you now have copied.

OAUTH2 CLIENT ID. = On the dev portal head to OAuth2 section.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F4J05iHagzjF80mRE232N%2Fauth2.png?alt=media&amp;token=253398d8-0b60-4f77-95ea-4924c4415cb5" alt=""><figcaption></figcaption></figure>

Now head to the client id and press the copy button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FnV4gozqrcpwb18as0xrm%2F9c27828eeca433d37709300a0690fbf7.png?alt=media&amp;token=e033912e-d9ea-449f-89bd-b396f954abfb" alt=""><figcaption></figcaption></figure>

Now replace the OAUTH2\_CLIENT\_ID with the ID you have copied.

OAUTH2 CLIENT SECRET = On the dev portal OAuth2 section copy the secret key.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FpK7skQwUfUUfYkrErC0V%2Fsecret.png?alt=media&amp;token=ea0c5f9a-dc05-4a89-8709-f39c04c5c2bb" alt=""><figcaption></figcaption></figure>

Now replace OAUTH2\_CLIENT\_SECRET with what you have copied.

Make sure that the application is inside your discord server. You can do that via the below link.

> [https://discordapp.com/oauth2/authorizeclient\_id=CLIENT\_ID\_HERE\&scope=bot\&permissions=0](https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID_HERE\&scope=bot\&permissions=0)\
> Replace CLIENTIDHERE with the applications client ID.

Finally, Set the **OAuth2 Redirect** here: (link + /actions/register.php)

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FMtdAKWbTrcXZs9iiKZN0%2Fredir.png?alt=media&amp;token=e7473720-a70b-4c0f-9888-fa6fe3fc7d3f" alt=""><figcaption></figcaption></figure>

**Step 5 - DISCORD LOGS**&#x20;

```
// DISCORD LOGS \\
define('LOGS_IMAGE', 'https://imgur.com/yaHpliD.png'); // Replace with direct image link.  
define('LOGS_COLOR', '#00B2FF'); // Replace with a color to your liking. You can just search #00B2FF on google and it will give you a color tool picker.

// Channel ID's \\
define('WARN_LOGS', 'CHANNEL_ID_HERE');
define('KICK_LOGS', 'CHANNEL_ID_HERE');
define('BAN_LOGS', 'CHANNEL_ID_HERE');
define('COMMEND_LOGS', 'CHANNEL_ID_HERE');
define('NOTE_LOGS', 'CHANNEL_ID_HERE');
define('REMOVEBAN_LOGS', 'CHANNEL_ID_HERE');
define('REMOVEWARN_LOGS', 'CHANNEL_ID_HERE');
define('REMOVEKICK_LOGS', 'CHANNEL_ID_HERE');
define('REMOVECOMMEND_LOGS', 'CHANNEL_ID_HERE');
define('REMOVENOTE_LOGS', 'CHANNEL_ID_HERE');
define('STRIKE_LOGS', 'CHANNEL_ID_HERE');
define('REMOVESTRIKE_LOGS', 'CHANNEL_ID_HERE');
define('BROADCAST_LOGS', 'CHANNEL_ID_HERE');
define('LOGIN_LOGS', 'CHANNEL_ID_HERE');
define('REMOVEOLDNAME_LOGS', 'CHANNEL_ID_HERE');
define('REMOVESTAFF_LOGS', '842158704056074249');  
```

Channel ID logs use the bot so no webhooks. Set the channel ID where you like the log option to be logged at.

**Step 6 - GENERAL**

```
// GENERAL \\
define('SERVER_NAME', 'SERVERNAMEHERE'); // Replace with server name.
define('SECRET', 'CUSTOMSECRETHERE'); // Set a custom secret, This will be used in the ingame resource later. 
define('STEAM_API', 'STEAMAPIKEYHERE'); // https://steamcommunity.com/dev/apikey
define('ACCENT_COLOR', '#00B2FF'); // Change color here
define('ENABLE_RESOURCES', true); // Enables the resource tab in the panel.
define('ENABLE_BROADCAST', true); /: Enables the broadcast system in the panel.
```

**Step 7 - IP/SERVER SETUP**

```
// IP Stuff
$SERVERS = array(
	[
		'server_name' => 'Server 1', // Name server here, Do not add a # in this field as this will not work. 
		'server_ip' => '127.0.0.1', // Replace with server IP
		'server_port' => '30120', // Replace with server Port
		'server_rcon_pass' => 'rcon_pass_here' // Replace with rconpassword
	],
	// [
	// 	'server_name' => 'Server 2',
	// 	'server_ip' => '127.0.0.1',
	// 	'server_port' => '30121',
	// 	'server_rcon_pass' => 'rcon_pass_here'
	// ]
);
```

**Step 8 - TRUSTSCORE VALUES**

Modifying these values will effect the players trustscore when the action has been taken against them. Feel free to change the values to what you like. **KEEP THE FORMAT!!!**

```
 // Trustscore Values
define('WARN_SCORE', '4');
define('KICK_SCORE', '20');
define('BAN_SCORE', '12');
define('COMMEND_SCORE', '4');
define('PERMBAN_TRUSTSCORE', '0');
define('PERMBAN_TRUSTSCORE_MASSAGE', 'YOUR TRUSTSCORE IS LOWER THAN THIS SERVERS MINIMUM REQUIREMENT.');
```

**Step 9 - DOCUMENTS**

Format = "NAME" => "link to doc",

```
 // Document Links
$DOCS = [
	"Server Rules" => "https://docs.hamz.dev",
	"Server Penal Code" => "https://docs.hamz.dev",
];
```

**Step 10 - PERMISSIONS**

```
// ALL PERMISSIONS
    'STAFFROLEIDHERE' => [
        'AddNote', // Add Notes to users profile
        'RemoveNote', // Remove Notes on user profile records
        'AddWarn', // Add Warnings / Warn users
        'RemoveWarn', // Remove warnings from user profile records
        'AddKick', // Kick users
        'RemoveKick', // Remove kicks from user profile records
        'AddTempBan', // Temp Ban users
        'AddPermBan', // Perm Ban users
        'RemoveBan', // Remove Bans from user profile records
        'AddCommend', // Add a commend on a users profile record
        'RemoveCommend', // Remove a commend from a users profile record
        'ViewOldNames', // Allow to view users previous names. This is located on users profile 
        'RemoveOldNames', // Remove old names from users profile records
        'Broadcast', // Send / Create broadcast messages
        'ViewStaffSection', // View staff section / Staff Profiles / Staff stats
        'RemoveStrike', // Remove strikes from staff profiles
        'RemoveStaff', // Remove staff from panel
        'ManageServerResources', // Allow the server resources tab
    ],
```

**KEEP THE FORMAT!!!**\
Modify to fit your staff roles.\
You can remove a permission from just removing the permission line.\
To add more just copy and paste under `],`


# FiveM Resource

**Step 1 - ADDING THE RESOURCE**

Add the `hamz-panel` resource into the resource folder. The resource can be located in the product download FIVEM SCRIPTS folder.

**Step 2 - Configuring the** `hamz-panel` **resource.**

Open the `config.lua` and edit to your liking

**Step 3 - Installing the requirements**

**3.1 - RCON**

**E**nable rcon and set the password.\
add these 2 lines in your `server.cfg`

`ensure rconlog`\
`rcon_password "PASSWORDHERE"`

rconlog is a default FiveM resource. But is also provided in the download.

3.2 - Badger Discord API

Download badgers discord api: [link](https://github.com/JaredScar/Badger_Discord_API)\
Install and configure his API resource: [Badgers Documentation](https://docs.badger.store/fivem-discord-scripts/badger_discord_api)

**Step 4 - Extra Info**

4.1 - Not Authorized error?

If you get a error that you are not authorized to use the resource then create a ticket so we can whitelist your server IP.

4.2 - Still getting a Not Authorized error

Make sure the resource is named `hamz-panel` renaming the resource will not work.


# Requirements

This page will list the requirements that are required to run any Hamz Development product.

* Web Server to host the site such as Nginx, Apache, Shared Hostings (cPanel or DirectAdmin) or Other Web Hosting.
* Web Server must have PHP installed and modules.
* Must support php version 7.2 or 7.4
* MySQL Server.


# Installation


# Database and SQL

We will be using a Shared Hosting package, login to cPanel. \
(Recommened hosting - [HamzHosting](https://hamzhosting.com))

Head to the MySQL Databases in cPanel.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FUsRzMs2SkmSrQN9Lw5k5%2FScreenshot_1.png?alt=media&amp;token=3b43f256-8ee1-457f-bbcf-1fdb648678c7" alt=""><figcaption></figcaption></figure>

Now, after clicking on the button you will create a new MySQL Database. You can do so by simply typing the name of your Database and hitting "Create Database".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F6207R1QYlAq7LZx3Iqr7%2FScreenshot_2.png?alt=media&amp;token=501fd84c-cb5c-4e07-861a-3060fc240fdf" alt=""><figcaption></figcaption></figure>

Fill in the name that you want to call your database and then we will create the admin user that can access the Database, you will need this for the next few steps.

You now want to head to the bottom of the page in your MySQL Databases and "Create a user".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FxGbtx3L3gis5N0W1Pn7a%2FScreenshot_3.png?alt=media&amp;token=bf0bd2c0-9c97-42a4-8e74-4afd1bf8d1f7" alt=""><figcaption></figcaption></figure>

Ensure that the password you put here is written down elsewhere and put aside for further steps.

After creating your admin user, you now want to give that user admin access to your chosen Database. On the same page, navigate "Add User To Database", you will see the "user" and the "database".&#x20;

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FhfoI2yQHNj9hhnWgex7C%2FScreenshot_4.png?alt=media&amp;token=7e6a6a64-db1d-4855-b95e-fe97b1066358" alt=""><figcaption></figcaption></figure>

After adding the user, you will be prompted with a Privileges page, you will want to chose the top option "All Privileges". You then want to press "Make Changes".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F2afEVapl72FDUd24u6uD%2FScreenshot_5.png?alt=media&amp;token=9ca1f762-319e-4965-ab11-581284e1e45f" alt=""><figcaption></figcaption></figure>

Now that you have created your Database and your Admin user, you want to upload your SQL. You can head back to the main page in cPanel and find the "PHPMyAdmin" button right near your "MySQL Databases" button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FeyLDS7og8Fh9x6g1HLF7%2FScreenshot_6.png?alt=media&amp;token=ca417df1-f503-421a-88e2-12f8bbacd3cd" alt=""><figcaption></figcaption></figure>

When you have logged into your PHPMyAdmin, you will see a list of Databases on the left side of your screen. You will see the Database you created, click on it. After clicking on your Database, you will see a few options at the top as shown in the picture below. You want to chose the "Import" option.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F8CVHEf6dTzUDhVvlt4x2%2FScreenshot_7.png?alt=media&amp;token=73fbdefd-0877-40f1-9a0f-9178e43d866e" alt=""><figcaption></figcaption></figure>

After clicking into "Import" you will be asked to "Choose File", You can find your SQL file provided in your downloaded product typically in it's own "SQL" folder. You will select and upload that file.

You've now completed your Database and SQL installation, please continue.


# SubDomain

Feel free to skip to the next step if you do not wish to use a SubDomain.

For your Subdomain, head to the main page of cPanel and look for "Domains" or "Sub Domains" (Depending on what cPanel theme you are on).

<div align="center"><figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F1UzZnhvsmiBVmcPexZQc%2FScreenshot_8.png?alt=media&amp;token=a7709dc0-4174-4c07-b787-3ab77623334d" alt=""><figcaption></figcaption></figure> <figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FGkzsgkj3LqoHjpkcS7Ru%2FScreenshot_9.png?alt=media&amp;token=3507d869-e089-4f8d-91f4-b0e091f67686" alt=""><figcaption></figcaption></figure></div>

When inside your Subdomain page, you'll want to chose your subdomain by simply typing the phrase it's self. example: "cad".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FqmhAlSEtlrB1CD7CNi4U%2FScreenshot_10.png?alt=media&amp;token=d9934620-c241-4d09-bb81-9718102e6785" alt=""><figcaption></figcaption></figure>

cPanel will automatically generate the file directory for this subdomain. (Can be changed and customized at anytime)


# Uploading Files

Now, to upload your files you will want to head back to the main page of cPanel and locate your "File Manager".

Now inside of your File Manager you will want to navigate into public\_html. (If you are using a SubDomain then locate to it's file location set upon creation).&#x20;

Once inside your file location, to upload your files you will have to chose the "Upload Files" button at the top and chose your Hamz Product .zip file. You will now want to extract those files and move everything from "WebFiles" into your main directory. (Public\_html or your SubDomain file location).


# SSL Certification

Now you want to secure your website by install a "SSL", you can do this by going back to the home page of cPanel and locating the "SSL/TLS Status" Button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F6u7xP9gFWm3ygIoCuKR5%2FScreenshot_11.png?alt=media&amp;token=813ac410-ee86-49d3-a3f4-a844cee1fccf" alt=""><figcaption></figcaption></figure>

Once inside, chose the top option that selects all domains. Once you have them all selected, click "Run AutoSSL".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F1b99N0WCl6kZE7eeuA3Y%2FScreenshot_12.png?alt=media&amp;token=c47f5919-e03d-4d0d-a866-aabc29e5383f" alt=""><figcaption></figcaption></figure>

Now after a few minutes, your SSL will be installed and your website will be secure!

**Installation now complete, please move to the Configuration setup.**


# Configuration

**Step 1 - Locating the config.php file**

Locate the config.php file inside of File Manager. This will be in public\_html or the sub folder. When you have located the config file double click it to open the file and edit it.

**Step 2 - Base URL**

The base url can be located at the top of the config file

```
// Panel URL \\
define('BASE_URL', 'https://localhost/hamzcad');
```

Replace the base url with your link. IMPORTANT: Make sure there is no `/` at the end of the base url.

**Step 3 - SQL DATABASE CONNECTION**

```
// SQL DATABASE CONNECTION \\
define('DB_HOST', 'localhost'); // Keep this unless your db is hosted elsewhere
define('DB_USER', 'root'); // Replace root with DB username
define('DB_PASSWORD', ''); // Add DB Password inside of the ''
define('DB_NAME', 'hamzproduct'); // Replace hamzcad with DB name
```

**Step 4 - DISCORD OAUTH2**

```
// DISCORD OAUTH2 \\
define('TOKEN', 'TOKEN-HERE');
define('GUILD_ID', 'GUILD-ID-HERE');
define('OAUTH2_CLIENT_ID', 'CLIENT-ID-HERE');
define('OAUTH2_CLIENT_SECRET', 'CLIENT-SECRET-HERE');
```

Head to the [Discord Developer Portal](https://discord.com/developers/applications).

Create a application.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2Fajmd5GKJgYtgmFoCcUHt%2Fnewapp.png?alt=media&amp;token=ecf8c3d0-fea4-42b1-bba2-2deaa621925c" alt=""><figcaption></figcaption></figure>

First we will get the bot token. Head to the bot navigation on your application and create the bot. When you have created the bot click on the Copy button under the token.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FzudrqqzlglqqD4Ezh0T0%2Ftoken.png?alt=media&amp;token=791664d1-935e-4cd1-915f-f39ca9c93e5b" alt=""><figcaption></figcaption></figure>

Now that you have that copied replace TOKEN-HERE with the token you have copied.

Guild ID. = Right click on your servers profile image on discord and press COPY ID if this is not a option you will have to enable developer mode in the discord settings.

Now replace GUILD-ID-HERE with the ID you now have copied.

OAUTH2 CLIENT ID. = On the dev portal head to OAuth2 section.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F4J05iHagzjF80mRE232N%2Fauth2.png?alt=media&amp;token=253398d8-0b60-4f77-95ea-4924c4415cb5" alt=""><figcaption></figcaption></figure>

Now head to the client id and press the copy button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FnV4gozqrcpwb18as0xrm%2F9c27828eeca433d37709300a0690fbf7.png?alt=media&amp;token=e033912e-d9ea-449f-89bd-b396f954abfb" alt=""><figcaption></figcaption></figure>

Now replace the OAUTH2\_CLIENT\_ID with the ID you have copied.

OAUTH2 CLIENT SECRET = On the dev portal OAuth2 section copy the secret key.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FpK7skQwUfUUfYkrErC0V%2Fsecret.png?alt=media&amp;token=ea0c5f9a-dc05-4a89-8709-f39c04c5c2bb" alt=""><figcaption></figcaption></figure>

Now replace OAUTH2\_CLIENT\_SECRET with what you have copied.

Make sure that the application is inside your discord server. You can do that via the below link.

> [https://discordapp.com/oauth2/authorizeclient\_id=CLIENT\_ID\_HERE\&scope=bot\&permissions=0](https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID_HERE\&scope=bot\&permissions=0)\
> Replace CLIENTIDHERE with the applications client ID.

Finally, Set the **OAuth2 Redirect** here: (link + /actions/register.php)

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FMtdAKWbTrcXZs9iiKZN0%2Fredir.png?alt=media&amp;token=e7473720-a70b-4c0f-9888-fa6fe3fc7d3f" alt=""><figcaption></figcaption></figure>


# Requirements

This page will list the requirements that are required to run any Hamz Development product.

* Web Server to host the site such as Nginx, Apache, Shared Hostings (cPanel or DirectAdmin) or Other Web Hosting.
* Web Server must have PHP installed and modules.
* Must support php version 7.2 or 7.4
* MySQL Server.


# Installation


# Database and SQL

We will be using a Shared Hosting package, login to cPanel. \
(Recommened hosting - [HamzHosting](https://hamzhosting.com))

Head to the MySQL Databases in cPanel.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FUsRzMs2SkmSrQN9Lw5k5%2FScreenshot_1.png?alt=media&amp;token=3b43f256-8ee1-457f-bbcf-1fdb648678c7" alt=""><figcaption></figcaption></figure>

Now, after clicking on the button you will create a new MySQL Database. You can do so by simply typing the name of your Database and hitting "Create Database".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F6207R1QYlAq7LZx3Iqr7%2FScreenshot_2.png?alt=media&amp;token=501fd84c-cb5c-4e07-861a-3060fc240fdf" alt=""><figcaption></figcaption></figure>

Fill in the name that you want to call your database and then we will create the admin user that can access the Database, you will need this for the next few steps.

You now want to head to the bottom of the page in your MySQL Databases and "Create a user".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FxGbtx3L3gis5N0W1Pn7a%2FScreenshot_3.png?alt=media&amp;token=bf0bd2c0-9c97-42a4-8e74-4afd1bf8d1f7" alt=""><figcaption></figcaption></figure>

Ensure that the password you put here is written down elsewhere and put aside for further steps.

After creating your admin user, you now want to give that user admin access to your chosen Database. On the same page, navigate "Add User To Database", you will see the "user" and the "database".&#x20;

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FhfoI2yQHNj9hhnWgex7C%2FScreenshot_4.png?alt=media&amp;token=7e6a6a64-db1d-4855-b95e-fe97b1066358" alt=""><figcaption></figcaption></figure>

After adding the user, you will be prompted with a Privileges page, you will want to chose the top option "All Privileges". You then want to press "Make Changes".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F2afEVapl72FDUd24u6uD%2FScreenshot_5.png?alt=media&amp;token=9ca1f762-319e-4965-ab11-581284e1e45f" alt=""><figcaption></figcaption></figure>

Now that you have created your Database and your Admin user, you want to upload your SQL. You can head back to the main page in cPanel and find the "PHPMyAdmin" button right near your "MySQL Databases" button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FeyLDS7og8Fh9x6g1HLF7%2FScreenshot_6.png?alt=media&amp;token=ca417df1-f503-421a-88e2-12f8bbacd3cd" alt=""><figcaption></figcaption></figure>

When you have logged into your PHPMyAdmin, you will see a list of Databases on the left side of your screen. You will see the Database you created, click on it. After clicking on your Database, you will see a few options at the top as shown in the picture below. You want to chose the "Import" option.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F8CVHEf6dTzUDhVvlt4x2%2FScreenshot_7.png?alt=media&amp;token=73fbdefd-0877-40f1-9a0f-9178e43d866e" alt=""><figcaption></figcaption></figure>

After clicking into "Import" you will be asked to "Choose File", You can find your SQL file provided in your downloaded product typically in it's own "SQL" folder. You will select and upload that file.

You've now completed your Database and SQL installation, please continue.


# SubDomain

Feel free to skip to the next step if you do not wish to use a SubDomain.

For your Subdomain, head to the main page of cPanel and look for "Domains" or "Sub Domains" (Depending on what cPanel theme you are on).

<div align="center"><figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F1UzZnhvsmiBVmcPexZQc%2FScreenshot_8.png?alt=media&amp;token=a7709dc0-4174-4c07-b787-3ab77623334d" alt=""><figcaption></figcaption></figure> <figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FGkzsgkj3LqoHjpkcS7Ru%2FScreenshot_9.png?alt=media&amp;token=3507d869-e089-4f8d-91f4-b0e091f67686" alt=""><figcaption></figcaption></figure></div>

When inside your Subdomain page, you'll want to chose your subdomain by simply typing the phrase it's self. example: "cad".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FqmhAlSEtlrB1CD7CNi4U%2FScreenshot_10.png?alt=media&amp;token=d9934620-c241-4d09-bb81-9718102e6785" alt=""><figcaption></figcaption></figure>

cPanel will automatically generate the file directory for this subdomain. (Can be changed and customized at anytime)


# Uploading Files

Now, to upload your files you will want to head back to the main page of cPanel and locate your "File Manager".

Now inside of your File Manager you will want to navigate into public\_html. (If you are using a SubDomain then locate to it's file location set upon creation).&#x20;

Once inside your file location, to upload your files you will have to chose the "Upload Files" button at the top and chose your Hamz Product .zip file. You will now want to extract those files and move everything from "WebFiles" into your main directory. (Public\_html or your SubDomain file location).


# SSL Certification

Now you want to secure your website by install a "SSL", you can do this by going back to the home page of cPanel and locating the "SSL/TLS Status" Button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F6u7xP9gFWm3ygIoCuKR5%2FScreenshot_11.png?alt=media&amp;token=813ac410-ee86-49d3-a3f4-a844cee1fccf" alt=""><figcaption></figcaption></figure>

Once inside, chose the top option that selects all domains. Once you have them all selected, click "Run AutoSSL".

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F1b99N0WCl6kZE7eeuA3Y%2FScreenshot_12.png?alt=media&amp;token=c47f5919-e03d-4d0d-a866-aabc29e5383f" alt=""><figcaption></figcaption></figure>

Now after a few minutes, your SSL will be installed and your website will be secure!

**Installation now complete, please move to the Configuration setup.**


# Configuration

**Step 1 - Locating the config.php file**

Locate the config.php file inside of File Manager. This will be in public\_html or the sub folder. When you have located the config file double click it to open the file and edit it.

**Step 2 - Base URL**

The base url can be located at the top of the config file

```
// Panel URL \\
define('BASE_URL', 'https://localhost/hamzcad');
```

Replace the base url with your link. IMPORTANT: Make sure there is no `/` at the end of the base url.

**Step 3 - SQL DATABASE CONNECTION**

```
// SQL DATABASE CONNECTION \\
define('DB_HOST', 'localhost'); // Keep this unless your db is hosted elsewhere
define('DB_USER', 'root'); // Replace root with DB username
define('DB_PASSWORD', ''); // Add DB Password inside of the ''
define('DB_NAME', 'hamzproduct'); // Replace hamzcad with DB name
```

**Step 4 - DISCORD OAUTH2**

```
// DISCORD OAUTH2 \\
define('TOKEN', 'TOKEN-HERE');
define('GUILD_ID', 'GUILD-ID-HERE');
define('OAUTH2_CLIENT_ID', 'CLIENT-ID-HERE');
define('OAUTH2_CLIENT_SECRET', 'CLIENT-SECRET-HERE');
```

Head to the [Discord Developer Portal](https://discord.com/developers/applications).

Create a application.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2Fajmd5GKJgYtgmFoCcUHt%2Fnewapp.png?alt=media&amp;token=ecf8c3d0-fea4-42b1-bba2-2deaa621925c" alt=""><figcaption></figcaption></figure>

First we will get the bot token. Head to the bot navigation on your application and create the bot. When you have created the bot click on the Copy button under the token.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FzudrqqzlglqqD4Ezh0T0%2Ftoken.png?alt=media&amp;token=791664d1-935e-4cd1-915f-f39ca9c93e5b" alt=""><figcaption></figcaption></figure>

Now that you have that copied replace TOKEN-HERE with the token you have copied.

Guild ID. = Right click on your servers profile image on discord and press COPY ID if this is not a option you will have to enable developer mode in the discord settings.

Now replace GUILD-ID-HERE with the ID you now have copied.

OAUTH2 CLIENT ID. = On the dev portal head to OAuth2 section.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2F4J05iHagzjF80mRE232N%2Fauth2.png?alt=media&amp;token=253398d8-0b60-4f77-95ea-4924c4415cb5" alt=""><figcaption></figcaption></figure>

Now head to the client id and press the copy button.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FnV4gozqrcpwb18as0xrm%2F9c27828eeca433d37709300a0690fbf7.png?alt=media&amp;token=e033912e-d9ea-449f-89bd-b396f954abfb" alt=""><figcaption></figcaption></figure>

Now replace the OAUTH2\_CLIENT\_ID with the ID you have copied.

OAUTH2 CLIENT SECRET = On the dev portal OAuth2 section copy the secret key.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FpK7skQwUfUUfYkrErC0V%2Fsecret.png?alt=media&amp;token=ea0c5f9a-dc05-4a89-8709-f39c04c5c2bb" alt=""><figcaption></figcaption></figure>

Now replace OAUTH2\_CLIENT\_SECRET with what you have copied.

Make sure that the application is inside your discord server. You can do that via the below link.

> [https://discordapp.com/oauth2/authorizeclient\_id=CLIENT\_ID\_HERE\&scope=bot\&permissions=0](https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID_HERE\&scope=bot\&permissions=0)\
> Replace CLIENTIDHERE with the applications client ID.

Finally, Set the **OAuth2 Redirect** here: (link + /actions/register.php)

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FMtdAKWbTrcXZs9iiKZN0%2Fredir.png?alt=media&amp;token=e7473720-a70b-4c0f-9888-fa6fe3fc7d3f" alt=""><figcaption></figcaption></figure>

**Step 5 - GENERAL SETTINGS**

Edit to your liking, **KEEP THE FORMAT!!!**

```
//GENERAL SETTINGS\\
define('LOGO', 'https://imgur.com/yaHpliD.png');
define('DISCORD_INVITE', 'SETDISCORDINVITEHERE');
define('SERVER_NAME', 'HAMZ'); // Replace with server name
define('BACKGROUND_IMAGE', 'https://imgur.com/VofZCNf.jpg'); // Direct image link.
define('ACCENT_COLOR', '#E24242'); // Accent Color
define('BUTTON_ACCENT_COLOR', 'success'); // success - warning - danger - primary - secondary - info - light - dark
define('SCROLLBAR_BG_COLOR', '#1C5A4B'); // Scroll bar color.
```

**Step 6 - ADMIN ROLES**

```
$ADMINROLES = [
	"ROLEID", // Replace with a role you like to have acces to the Admin tab
	"ROLEID", // Replace with a role you like to have acces to the Admin tab
];
```


# Requirements

* [Hamz CAD](https://store.hamz.dev/store/hamz-cad) (Make sure its installed before you move onto this installation)
* [Badger\_Discord\_API](https://github.com/JaredScar/Badger_Discord_API).
* PHP 7.2 (Until the next update)
* A brain.


# FAQ

**Q: Can't import the SQL File.**

A: Make sure you are on the latest SQL version.

**Q: Server console: Attempted to concentrate a nil value.**

A: Reinstall the resource, you most likely incorrectly configured the `config.lua`

**Q: I got an infinite loading screen.**

A: This can be because:

* You are using a new PHP version. As of right now the in-game cad only works on PHP 7.2, so please use this version.
* Your URL/Secret key may be incorrect.
* Your hosting provider may be stripping the headers, if so follow this guide: [\[OPTIONAL\] Apache Headers](/hamz-cad-in-game/optional-apache-headers)
* If all of the above options are correct and working, then please make a ticket and we'll look into it.


# Installation

{% hint style="danger" %}
If you are stuck, try to debug it yourself first. We have a lot of support tickets open and it'll take some time for your support ticket to get answered. Opening a support ticket should be your last option.
{% endhint %}

Please follow these steps one by one. If an error occurs during one of the steps, do not move forward. Fix the issue before moving on.


# 1. API File

1. Open the "API" folder in the resource directory.
2. Open the "api" folder in your Hamz CAD web files.
3. Drag the "in-game" folder into your "api" folder located on your hamz cad installation. As follows:

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FsyQbkQXa2dpZtApbYn7a%2Fimage.png?alt=media&amp;token=e7389a53-fafa-4fde-835c-2c7f8bc955b8" alt=""><figcaption></figcaption></figure>

4. Congrats, first step done.


# 2. SQL File

1. Open the "SQL File" Folder in your resource directory.
2. Now open your PhpMyAdmin or whatever SQL tool you use.&#x20;
3. Select the Hamz CAD database.
4. Find the "Import" tab and click it.
5. Select the `install.sql` file.
6. Import it.

<figure><img src="https://1343677498-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmh5jQDhFVLCuJsqAc1xh%2Fuploads%2FcfziW24bulD85ELgtGET%2Fimage.png?alt=media&amp;token=7feef263-9737-4ff0-8c71-7dcee453965d" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If the import was successful, congrats! If not, make sure you have the latest SQL version.
{% endhint %}


# 3. FiveM Resource (Final Step)

1. Open the "FiveM Resource" Folder and drag it into your resources folder.
2. Open the `config.lua`.
3. Configure the `config.lua` in relation to your server.


# More info on the Config.lua

```lua
CONFIG.PERMISSIONS = {
    CIVLIAN = true,
    POLICE = {
        ''
    },
    FIRE_EMS = {
        ''
    }
}
```

The permission system for the CAD works as follows:

* If the variable is set to TRUE, it'll allow all players to use that dashboard.
* If you set the variable as follows. (In this example we use the CIVILIAN dashboard)

```lua
CIVILIAN = {
   'DISCORD_ROLE_ID',
   'DISCORD_ROLE_ID' 
}
```

* The above permission will give access to the Civilian dashboard to users that have the mentioned discord role.&#x20;


# \[OPTIONAL] Apache Headers

{% hint style="warning" %}
It has come to our attention that a limited number of hosting providers may inadvertently strip certain essential headers from incoming requests for security reasons. Unfortunately, this can result in authentication-related problems, causing our product to encounter issues during operation. To fix this issue, follow the guide below.
{% endhint %}

* Open the location of the CAD Web Files.
* Turn on hidden files.
* You should see a `.htaccess` file. Open that file and add the following at the very bottom of the file:

```
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
```


