Pural Development Documentation
  • Pural Development Documentation
  • Assets
    • PD-DRIVINGSCHOOL
Powered by GitBook
On this page
  • Asset download
  • Asset dependencies
  • Database
  • Configuration
  • Framework Modifications
  • For QBCore
  • For ESX
  1. Assets

PD-DRIVINGSCHOOL

PreviousAssets

Last updated 1 year ago

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

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.

Once the purchase is made on our official website, you will receive your asset directly in your , 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.

Dependencies
Direct links

qb-target

https://github.com/qbcore-framework/qb-target

ox-target

https://github.com/overextended/ox_target

ox_lib

https://github.com/overextended/ox_lib

oxmysql

https://github.com/overextended/oxmysql

Database

In your localhost database you must execute this 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


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

For QBCore

Install the items in your qb-core/shared/items.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

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

     ['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

["driver_license"] = {
	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,
},

Add the job to your database

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', '', '');
keymaster