Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 23 additions & 27 deletions [esx_addons]/esx_dmvschool/client/main.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
local CurrentAction = nil
local CurrentActionMsg = nil
local CurrentActionData = nil
local Licenses = {}
local CurrentTest = nil
local CurrentTestType = nil
Expand Down Expand Up @@ -30,7 +29,7 @@ function StartTheoryTest()
SetNuiFocus(true, true)
end)


ESX.HideUI()
end

function StopTheoryTest(success)
Expand All @@ -48,6 +47,8 @@ function StopTheoryTest(success)
else
ESX.ShowNotification(TranslateCap('failed_test'))
end

ESX.TextUI(TranslateCap('press_open_menu'))
end

function StartDriveTest(type)
Expand Down Expand Up @@ -84,10 +85,11 @@ function StopDriveTest(success)
end

function SetCurrentZoneType(type)
CurrentZoneType = type
CurrentZoneType = type
end

function OpenDMVSchoolMenu()
ESX.HideUI()
local ownedLicenses = {}

for i=1, #Licenses, 1 do
Expand All @@ -100,9 +102,10 @@ function OpenDMVSchoolMenu()

if not ownedLicenses['dmv'] then
elements[#elements+1] = {
icon = "fas fa-car",
icon = "fas fa-id-card",
title = (('%s: <span style="color:green;">%s</span>'):format(TranslateCap('theory_test'), TranslateCap('school_item', ESX.Math.GroupDigits(Config.Prices['dmv'])))),
value = "theory_test"
value = "theory_test",
type = "dmv"
}
end

Expand All @@ -118,7 +121,7 @@ function OpenDMVSchoolMenu()

if not ownedLicenses['drive_bike'] then
elements[#elements+1] = {
icon = "fas fa-car",
icon = "fas fa-motorcycle",
title = (('%s: <span style="color:green;">%s</span>'):format(TranslateCap('road_test_bike'), TranslateCap('school_item', ESX.Math.GroupDigits(Config.Prices['drive_bike'])))),
value = "drive_test",
type = "drive_bike"
Expand All @@ -127,7 +130,7 @@ function OpenDMVSchoolMenu()

if not ownedLicenses['drive_truck'] then
elements[#elements+1] = {
icon = "fas fa-car",
icon = "fas fa-truck",
title = (('%s: <span style="color:green;">%s</span>'):format(TranslateCap('road_test_truck'), TranslateCap('school_item', ESX.Math.GroupDigits(Config.Prices['drive_truck'])))),
value = "drive_test",
type = "drive_truck"
Expand All @@ -136,29 +139,22 @@ function OpenDMVSchoolMenu()
end

ESX.OpenContext("right", elements, function(menu,element)
if element.value == "theory_test" then
ESX.TriggerServerCallback('esx_dmvschool:canYouPay', function(haveMoney)
if haveMoney then
ESX.CloseContext()
ESX.TriggerServerCallback('esx_dmvschool:canYouPay', function(haveMoney)
if haveMoney then
ESX.CloseContext()
if element.value == "theory_test" then
StartTheoryTest()
else
ESX.ShowNotification(TranslateCap('not_enough_money'))
end
end, 'dmv')
elseif element.value == "drive_test" then
ESX.TriggerServerCallback('esx_dmvschool:canYouPay', function(haveMoney)
if haveMoney then
ESX.CloseContext()
StartDriveTest(element.type)
else
ESX.ShowNotification(TranslateCap('not_enough_money'))
end
end, element.type)
end
else
ESX.ShowNotification(TranslateCap('not_enough_money'))
end
end, element.type)
end, function(menu)
CurrentAction = 'dmvschool_menu'
CurrentActionMsg = TranslateCap('press_open_menu')
CurrentActionData = {}
ESX.TextUI(CurrentActionMsg)
end)
end

Expand All @@ -184,13 +180,14 @@ AddEventHandler('esx_dmvschool:hasEnteredMarker', function(zone)
if zone == 'DMVSchool' then
CurrentAction = 'dmvschool_menu'
CurrentActionMsg = TranslateCap('press_open_menu')
CurrentActionData = {}
end
ESX.TextUI(CurrentActionMsg)
end)

AddEventHandler('esx_dmvschool:hasExitedMarker', function(zone)
CurrentAction = nil
ESX.CloseContext()
ESX.HideUI()
end)

RegisterNetEvent('esx_dmvschool:loadLicenses')
Expand Down Expand Up @@ -277,10 +274,10 @@ CreateThread(function()

if CurrentAction then
sleep = 0
ESX.ShowHelpNotification(CurrentActionMsg)

if (IsControlJustReleased(0, 38)) and (CurrentAction == 'dmvschool_menu') then
OpenDMVSchoolMenu()
ESX.HideUI()
CurrentAction = nil
end
end
Expand Down Expand Up @@ -368,5 +365,4 @@ CreateThread(function()
end
Wait(sleep)
end
end)

end)
2 changes: 1 addition & 1 deletion [esx_addons]/esx_dmvschool/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ server_scripts {
'@es_extended/locale.lua',
'locales/*.lua',
'config.lua',
'server/main.lua'
'server/*.lua'
}

client_scripts {
Expand Down
3 changes: 3 additions & 0 deletions [esx_addons]/esx_dmvschool/locales/de.lua
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats not german

Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ Locales['de'] = {
['errors'] = 'Fehler: ~r~%s/%s',
['you_damaged_veh'] = 'Du hast das Fahrzeug beschädigt!',
['not_enough_money'] = 'Du hast nicht genug Geld!',
['latestVersion'] = "Du bruger den seneste version!",
['needUpdateResource'] = "Du skal downloade den nyeste version! Du bruger en gammel version i øjeblikket!",
['errorGetCurrentVersion'] = "Der opstod en fejl under forsøget på at hente den nuværende version!",
}
4 changes: 4 additions & 0 deletions [esx_addons]/esx_dmvschool/locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ Locales['en'] = {
['errors'] = 'mistakes: ~r~%s/%s',
['you_damaged_veh'] = 'you damaged the vehicle',
['not_enough_money'] = 'You don\'t have enough money',
['yourVersion'] = "Your version: ",
['latestVersion'] = "You are using the latest version!",
['needUpdateResource'] = "You need download latest version! You are using an old version at the moment!",
['errorGetCurrentVersion'] = "An error occurred while trying to get the current version!"
}
60 changes: 32 additions & 28 deletions [esx_addons]/esx_dmvschool/locales/es.lua
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
Locales['es'] = {
['you_paid'] = 'Pagaste %s$ a la autoescuela',
['go_next_point'] = '¡Vete al siguiente punto!',
['in_town_speed'] = '¡Entraste a la ciudad, presta atención a tu velocidad! Límite de velocidad: %s km/h',
['next_point_speed'] = '¡Vete al siguiente punto! Límite de velocidad: %s km/h',
['stop_for_ped'] = '~r~Para en el paso de peatones',
['good_lets_cont'] = 'Bien, continua',
['stop_look_left'] = '~r~Para y mira a la izquierda. Límite de velocidad: %s km/h',
['good_turn_right'] = 'Bien, gira a la derecha y sigue la línea',
['watch_traffic_lightson'] = '¡Mira el tráfico y enciende las luces!',
['stop_for_passing'] = '¡~r~Para para que pasen los vehículos!',
['hway_time'] = '¡Es hora de conducir por la autopista! Límite de velocidad: %s km/h',
['gratz_stay_alert'] = '¡Estoy impresionado pero no dejes de estar ~r~alerta mientras conduces!',
['passed_test'] = 'Has aprobado el examen, ¡Enorabuena!',
['failed_test'] = 'Has ~r~suspendido el examen, ¡Más suerte la próxima vez!',
['theory_test'] = 'Examen teórico de conducir',
['road_test_car'] = 'Examen práctico de conducir',
['road_test_bike'] = 'Examen práctico de moto',
['road_test_truck'] = 'Examen práctico de camiones',
['school_item'] = '%s$',
['driving_school'] = 'Escuela de conducción',
['press_open_menu'] = 'Pulsa [E] para abrir el menú',
['driving_school_blip'] = 'Autoescuela',
['driving_test_complete'] = 'Examen de conducir finalizado',
['driving_too_fast'] = '¡~r~Estás conduciendo muy rápido, el límite de velocidad actual es: %s km/h!',
Locales['en'] = {
['you_paid'] = 'you paid $%s to the DMV school',
['go_next_point'] = 'go to the next point!',
['in_town_speed'] = 'entered town, pay attention to your speed! Speed Limit: %s km/h',
['next_point_speed'] = 'go to the next point! Speed Limit: %s km/h',
['stop_for_ped'] = '~r~Stop for the pedestrian crossing',
['good_lets_cont'] = 'Good, continue.',
['stop_look_left'] = '~r~Stop and look left. Speed Limit: %s km/h',
['good_turn_right'] = 'Good, turn right and follow the line',
['watch_traffic_lightson'] = 'watch the traffic and turn on your lights!',
['stop_for_passing'] = '~r~Stop for passing vehicles!',
['hway_time'] = 'it\'s time to drive on the highway! Speed Limit: %s km/h',
['gratz_stay_alert'] = 'i\'m impressed, but don\'t forget to stay ~r~alert whilst driving!',
['passed_test'] = 'you passed the test, congratulations!',
['failed_test'] = 'you ~r~failed the test, better luck next time!',
['theory_test'] = 'theoretical Driving Test',
['road_test_car'] = 'driving Test',
['road_test_bike'] = 'motorcycle Skills Test',
['road_test_truck'] = 'truck Skills Test',
['school_item'] = '$%s',
['driving_school'] = 'driving School',
['press_open_menu'] = 'press [E] to open the menu',
['driving_school_blip'] = 'driving School',
['driving_test_complete'] = 'driving test completed',
['driving_too_fast'] = '~r~You\'re driving too fast, the current speed limit is: %s km/h!',
['test_failed_go_to_start_point'] = '~r~Go to the starting point, because you failed the test!',
['errors'] = 'Fallos: ~r~%s / %s',
['you_damaged_veh'] = '¡Has dañado el vehículo!',
['not_enough_money'] = 'No tienes suficiente dinero'
['errors'] = 'mistakes: ~r~%s/%s',
['you_damaged_veh'] = 'you damaged the vehicle',
['not_enough_money'] = 'You don\'t have enough money',
['yourVersion'] = "Your version: ",
['latestVersion'] = "You are using the latest version!",
['needUpdateResource'] = "You need download latest version! You are using an old version at the moment!",
['errorGetCurrentVersion'] = "An error occurred while trying to get the current version!"
}
6 changes: 5 additions & 1 deletion [esx_addons]/esx_dmvschool/locales/fi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ Locales['fi'] = {
['test_failed_go_to_start_point'] = '~r~Go to the starting point, because you failed the test!',
['errors'] = 'mistakes: ~r~%s/%s',
['you_damaged_veh'] = 'Vahingoitit ajoneuvoa. Aja varovaisemmin...',
['not_enough_money'] = 'Sinulla ei ole tarpeeksi rahaa'
['not_enough_money'] = 'Sinulla ei ole tarpeeksi rahaa',
['yourVersion'] = "Versiosi: ",
['latestVersion'] = "Käytät uusinta versiota!",
['needUpdateResource'] = "Sinun täytyy ladata uusin versio! Käytät tällä hetkellä vanhaa versiota!",
['errorGetCurrentVersion'] = "Virhe tapahtui haettaessa nykyistä versiota!"
}
6 changes: 5 additions & 1 deletion [esx_addons]/esx_dmvschool/locales/fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ Locales['fr'] = {
['test_failed_go_to_start_point'] = '~r~Go to the starting point, because you failed the test!',
['errors'] = 'erreurs: ~r~%s/%s',
['you_damaged_veh'] = 'Vous avez endommagé votre véhicule',
['not_enough_money'] = 'Tu n\'as pas assez d\'argent'
['not_enough_money'] = 'Tu n\'as pas assez d\'argent',
['yourVersion'] = "Votre version : ",
['latestVersion'] = "Vous utilisez la dernière version !",
['needUpdateResource'] = "Vous devez télécharger la dernière version ! Vous utilisez actuellement une ancienne version !",
['errorGetCurrentVersion'] = "Une erreur s'est produite lors de la récupération de la version actuelle !"
}
4 changes: 4 additions & 0 deletions [esx_addons]/esx_dmvschool/locales/hu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ Locales['hu'] = {
['errors'] = 'Hibapontok: ~r~%s/%s',
['you_damaged_veh'] = 'Összetörted az autót, ez drága lesz.',
['not_enough_money'] = 'Nincs elég pénzed!',
['yourVersion'] = "A verziód: ",
['latestVersion'] = "A legújabb verziót használod!",
['needUpdateResource'] = "Le kell töltened a legújabb verziót! Jelenleg egy régi verziót használsz!",
['errorGetCurrentVersion'] = "Hiba történt az aktuális verzió lekérése közben!"
}
4 changes: 4 additions & 0 deletions [esx_addons]/esx_dmvschool/locales/it.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ Locales['it'] = {
['errors'] = 'errori: ~r~%s/%s',
['you_damaged_veh'] = 'hai danneggiato il veicolo',
['not_enough_money'] = 'non hai abbastanza soldi',
['yourVersion'] = "La tua versione: ",
['latestVersion'] = "Stai usando l'ultima versione!",
['needUpdateResource'] = "Devi scaricare l'ultima versione! Stai usando una versione vecchia!",
['errorGetCurrentVersion'] = "Si è verificato un errore durante il recupero della versione corrente!"
}
4 changes: 4 additions & 0 deletions [esx_addons]/esx_dmvschool/locales/nl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ Locales['nl'] = {
['errors'] = 'Fouten: ~r~%s/%s',
['you_damaged_veh'] = 'Je hebt het voertuig beschadigd',
['not_enough_money'] = 'Je hebt niet genoeg geld',
['yourVersion'] = "Jouw versie: ",
['latestVersion'] = "Je gebruikt de nieuwste versie!",
['needUpdateResource'] = "Je moet de nieuwste versie downloaden! Je gebruikt momenteel een oude versie!",
['errorGetCurrentVersion'] = "Er is een fout opgetreden bij het ophalen van de huidige versie!"
}
6 changes: 5 additions & 1 deletion [esx_addons]/esx_dmvschool/locales/pl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ Locales['pl'] = {
['test_failed_go_to_start_point'] = '~r~Go to the starting point, because you failed the test!',
['errors'] = 'błędy: ~r~%s/%s',
['you_damaged_veh'] = 'uszkodziłeś auto',
['not_enough_money'] = 'Nie masz wystarczająco dużo pieniędzy'
['not_enough_money'] = 'Nie masz wystarczająco dużo pieniędzy',
['yourVersion'] = "Twoja wersja: ",
['latestVersion'] = "Używasz najnowszej wersji!",
['needUpdateResource'] = "Musisz pobrać najnowszą wersję! Obecnie używasz starej wersji!",
['errorGetCurrentVersion'] = "Wystąpił błąd podczas pobierania aktualnej wersji!"
}
4 changes: 4 additions & 0 deletions [esx_addons]/esx_dmvschool/locales/sr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ Locales['sr'] = {
['errors'] = 'Greške: ~r~%s/%s',
['you_damaged_veh'] = 'Oštetili ste vozilo',
['not_enough_money'] = 'Nemate dovoljno novca',
['yourVersion'] = "Vaša verzija: ",
['latestVersion'] = "Koristite najnoviju verziju!",
['needUpdateResource'] = "Morate preuzeti najnoviju verziju! Trenutno koristite staru verziju!",
['errorGetCurrentVersion'] = "Došlo je do greške prilikom pokušaja dobavljanja trenutne verzije!"
}
4 changes: 4 additions & 0 deletions [esx_addons]/esx_dmvschool/locales/sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ Locales['sv'] = {
['errors'] = 'Misstag: ~r~%s/%s',
['you_damaged_veh'] = 'Du skadade fordonet',
['not_enough_money'] = 'Du har inte tillräckligt med pengar',
['yourVersion'] = "Din version: ",
['latestVersion'] = "Du använder den senaste versionen!",
['needUpdateResource'] = "Du måste ladda ner den senaste versionen! Du använder för närvarande en gammal version!",
['errorGetCurrentVersion'] = "Ett fel uppstod när den aktuella versionen försöktes hämtas!"
}
4 changes: 4 additions & 0 deletions [esx_addons]/esx_dmvschool/locales/tr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@ Locales['tr'] = {
['errors'] = 'Hatalar: ~r~%s/%s',
['you_damaged_veh'] = 'Araç hasar gördü',
['not_enough_money'] = 'Yeterli paranız yok',
['yourVersion'] = "Sürümünüz: ",
['latestVersion'] = "En son sürümü kullanıyorsunuz!",
['needUpdateResource'] = "En son sürümü indirmeniz gerekiyor! Şu anda eski bir sürüm kullanıyorsunuz!",
['errorGetCurrentVersion'] = "Mevcut sürüm alınmaya çalışılırken bir hata oluştu!"
}

4 changes: 4 additions & 0 deletions [esx_addons]/esx_dmvschool/locales/zh-cn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ Locales['zh-cn'] = {
['errors'] = '失误: ~r~%s~s~/~g~%s~s~',
['you_damaged_veh'] = '载具出现受损!',
['not_enough_money'] = '您暂无足够现金',
['yourVersion'] = "你的版本:",
['latestVersion'] = "你正在使用最新版本!",
['needUpdateResource'] = "你需要下载最新版本!你当前使用的是旧版本!",
['errorGetCurrentVersion'] = "尝试获取当前版本时发生错误!"
}
Loading