DocsOther ScriptsDriving School
Advanced Driving School
A complete overhaul of the licensing system. Features cinematic theory lessons, a strict practical exam with fault monitoring, and a modern, fully responsive UI.
1
Database Installation
This script uses a custom table to track player progress (Theory Passed vs License Obtained) to ensure cross-framework compatibility.
MySQL / MariaDB
CREATE TABLE IF NOT EXISTS `xada_drivingschool` (
`identifier` varchar(60) NOT NULL,
`progress` int(11) DEFAULT 0,
PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;2
Framework & Systems
Setup your Framework, Notification system, Interaction method, and Vehicle Keys.
If you use Bank payments, the inventory setting is ignored. If you use Cash, ensure the correct inventory is selected.
Config = {}
-- [[ FRAMEWORK SETTINGS ]]
-- Options: 'qbx', 'qb', 'esx'
Config.Framework = 'qb'
-- [[ LANGUAGE ]]
-- Options: 'en', 'lt'
Config.Language = 'en'
-- [[ INTERACTION SETTINGS ]]
-- Options: 'target' (Requires ox_target/qb-target), 'marker' (Default ESX 3D Text)
Config.Interact = 'target'
-- [[ NOTIFICATIONS ]]
-- Options: 'ox' (ox_lib), 'qb' (QBCore default), 'esx' (ESX default), 'custom'
Config.Notify = 'qb'
-- [[ TARGET SYSTEM (Only if Config.Interact = 'target') ]]
-- Options: 'ox_target', 'qb-target', 'qtarget'
Config.Target = 'qb-target'
-- [[ KEYS SYSTEM ]]
-- Options: 'qb' (qb-vehiclekeys), 'qs' (qs-vehiclekeys), 'wasabi', 'esx' (no specific key script), 'custom'
Config.Keys = 'qb'
-- [[ INVENTORY SETTINGS ]]
-- Options: 'esx', 'ox', 'qs' Overall this setting is not required, unless you want to use cash as payment
Config.Inventory = 'ox'
-- [[ ECONOMY ]]
-- CHANGED: Set this to 'bank' to avoid inventory crashes
Config.PaymentAccount = 'bank'
Config.LessonCost = 250
-- [[ BLIP SETTINGS ]]
Config.Blip = {
Enabled = true,
Sprite = 498,
Color = 3,
Scale = 0.8,
Label = "Driving School"
}3
Exam Settings
Vehicle
Defines the temporary vehicle spawned for the practical exam.
Faults
Maximum mistakes (Speeding, Crashing) before the exam is terminated.
-- [[ EXAM SETTINGS ]]
Config.ExamVehicle = "blista"
Config.SpawnPoint = vector4(250.9510, -1406.4016, 30.5875, 47.4689)
Config.MaxFaults = 5
Config.MaxSpeed = 65 -- km/h
Config.Location = {
PedCoords = vector4(218, -1391, 30.5, 318.4493),
Model = "a_f_y_business_02"
}4
Cinematic Lessons
These cameras play before the theory exam. You can change the coordinates to match your city's specific locations.
-- [[ LESSONS CINEMATICS (TRANSLATED) ]]
Config.Lessons = {
{
title = "Traffic Lights",
text = "Red light means mandatory stop. Yellow means prepare. You may proceed only when the light is green.",
duration = 10000,
camStart = { coords = vector3(156.4186, -1407.8158, 32.1622), rot = vector3(0.0, 0.0, 22.0) },
camEnd = { coords = vector3(150.5477, -1381.0646, 34.4952), rot = vector3(0.0, 0.0, 59.0) }
},
{
title = "Speed Limits",
text = "The maximum speed limit in the city is 60 km/h. You must be extra careful in residential zones.",
duration = 10000,
camStart = { coords = vector3(292.9400, -860.9281, 59.4914), rot = vector3(0.0, 0.0, 70.0) },
camEnd = { coords = vector3(206.8785, -829.4313, 34.0202), rot = vector3(0.0, 0.0, 70.0) }
},
{
title = "Stop Signs",
text = "You must come to a complete stop at a 'STOP' sign. Proceed only when you are sure it is safe.",
duration = 10000,
camStart = { coords = vector3(64.2990, -1155.2482, 32.2566), rot = vector3(0.0, 0.0, 352.0) },
camEnd = { coords = vector3(77.6398, -1140.5714, 31.3320), rot = vector3(0.0, 0.0, 266.0) }
},
{
title = "Freeway / Highway",
text = "Keep to the right lane on the freeway. The left lane is intended for passing only.",
duration = 10000,
camStart = { coords = vector3(696.8917, -144.9658, 80.1093), rot = vector3(0.0, 0.0, 148.0) },
camEnd = { coords = vector3(628.2610, -251.7681, 51.4286), rot = vector3(0, 0.0, 146.0) }
},
{
title = "Intersection Priority",
text = "Priority at an intersection means you have the right of way, but stay alert. The 'Right Hand Rule' applies if there are no signs.",
duration = 10000,
camStart = { coords = vector3(70.0107, -1088.1042, 48.6474), rot = vector3(0.0, 0.0, 336.0) },
camEnd = { coords = vector3(98.6203, -1004.2944, 35.4332), rot = vector3(0, 0.0, 38.0) }
},
{
title = "Safe Distance",
text = "Safe distance means maintaining enough space between you and the car in front to stop safely.",
duration = 10000,
camStart = { coords = vector3(-502.4438, -1742.2433, 20.6987), rot = vector3(0.0, 0.0, 99.0) },
camEnd = { coords = vector3(-501.0397, -1752.6576, 20.2946), rot = vector3(0, 0.0, 201.0) }
},
{
title = "Parking",
text = "Parking means choosing a suitable place to stop safely. It is important to follow parking regulations.",
duration = 10000,
camStart = { coords = vector3(225.3223, -1088.5909, 31.6320), rot = vector3(0.0, 0.0, 351.0) },
camEnd = { coords = vector3(225.6051, -1068.3759, 30.4497), rot = vector3(0, 0.0, 265.0) }
},
{
title = "Turn Signals",
text = "You must use turn signals before turning or changing lanes to inform other drivers of your intentions.",
duration = 10000,
camStart = { coords = vector3(-1.5901, -84.2075, 88.6658), rot = vector3(0.0, 0.0, 249.9890) },
camEnd = { coords = vector3(69.3645, -109.8372, 61.6210), rot = vector3(0.0, 0.0, 249.1623) }
},
{
title = "Pedestrian Crossings",
text = "At pedestrian crossings, you must stop and allow pedestrians to cross the street safely.",
duration = 10000,
camStart = { coords = vector3(186.0587, -1127.3545, 60.6847), rot = vector3(0.0, 0.0, 90.8562) },
camEnd = { coords = vector3(96.0277, -1131.7004, 35.3448), rot = vector3(0.0, 0.0, 90.0295) }
},
{
title = "Emergency Vehicles",
text = "You must yield to ambulances, fire trucks, or police vehicles that are using sirens and flashing lights.",
duration = 10000,
camStart = { coords = vector3(281.2333, -951.3392, 43.7092), rot = vector3(0.0, 0.0, 267.1947) },
camEnd = { coords = vector3(405.3141, -960.4660, 35.9893), rot = vector3(0.0, 0.0, 234.3604) }
}
}5
Theory Questions
The quiz system randomizes these questions.
-- [[ THEORY QUESTIONS ]]
Config.TheoryQuestions = {
{
question = "What does a red traffic light mean?",
answers = {
{ text = "Proceed with caution", correct = false },
{ text = "Mandatory stop", correct = true },
{ text = "Prepare to go", correct = false },
{ text = "Yield to right", correct = false }
}
},
{
question = "What is the maximum speed limit in the city?",
answers = {
{ text = "50 km/h", correct = false },
{ text = "60 km/h", correct = true },
{ text = "80 km/h", correct = false },
{ text = "No restrictions", correct = false }
}
},
{
question = "What must you do at a STOP sign?",
answers = {
{ text = "Slow down", correct = false },
{ text = "Honk your horn", correct = false },
{ text = "Come to a complete stop", correct = true },
{ text = "Drive if no cars are coming", correct = false }
}
},
{
question = "Which lane on the freeway is for driving?",
answers = {
{ text = "The left lane", correct = false },
{ text = "The middle lane", correct = false },
{ text = "The right lane", correct = true },
{ text = "Any lane", correct = false }
}
},
{
question = "Which rule applies at an unmarked intersection?",
answers = {
{ text = "Left-hand rule", correct = false },
{ text = "Right-hand rule", correct = true },
{ text = "Faster car goes first", correct = false },
{ text = "Bigger car rule", correct = false }
}
},
{
question = "Why is maintaining a safe distance important?",
answers = {
{ text = "To see license plates", correct = false },
{ text = "To be able to stop safely", correct = true },
{ text = "To save fuel", correct = false },
{ text = "It is not important", correct = false }
}
},
{
question = "What defines proper parking?",
answers = {
{ text = "Stopping anywhere with hazards on", correct = false },
{ text = "Choosing a safe, legal spot", correct = true },
{ text = "Blocking other cars", correct = false },
{ text = "Parking only in garages", correct = false }
}
},
{
question = "When must you use turn signals?",
answers = {
{ text = "Only at intersections", correct = false },
{ text = "Before turning or changing lanes", correct = true },
{ text = "Only at night", correct = false },
{ text = "Not mandatory", correct = false }
}
},
{
question = "How should you act at a pedestrian crossing?",
answers = {
{ text = "Speed up", correct = false },
{ text = "Stop and let pedestrians pass", correct = true },
{ text = "Drive around pedestrians", correct = false },
{ text = "Honk", correct = false }
}
},
{
question = "What to do when you see an emergency vehicle with sirens?",
answers = {
{ text = "Race it", correct = false },
{ text = "Ignore it", correct = false },
{ text = "Yield and make way", correct = true },
{ text = "Stop in the middle of the road", correct = false }
}
},
{
question = "A yellow traffic light means:",
answers = {
{ text = "Go", correct = false },
{ text = "Prepare", correct = true },
{ text = "Stop immediately", correct = false },
{ text = "Traffic light is broken", correct = false }
}
},
{
question = "Can you exceed the speed limit while overtaking?",
answers = {
{ text = "Yes, briefly", correct = false },
{ text = "No, limits always apply", correct = true },
{ text = "Only outside the city", correct = false },
{ text = "Only if no one sees", correct = false }
}
},
{
question = "The left lane on the freeway is for:",
answers = {
{ text = "Slow driving", correct = false },
{ text = "Stopping", correct = false },
{ text = "Overtaking", correct = true },
{ text = "Trucks only", correct = false }
}
},
{
question = "Before starting to drive, you must:",
answers = {
{ text = "Fasten seatbelt and check surroundings", correct = true },
{ text = "Turn up the music", correct = false },
{ text = "Immediately accelerate", correct = false },
{ text = "Call a friend", correct = false }
}
},
{
question = "What to do in case of a traffic accident?",
answers = {
{ text = "Run away", correct = false },
{ text = "Call police/medics", correct = true },
{ text = "Pretend nothing happened", correct = false },
{ text = "Blame others", correct = false }
}
}
}6
Practical Exam Route
The checkpoints the player must drive through.
-- [[ EXAM ROUTE ]]
Config.ExamRoute = {
{ coords = vector3(272.9245, -1358.9753, 31.7579), text = "Turn right and head towards the exit." },
{ coords = vector3(221.9344, -1405.6459, 29.4504), text = "Turn right at the intersection." },
{ coords = vector3(213.5284, -1333.1567, 29.1096), text = "Keep right." },
{ coords = vector3(323.3646, -1322.4194, 31.9429), text = "Stop at the traffic light, go straight if safe." },
{ coords = vector3(520.2218, -1438.7941, 29.1686), text = "Drive straight." },
{ coords = vector3(775.8027, -1448.0596, 26.8813), text = "Drive carefully." },
{ coords = vector3(815.6334, -1725.0189, 29.0622), text = "Return towards the driving school." },
{ coords = vector3(237.6775, -1411.9158, 30.4090), text = "Park the vehicle." }, -- Finish
}