mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Improved string formatting, minor edits
This commit is contained in:
+14
-15
@@ -125,21 +125,21 @@ function OpenDMVSchoolMenu()
|
||||
local elements = {}
|
||||
|
||||
if not ownedLicenses['dmv'] then
|
||||
table.insert(elements, {label = _U('theory_test') .. Config.Prices['dmv'], value = 'theory_test'})
|
||||
table.insert(elements, {label = _U('theory_test') .. ' $<span style="color: green;">' .. Config.Prices['dmv'] .. '</span>', value = 'theory_test'})
|
||||
end
|
||||
|
||||
if ownedLicenses['dmv'] then
|
||||
|
||||
if not ownedLicenses['drive'] then
|
||||
table.insert(elements, {label = _U('road_test_car') .. Config.Prices['drive'], value = 'drive_test', type = 'drive'})
|
||||
table.insert(elements, {label = _U('road_test_car') .. ' $<span style="color: green;">' .. Config.Prices['drive'] .. '</span>', value = 'drive_test', type = 'drive'})
|
||||
end
|
||||
|
||||
if not ownedLicenses['drive_bike'] then
|
||||
table.insert(elements, {label = _U('road_test_bike') .. Config.Prices['drive_bike'], value = 'drive_test', type = 'drive_bike'})
|
||||
table.insert(elements, {label = _U('road_test_bike') .. ' $<span style="color: green;">' .. Config.Prices['drive_bike'] .. '</span>', value = 'drive_test', type = 'drive_bike'})
|
||||
end
|
||||
|
||||
if not ownedLicenses['drive_truck'] then
|
||||
table.insert(elements, {label = _U('road_test_truck') .. Config.Prices['drive_truck'], value = 'drive_test', type = 'drive_truck'})
|
||||
table.insert(elements, {label = _U('road_test_truck') .. ' $<span style="color: green;">' .. Config.Prices['drive_truck'] .. '</span>', value = 'drive_test', type = 'drive_truck'})
|
||||
end
|
||||
|
||||
end
|
||||
@@ -239,7 +239,7 @@ end)
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
|
||||
Citizen.Wait(0)
|
||||
Citizen.Wait(10)
|
||||
|
||||
local coords = GetEntityCoords(GetPlayerPed(-1))
|
||||
|
||||
@@ -256,7 +256,7 @@ end)
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
|
||||
Citizen.Wait(0)
|
||||
Citizen.Wait(10)
|
||||
|
||||
local coords = GetEntityCoords(GetPlayerPed(-1))
|
||||
local isInMarker = false
|
||||
@@ -287,7 +287,7 @@ end)
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
|
||||
Citizen.Wait(0)
|
||||
Citizen.Wait(10)
|
||||
|
||||
if CurrentTest == 'theory' then
|
||||
|
||||
@@ -308,7 +308,7 @@ end)
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
|
||||
Citizen.Wait(0)
|
||||
Citizen.Wait(10)
|
||||
|
||||
if CurrentAction ~= nil then
|
||||
|
||||
@@ -335,7 +335,7 @@ end)
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
|
||||
Citizen.Wait(0)
|
||||
Citizen.Wait(10)
|
||||
|
||||
if CurrentTest == 'drive' then
|
||||
|
||||
@@ -394,7 +394,7 @@ end)
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
|
||||
Citizen.Wait(0)
|
||||
Citizen.Wait(10)
|
||||
|
||||
if CurrentTest == 'drive' then
|
||||
|
||||
@@ -416,8 +416,8 @@ Citizen.CreateThread(function()
|
||||
DriveErrors = DriveErrors + 1
|
||||
IsAboveSpeedLimit = true
|
||||
|
||||
ESX.ShowNotification(_U('driving_too_fast') .. v .. 'km/h')
|
||||
ESX.ShowNotification(_U('errors') .. DriveErrors .. '~s~/' .. Config.MaxErrors)
|
||||
ESX.ShowNotification(_U('driving_too_fast', v))
|
||||
ESX.ShowNotification(_U('errors', DriveErrors, Config.MaxErrors))
|
||||
|
||||
end
|
||||
|
||||
@@ -435,9 +435,8 @@ Citizen.CreateThread(function()
|
||||
DriveErrors = DriveErrors + 1
|
||||
|
||||
ESX.ShowNotification(_U('you_damaged_veh'))
|
||||
ESX.ShowNotification(_U('errors') .. DriveErrors .. '~s~/' .. Config.MaxErrors)
|
||||
LastVehicleHealth = health
|
||||
|
||||
ESX.ShowNotification(_U('errors', DriveErrors, Config.MaxErrors))
|
||||
LastVehicleHealth = health
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
+11
-11
@@ -1,6 +1,6 @@
|
||||
Locales['en'] = {
|
||||
|
||||
['you_paid'] = 'you paid ~g~$',
|
||||
['you_paid'] = 'you paid ~g~$%s~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: ~y~',
|
||||
['next_point_speed'] = 'go to the next point! Speed Limit: ~y~',
|
||||
@@ -8,22 +8,22 @@ Locales['en'] = {
|
||||
['good_lets_cont'] = '~g~Good~s~, continue.',
|
||||
['stop_look_left'] = '~r~Stop~s~ and look ~y~left~s~. Speed Limit:~y~ ',
|
||||
['good_turn_right'] = '~g~Good~s~, turn right and follow the line',
|
||||
['watch_traffic_lightson'] = 'watch traffic, and ~y~turn on your lights~s~!',
|
||||
['watch_traffic_lightson'] = 'watch the traffic and ~y~turn on your lights~s~!',
|
||||
['stop_for_passing'] = '~r~Stop~s~ for passing vehicles!',
|
||||
['hway_time'] = 'it\'s time to drive on the highway! Speed Limit:~y~ ',
|
||||
['gratz_stay_alert'] = 'congrats, stay ~r~alert~s~ whilst driving!',
|
||||
['passed_test'] = 'you ~g~passed~s~ the test',
|
||||
['failed_test'] = 'you ~r~failed~s~ the test',
|
||||
['theory_test'] = 'theoretical Driving Test $',
|
||||
['road_test_car'] = 'driving Test $',
|
||||
['road_test_bike'] = 'motorcycle Skills Test $',
|
||||
['road_test_truck'] = 'cDL Skills Test $',
|
||||
['gratz_stay_alert'] = 'i\'m impressed, but don\'t forget to stay ~r~alert~s~ whilst driving!',
|
||||
['passed_test'] = 'you ~g~passed~s~ the test, congratulations!',
|
||||
['failed_test'] = 'you ~r~failed~s~ 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',
|
||||
['driving_school'] = 'driving School',
|
||||
['press_open_menu'] = 'press ~INPUT_CONTEXT~ to open the menu',
|
||||
['driving_school_blip'] = 'driving School',
|
||||
['driving_test_complete'] = 'driving test completed',
|
||||
['driving_too_fast'] = '~r~You\'re driving too fast!~s~ Speed Limit:~y~ ',
|
||||
['errors'] = 'errors: ~r~',
|
||||
['driving_too_fast'] = '~r~You\'re driving too fast,~s~ the current speed limit is: ~y~%s~s~ km/h!',
|
||||
['errors'] = 'mistakes: ~r~%s~s~/%s',
|
||||
['you_damaged_veh'] = 'you damaged the vehicle',
|
||||
|
||||
}
|
||||
|
||||
+7
-7
@@ -1,6 +1,6 @@
|
||||
Locales['fr'] = {
|
||||
|
||||
['you_paid'] = 'vous avez payé ~g~$',
|
||||
['you_paid'] = 'vous avez payé ~g~$%s~s~',
|
||||
['go_next_point'] = 'allez vers le prochain passage !',
|
||||
['in_town_speed'] = 'entrée en ville, attention à votre vitesse ! Vitesse limite : ~y~',
|
||||
['next_point_speed'] = 'allez vers le prochain passage ! Vitesse limite : ~y~',
|
||||
@@ -14,16 +14,16 @@ Locales['fr'] = {
|
||||
['gratz_stay_alert'] = 'bravo, restez vigiliant!',
|
||||
['passed_test'] = 'vous avez ~g~réussi~s~ le test',
|
||||
['failed_test'] = 'vous avez ~r~raté~s~ le test',
|
||||
['theory_test'] = 'examen du code $',
|
||||
['road_test_car'] = 'examen de conduite [voiture] $',
|
||||
['road_test_bike'] = 'examen de conduite [moto] $',
|
||||
['road_test_truck'] = 'examen de conduite [camion] $',
|
||||
['theory_test'] = 'examen du code',
|
||||
['road_test_car'] = 'examen de conduite [voiture]',
|
||||
['road_test_bike'] = 'examen de conduite [moto]',
|
||||
['road_test_truck'] = 'examen de conduite [camion]',
|
||||
['driving_school'] = 'ecole de conduite',
|
||||
['press_open_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le menu',
|
||||
['driving_school_blip'] = 'auto-école',
|
||||
['driving_test_complete'] = 'test de conduite terminé',
|
||||
['driving_too_fast'] = 'vous roulez trop vite, vitesse limite : ~y~',
|
||||
['errors'] = 'erreurs : ~r~',
|
||||
['driving_too_fast'] = 'vous roulez trop vite, vitesse limite: ~y~%s~s~ km/h!',
|
||||
['errors'] = 'erreurs : ~r~%s~s~/%s',
|
||||
['you_damaged_veh'] = 'vous avez endommagé votre véhicule',
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
USE `essentialmode`;
|
||||
|
||||
INSERT INTO `licenses` (`type`, `label`) VALUES
|
||||
('dmv', 'Körkortstillstånd'),
|
||||
('drive', 'B-körkort'),
|
||||
('drive_bike', 'A-körkort'),
|
||||
('drive_truck', 'C-körkort')
|
||||
;
|
||||
+13
-18
@@ -3,32 +3,27 @@ ESX = nil
|
||||
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
|
||||
|
||||
AddEventHandler('esx:playerLoaded', function(source)
|
||||
TriggerEvent('esx_license:getLicenses', source, function(licenses)
|
||||
TriggerClientEvent('esx_dmvschool:loadLicenses', source, licenses)
|
||||
end)
|
||||
TriggerEvent('esx_license:getLicenses', source, function(licenses)
|
||||
TriggerClientEvent('esx_dmvschool:loadLicenses', source, licenses)
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_dmvschool:addLicense')
|
||||
AddEventHandler('esx_dmvschool:addLicense', function(type)
|
||||
local _source = source
|
||||
|
||||
local _source = source
|
||||
|
||||
TriggerEvent('esx_license:addLicense', _source, type, function()
|
||||
TriggerEvent('esx_license:getLicenses', _source, function(licenses)
|
||||
TriggerClientEvent('esx_dmvschool:loadLicenses', _source, licenses)
|
||||
end)
|
||||
end)
|
||||
|
||||
TriggerEvent('esx_license:addLicense', _source, type, function()
|
||||
TriggerEvent('esx_license:getLicenses', _source, function(licenses)
|
||||
TriggerClientEvent('esx_dmvschool:loadLicenses', _source, licenses)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_dmvschool:pay')
|
||||
AddEventHandler('esx_dmvschool:pay', function(price)
|
||||
local _source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||
|
||||
local _source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||
|
||||
xPlayer.removeMoney(price)
|
||||
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('you_paid') .. price)
|
||||
|
||||
xPlayer.removeMoney(price)
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('you_paid', price))
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user