mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 02:38:53 +00:00
Merge pull request #48 from Djamuras/master
Close menu before starting the test
This commit is contained in:
+16
-5
@@ -38,7 +38,7 @@ function StartTheoryTest()
|
||||
SetNuiFocus(true, true)
|
||||
end)
|
||||
|
||||
TriggerServerEvent('esx_dmvschool:pay', Config.Prices['dmv'])
|
||||
|
||||
end
|
||||
|
||||
function StopTheoryTest(success)
|
||||
@@ -75,8 +75,6 @@ function StartDriveTest(type)
|
||||
SetVehicleFuelLevel(vehicle, 100.0)
|
||||
DecorSetFloat(vehicle, "_FUEL_LEVEL", GetVehicleFuelLevel(vehicle))
|
||||
end)
|
||||
|
||||
TriggerServerEvent('esx_dmvschool:pay', Config.Prices[type])
|
||||
end
|
||||
|
||||
function StopDriveTest(success)
|
||||
@@ -146,9 +144,22 @@ function OpenDMVSchoolMenu()
|
||||
}, function(data, menu)
|
||||
if data.current.value == 'theory_test' then
|
||||
menu.close()
|
||||
StartTheoryTest()
|
||||
ESX.TriggerServerCallback('esx_dmvschool:canYouPay', function(haveMoney)
|
||||
if haveMoney then
|
||||
StartTheoryTest()
|
||||
else
|
||||
ESX.ShowNotification(_U('not_enough_money'))
|
||||
end
|
||||
end, 'dmv')
|
||||
elseif data.current.value == 'drive_test' then
|
||||
StartDriveTest(data.current.type)
|
||||
menu.close()
|
||||
ESX.TriggerServerCallback('esx_dmvschool:canYouPay', function(haveMoney)
|
||||
if haveMoney then
|
||||
StartDriveTest(data.current.type)
|
||||
else
|
||||
ESX.ShowNotification(_U('not_enough_money'))
|
||||
end
|
||||
end, data.current.type)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
Reference in New Issue
Block a user