WE DmvSchool [ESX]



[Summary]

A system with a beautiful and responsive UI and full driving training

[Features]

  • Customizeable Theme
  • Responsive ui
  • Have 10 questions for theory test
  • Have Drive Test for truck / bike / car
  • Editable All values in config
  • Park simulator with AI

PREVIEW

Tebex

Thanks to @ataesmaeilpour for helping with the backend codes

[Config]

config.lua

local spawnedVehicles = {}

Config                 = {}
Config.DrawDistance    = 10.0
Config.MaxErrors       = 5
Config.SpeedMultiplier = 3.6
Config.Locale          = 'en'
Config.AnswersNeedToAccept = 5

Config.Prices = {
	dmv         = 500,
	drive       = 2500,
	drive_bike  = 3000,
	drive_truck = 5000
}

Config.VehicleModels = {
	drive       = 'blista',
	drive_bike  = 'sanchez',
	drive_truck = 'mule3'
}

Config.SpeedLimits = {
	residence = 50,
	town      = 80,
	freeway   = 120
}

Config.Zones = {

	DMVSchool = {
		Pos   = {x = 239.471, y = -1380.960, z = 32.741},
		Size  = {x = 1.5, y = 1.5, z = 1.0},
		Color = {r = 204, g = 204, b = 0},
		Type  = 1
	},

	VehicleSpawnPoint = {
		Pos   = {x = 249.409, y = -1407.230, z = 30.4094, h = 317.0},
		Size  = {x = 1.5, y = 1.5, z = 1.0},
		Color = {r = 204, g = 204, b = 0},
		Type  = -1
	}

}

Config.CheckPoints = {
DriveTest = {
	{
		Pos = {x = 255.139, y = -1400.731, z = 29.537},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			CreateCam(true,vector3(262.57525634766, -1383.0974121094, 34.531505584717),233.79286193848)
			FreezeEntityPosition(vehicle, true)
			SpawnVehiclesForTestPark()
			Subtitle('~b~Driving Instructor: \n ~s~Hello, welcome to the first stage of driving',5000)
			Subtitle('~b~Driving Instructor: \n ~s~The first thing you have to do is to park in the designated place',5000)
			Subtitle('~b~Driving Instructor: \n ~s~Note that every accident will reduce your score',5000)
			
			
			CreateCam(false)

			FreezeEntityPosition(vehicle, false)
			
		end
	},

	{
		Pos = {x = 270.18594360352, y = -1388.6273193359, z = 30.578592300415},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			while true do
				Citizen.Wait(500)
				local vehicleCoords = GetEntityCoords(vehicle)
				local heading = math.random(319,322)
				
				if math.floor(GetEntityHeading(vehicle)) == heading and #(vehicleCoords - vector3(270.0791015625, -1388.5401611328, 31.40558052063) ) < 1 then
					break
				end
			end
			
			DrawMissionText(_U('go_next_point'), 5000)
			DeleteSpawnedVehicles()
		end
	},

	{
		Pos = {x = 271.58572387695, y = -1370.9281005859, z = 30.933750152588},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			CreateThread(function()
				FreezeEntityPosition(vehicle, true)
				CreateCam(true,vector3(273.36325073242, -1360.9822998047, 35.935108184814),321.11740112305)
				Subtitle('~b~Driving Instructor: \n ~s~In the whole city, there are places to park which are marked with yellow and white lines',7000)
				Subtitle('~b~Driving Instructor: \n ~s~Just don\'t park on the line',5000)
				CreateCam(false)
				FreezeEntityPosition(vehicle, false)
			end)
		end
	},

	{
		Pos = {x = 270.53625488281, y = -1356.0401611328, z = 30.935108184814},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			-- setCurrentZoneType('town')

			CreateThread(function()
				-- DrawMissionText(_U('stop_look_left', Config.SpeedLimits['town']), 5000)
				Subtitle('~b~Driving Instructor: \n ~r~Follow the red line on the mini map',5000)
			end)
		end
	},

	{
		Pos = {x = 252.13215637207, y = -1342.3446044922, z = 30.91828918457},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			CreateThread(function()
				FreezeEntityPosition(vehicle, true)
				CreateCam(true,vector3(240.10893249512, -1338.8238525391, 35.091156005859), 137.46362304688)
				Subtitle('~b~Driving Instructor: \n ~s~Respecting pedestrians is one of the driving rules',5000)
				
				Subtitle('~b~Driving Instructor: \n ~s~Before crossing the special pedestrian crossing line\n look to the left and right',7000)
				
				CreateCam(true,vector3(235.82153320313, -1345.6762695313, 33.583976745605),75.38468170166)
				Wait(2500)
				CreateCam(true,vector3(235.62078857422, -1345.5422363281, 33.582931518555),187.1916809082)
				Wait(2500)
				CreateCam(false)
				FreezeEntityPosition(vehicle, false)
			end)
		end
	},

	{
		Pos = {x = 226.54289245605, y = -1356.8919677734, z = 29.552942276001},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = 220.23495483398, y = -1376.1649169922, z = 29.558292388916},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			CreateThread(function()
				FreezeEntityPosition(vehicle, true)
				CreateCam(true,vector3(219.75506591797, -1379.4885253906, 35.547412872314), 50.816917419434)
				Subtitle('~b~Driving Instructor: \n ~s~You have the right to park in places that are handicapped accessible',5000)
				CreateCam(false)
				FreezeEntityPosition(vehicle, false)
			end)
		end
	},

	{
		Pos = {x = 228.04243469238, y = -1396.5788574219, z = 29.489122390747},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = 213.65875244141, y = -1412.9248046875, z = 28.136703491211},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = 186.28977966309, y = -1398.8898925781, z = 28.247911453247},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			CreateThread(function()
				FreezeEntityPosition(vehicle, true)
				CreateCam(true,vector3(185.6118927002, -1392.4379882813, 33.258993148804), 6.614758014679)
				Subtitle('~b~Driving Instructor: \n ~s~You must have seen these lights',5000)
				Subtitle('~b~Driving Instructor: \n ~s~While driving, we should pay attention to these lights',5000)
				Subtitle('~b~Driving Instructor: \n ~s~Yes, yes, I know, but wait for me',5000)
				Subtitle('~b~Driving Instructor: \n ~g~Green ~s~means go, ~y~yellow ~s~means be careful and go if you are in the middle of the road, ~r~red ~s~means you have to stop',5000)
				CreateCam(false)
				FreezeEntityPosition(vehicle, false)
			end)
		end
	},

	{
		Pos = {x = 185.6946105957, y = -1376.9666748047, z = 28.021179199219},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = 216.59298706055, y = -1332.3699951172, z = 28.052070617676},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = 271.43853759766, y = -1316.7668457031, z = 28.54705619812},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = 319.91387939453, y = -1326.5310058594, z = 30.892158508301},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			setCurrentZoneType('town')
			DrawMissionText(_U('in_town_speed', Config.SpeedLimits['town']), 5000)
		end
	},

	{
		Pos = {x = 310.79461669922, y = -1357.3802490234, z = 30.797695159912},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('gratz_stay_alert'), 5000)
			PlaySound(-1, 'RACE_PLACED', 'HUD_AWARDS', false, 0, true)
		end
	},

	{
		Pos = {x = 281.18450927734, y = -1377.6828613281, z = 30.694528579712},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			ESX.Game.DeleteVehicle(vehicle)
		end
	}
},

OtherTest = {
	{
		Pos = {x = 255.139, y = -1400.731, z = 29.537},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('next_point_speed', Config.SpeedLimits['residence']), 5000)
		end
	},

	{
		Pos = {x = 271.874, y = -1370.574, z = 30.932},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = 234.907, y = -1345.385, z = 29.542},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			CreateThread(function()
				DrawMissionText(_U('stop_for_ped'), 5000)
				PlaySound(-1, 'RACE_PLACED', 'HUD_AWARDS', false, 0, true)
				FreezeEntityPosition(vehicle, true)
				Wait(4000)

				FreezeEntityPosition(vehicle, false)
				DrawMissionText(_U('good_lets_cont'), 5000)
			end)
		end
	},

	{
		Pos = {x = 217.821, y = -1410.520, z = 28.292},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			setCurrentZoneType('town')

			CreateThread(function()
				DrawMissionText(_U('stop_look_left', Config.SpeedLimits['town']), 5000)
				PlaySound(-1, 'RACE_PLACED', 'HUD_AWARDS', false, 0, true)
				FreezeEntityPosition(vehicle, true)
				Wait(6000)

				FreezeEntityPosition(vehicle, false)
				DrawMissionText(_U('good_turn_right'), 5000)
			end)
		end
	},

	{
		Pos = {x = 178.550, y = -1401.755, z = 27.725},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('watch_traffic_lightson'), 5000)
		end
	},

	{
		Pos = {x = 113.160, y = -1365.276, z = 27.725},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = -73.542, y = -1364.335, z = 27.789},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('stop_for_passing'), 5000)
			PlaySound(-1, 'RACE_PLACED', 'HUD_AWARDS', false, 0, true)
			FreezeEntityPosition(vehicle, true)
			Wait(6000)
			FreezeEntityPosition(vehicle, false)
		end
	},

	{
		Pos = {x = -355.143, y = -1420.282, z = 27.868},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = -439.148, y = -1417.100, z = 27.704},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = -453.790, y = -1444.726, z = 27.665},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			setCurrentZoneType('freeway')

			DrawMissionText(_U('hway_time', Config.SpeedLimits['freeway']), 5000)
			PlaySound(-1, 'RACE_PLACED', 'HUD_AWARDS', false, 0, true)
		end
	},

	{
		Pos = {x = -463.237, y = -1592.178, z = 37.519},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = -900.647, y = -1986.28, z = 26.109},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = 1225.759, y = -1948.792, z = 38.718},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('go_next_point'), 5000)
		end
	},

	{
		Pos = {x = 1225.759, y = -1948.792, z = 38.718},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			setCurrentZoneType('town')
			DrawMissionText(_U('in_town_speed', Config.SpeedLimits['town']), 5000)
		end
	},

	{
		Pos = {x = 1163.603, y = -1841.771, z = 35.679},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			DrawMissionText(_U('gratz_stay_alert'), 5000)
			PlaySound(-1, 'RACE_PLACED', 'HUD_AWARDS', false, 0, true)
		end
	},

	{
		Pos = {x = 235.283, y = -1398.329, z = 28.921},
		Action = function(playerPed, vehicle, setCurrentZoneType)
			ESX.Game.DeleteVehicle(vehicle)
		end
	}
},
	

}

Code is accessible No, Just UI And some Files
Subscription-based No
Lines (approximately) ~600
Requirements ESX - esx_license
Support Yes (24/7)
:fire: MJ PauseMenu
:fire: MJ ReportSystem
:fire: MJ WeaponShop
:fire: MJ Notify
14 Likes

Good job!
Like how u turn out driving test, with parking lession and stuff like that!
Looking foward for motocyle , truck, boat, plane categorys as well with same style of driving test!

2 Likes

wow this is awesome bro

2 Likes

make for version qbcore

2 Likes

I plan to add it soon

4 Likes

nice! i will waitting

1 Like

the best dmvschool yet rn

3 Likes

mph option?

1 Like

Yes, you can use this option, it is available by default

dope so speed test shows that you should keep under MPH? in the demo video showed km/h?

1 Like

you can use any speedometer for show mph,
Most servers have a default MPH HUD option

this isnt part of the HUD, maybe misunderstood
can this be changed to MPH?

yes this can change

1 Like