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.

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.

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.

Click Add Redirect on the OAuth2 page

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://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.

Last updated