From 8b4d8b4d3b204ea9f7fc108b7fe95f5cd117f923 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sun, 19 Nov 2023 19:41:10 +0100 Subject: [PATCH] fix: fix lint error --- .github/CHANGELOG.md | 3 +- .../esx_dmvschool/client/main.lua | 14 ++++---- .../[esx_addons]/esx_dmvschool/config.lua | 32 +++++++++---------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 27f8beb56..f6403f6be 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -54,4 +54,5 @@ 29. [bpt_deliveries]: chore: clean up the code @bitpredator 30. [esx-radialmenu]: chore: fix lint error + clean up the code @bitpredator 31. [esx-qalle-jail]: fix: fix lint error @bitpredator -32. [esx_multicaracter]: fix: fix lint error @bitpredator \ No newline at end of file +32. [esx_multicaracter]: fix: fix lint error @bitpredator +33. [esx_dmvschool]: fix: fix lint error @bitpredator \ No newline at end of file diff --git a/server-data/resources/[esx_addons]/esx_dmvschool/client/main.lua b/server-data/resources/[esx_addons]/esx_dmvschool/client/main.lua index 5945cf979..075e2e2f7 100644 --- a/server-data/resources/[esx_addons]/esx_dmvschool/client/main.lua +++ b/server-data/resources/[esx_addons]/esx_dmvschool/client/main.lua @@ -131,7 +131,7 @@ function OpenDMVSchoolMenu() end end - ESX.OpenContext("right", elements, function(menu,element) + ESX.OpenContext("right", elements, function(_, element) if element.value == "theory_test" then ESX.TriggerServerCallback('esx_dmvschool:canYouPay', function(haveMoney) if haveMoney then @@ -151,26 +151,26 @@ function OpenDMVSchoolMenu() end end, element.type) end - end, function(menu) + end, function() CurrentAction = 'dmvschool_menu' CurrentActionMsg = _U('press_open_menu') CurrentActionData = {} end) end -RegisterNUICallback('question', function(data, cb) +RegisterNUICallback('question', function(_, cb) SendNUIMessage({ openSection = 'question' }) cb() end) -RegisterNUICallback('close', function(data, cb) +RegisterNUICallback('close', function(_, cb) StopTheoryTest(true) cb() end) -RegisterNUICallback('kick', function(data, cb) +RegisterNUICallback('kick', function(_, cb) StopTheoryTest(false) cb() end) @@ -183,7 +183,7 @@ AddEventHandler('esx_dmvschool:hasEnteredMarker', function(zone) end end) -AddEventHandler('esx_dmvschool:hasExitedMarker', function(zone) +AddEventHandler('esx_dmvschool:hasExitedMarker', function() CurrentAction = nil ESX.CloseContext() end) @@ -214,7 +214,7 @@ CreateThread(function() local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) - for k,v in pairs(Config.Zones) do + for _, v in pairs(Config.Zones) do local Pos = vector3(v.Pos.x, v.Pos.y, v.Pos.z) if(v.Type ~= -1 and #(coords - Pos) < Config.DrawDistance) then sleep = 0 diff --git a/server-data/resources/[esx_addons]/esx_dmvschool/config.lua b/server-data/resources/[esx_addons]/esx_dmvschool/config.lua index c7e3aca69..603254371 100644 --- a/server-data/resources/[esx_addons]/esx_dmvschool/config.lua +++ b/server-data/resources/[esx_addons]/esx_dmvschool/config.lua @@ -45,21 +45,21 @@ Config.CheckPoints = { { Pos = {x = 255.139, y = -1400.731, z = 29.537}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function() 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) + Action = function() DrawMissionText(_U('go_next_point'), 5000) end }, { Pos = {x = 234.907, y = -1345.385, z = 29.542}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function(_, vehicle) CreateThread(function() DrawMissionText(_U('stop_for_ped'), 5000) PlaySound(-1, 'RACE_PLACED', 'HUD_AWARDS', false, 0, true) @@ -74,7 +74,7 @@ Config.CheckPoints = { { Pos = {x = 217.821, y = -1410.520, z = 28.292}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function(_, vehicle, setCurrentZoneType) setCurrentZoneType('town') CreateThread(function() @@ -91,21 +91,21 @@ Config.CheckPoints = { { Pos = {x = 178.550, y = -1401.755, z = 27.725}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function() DrawMissionText(_U('watch_traffic_lightson'), 5000) end }, { Pos = {x = 113.160, y = -1365.276, z = 27.725}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function() DrawMissionText(_U('go_next_point'), 5000) end }, { Pos = {x = -73.542, y = -1364.335, z = 27.789}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function(_, vehicle) DrawMissionText(_U('stop_for_passing'), 5000) PlaySound(-1, 'RACE_PLACED', 'HUD_AWARDS', false, 0, true) FreezeEntityPosition(vehicle, true) @@ -116,21 +116,21 @@ Config.CheckPoints = { { Pos = {x = -355.143, y = -1420.282, z = 27.868}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function() DrawMissionText(_U('go_next_point'), 5000) end }, { Pos = {x = -439.148, y = -1417.100, z = 27.704}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function() DrawMissionText(_U('go_next_point'), 5000) end }, { Pos = {x = -453.790, y = -1444.726, z = 27.665}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function(_, _, setCurrentZoneType) setCurrentZoneType('freeway') DrawMissionText(_U('hway_time', Config.SpeedLimits['freeway']), 5000) @@ -140,28 +140,28 @@ Config.CheckPoints = { { Pos = {x = -463.237, y = -1592.178, z = 37.519}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function() DrawMissionText(_U('go_next_point'), 5000) end }, { Pos = {x = -900.647, y = -1986.28, z = 26.109}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function() DrawMissionText(_U('go_next_point'), 5000) end }, { Pos = {x = 1225.759, y = -1948.792, z = 38.718}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function() DrawMissionText(_U('go_next_point'), 5000) end }, { Pos = {x = 1225.759, y = -1948.792, z = 38.718}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function(_, _, setCurrentZoneType) setCurrentZoneType('town') DrawMissionText(_U('in_town_speed', Config.SpeedLimits['town']), 5000) end @@ -169,7 +169,7 @@ Config.CheckPoints = { { Pos = {x = 1163.603, y = -1841.771, z = 35.679}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function() DrawMissionText(_U('gratz_stay_alert'), 5000) PlaySound(-1, 'RACE_PLACED', 'HUD_AWARDS', false, 0, true) end @@ -177,7 +177,7 @@ Config.CheckPoints = { { Pos = {x = 235.283, y = -1398.329, z = 28.921}, - Action = function(playerPed, vehicle, setCurrentZoneType) + Action = function(_, vehicle) ESX.Game.DeleteVehicle(vehicle) end }