> For the complete documentation index, see [llms.txt](https://pural-development.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pural-development.gitbook.io/docs/assets/pd-drivingschool.md).

# PD-DRIVINGSCHOOL

Welcome to the PD-Drivingschool installation guide, here you can learn how to completely install our asset, following each step we will achieve a clean and fluid installation where you will not find any problems, as long as the documentation has been completed in full.

## Asset download

{% hint style="info" %}
To find the asset, you must have made the purchase using your own keymaster account. Otherwise, you can use the transfer system to move the asset to a different keymaster account.
{% endhint %}

Once the purchase is made on our official website, you will receive your asset directly in your [keymaster](https://keymaster.fivem.net/asset-grants), in your own panel you can download the asset and install it following the following documentation.

## Asset dependencies

This asset has some dependencies that are completely mandatory and important for the operation of the asset. If you do not have these dependencies, your asset will probably start and have some error or message in its command console.

<table><thead><tr><th width="251">Dependencies</th><th data-type="content-ref">Direct links</th></tr></thead><tbody><tr><td>qb-target</td><td><a href="https://github.com/qbcore-framework/qb-target">https://github.com/qbcore-framework/qb-target</a></td></tr><tr><td>ox-target</td><td><a href="https://github.com/overextended/ox_target">https://github.com/overextended/ox_target</a></td></tr><tr><td>ox_lib</td><td><a href="https://github.com/overextended/ox_lib">https://github.com/overextended/ox_lib</a></td></tr><tr><td>oxmysql</td><td><a href="https://github.com/overextended/oxmysql">https://github.com/overextended/oxmysql</a></td></tr></tbody></table>

## Database

In your localhost database you must execute this sql.

```sql
CREATE TABLE `drivingschool` (
  `id` int(11) NOT NULL,
  `identifier` varchar(255) NOT NULL,
  `drivinglicenses` text DEFAULT NULL,
  `typeofpermit` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `available_instructors` (
  `id` int(11) NOT NULL,
  `identifier` varchar(46) DEFAULT NULL,
  `available` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

```

## Configuration

Configure the scripts to your server needs

```lua

Config = Config or {};
--[[
    Framework configuration and tools of your server!

    Please choose from the following options:

    Framework:
        'ESX'
        'QBCORE'

    Target:
        'ox_target'
        'qb-target'

	Notify:
        'QBCore'
        'ESX'
		'OkOk'
        'mythic_notify'
		'cdev_notify'
]]

Config.Framework = 'ESX' -- You can change to 'QBCORE' or 'ESX'

Config.Target = "ox_target"     -- 'ox_target', 'qb-target'

Config.Notify = 'ESX'

Config.JobName = "drivingschool" -- By default if you want change to your likings.
--[[
    Select the prices of the permits.
]]

Config.PermitPrices = {
    ["Passenger Cars"] = 500,
    ["Motorcycles"] = 500,
    ["Taxi and Livery"] = 500,
    ["Commercial License"] = 500,
	["Driving Book"] = 50,
}

--[[
    Select the percentage that the player needs to reach in order to past the test.
]]
Config.PassScore = 75;
```

## Framework Modifications

<br>

### For QBCore

Install the items in your qb-core/shared/items.lua

```lua
['driver_license'] 				 = {['name'] = 'driver_license', 			  	['label'] = 'Drivers License', 			['weight'] = 0, 		['type'] = 'item', 		['image'] = 'driver_license.png', 		['unique'] = true, 		['useable'] = true, 	['shouldClose'] = false,   ['combinable'] = nil,   ['description'] = 'Permit to show you can drive a vehicle'},
['learners_permit'] 				 		 = {['name'] = 'learners_permit', 			    		['label'] = 'Learners Permit', 					['weight'] = 100, 	['type'] = 'item', 		['image'] = 'learners_permit.png', 				['unique'] = false, 	['useable'] = true, 	['shouldClose'] = false,   ['combinable'] = nil,   ['description'] = ''},
['driving_book'] 				 		 = {['name'] = 'driving_book', 			    		['label'] = 'Driving book', 					['weight'] = 100, 	['type'] = 'item', 		['image'] = 'driving_book.png', 				['unique'] = false, 	['useable'] = true, 	['shouldClose'] = false,   ['combinable'] = nil,   ['description'] = 'Book to learn about driving.'},
['checklist'] 					 = {['name'] = 'checklist', 					['label'] = 'Checklist', 				['weight'] = 200, 		['type'] = 'item', 		['image'] = 'checklist.png', 			['unique'] = false, 	['useable'] = true, 	['shouldClose'] = false,   ['combinable'] = nil,   ['description'] = ''},

```

\
Add this to your qb-inventory/html/app.js

```javascript
else if (itemData.name == "driver_license") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>First Name: </strong><span>" +
                itemData.info.firstname +
                "</span></p><p><strong>Last Name: </strong><span>" +
                itemData.info.lastname +
                "</span></p><p><strong>Birth Date: </strong><span>" +
                itemData.info.birthdate +
                "</span></p><p><strong>Licenses: </strong><span>");
        
            // Iterate over each license and display it
            for (var i = 0; i < itemData.info.driverlicenses.length; i++) {
                $(".item-info-description").append("<span>" + itemData.info.driverlicenses[i] + "</span><br>");
            }
        
            $(".item-info-description").append("</p>");
        }else if (itemData.name == "learners_permit") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Learners Permit Type : </strong><span>" +
                itemData.info.typeofpermit +
                "</span></p><p><strong>First Name: </strong><span>" +
                itemData.info.firstname +
                "</span></p><p><strong>Last Name: </strong><span>" +
                itemData.info.lastname +
                "</span></p>"
            );
        }
    
```

Add the job to your framework<br>

```lua
     ['drivingschool'] = {
		label = 'DrivingSchool',
		defaultDuty = true,
		offDutyPay = false,
		grades = {
            ['1'] = {
                name = 'Examiner',
                payment = 50
            },
          },
	},
```

### For ESX

Install the items in your  ox\_inventory/data/items.lua&#x20;

<pre class="language-lua"><code class="lang-lua"><strong>["driver_license"] = {
</strong>	label = "Driving License",
	weight = 1,
	stack = true,
	close = true,
},
["learners_permit"] = {
	label = "Learners Permit",
	weight = 1,
	stack = true,
	close = true,
},
["driving_book"] = {
	label = "Driving Book",
	weight = 1,
	stack = true,
	close = true,
},
["checklist"] = {
	label = "Checklist",
	weight = 1,
	stack = true,
	close = true,
},
</code></pre>

Add the job to your database

```sql
INSERT INTO `jobs` (`name`, `label`, `whitelisted`) VALUES ('drivingschool', 'Driving School', '1');
INSERT INTO `job_grades` (`id`, `job_name`, `grade`, `name`, `label`, `salary`, `skin_male`, `skin_female`) VALUES (NULL, 'drivingschool', '1', 'examiner', 'Examiner', '100', '', '');
```
