From 95f1dad641f70b36a39496d2cb400ac5d54e8aa2 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sun, 19 Nov 2023 15:31:22 +0100 Subject: [PATCH] fix: fix lint error --- .github/CHANGELOG.md | 3 ++- .../[esx_addons]/esx-qalle-jail/client/client.lua | 8 +++----- .../[esx_addons]/esx-qalle-jail/client/utils.lua | 3 +-- .../resources/[esx_addons]/esx-qalle-jail/fxmanifest.lua | 3 +-- .../[esx_addons]/esx-qalle-jail/server/server.lua | 6 +++--- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index fc1f9e2e5..e06c98b2b 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -52,4 +52,5 @@ 27. [esx_addoninventory]: chore: check for nil society @bitpredator 28. [npwd]: chore: npwd update to version 1.8.6 @bitpredator 29. [bpt_deliveries]: chore: clean up the code @bitpredator -30. [esx-radialmenu]: chore: fix lint error + clean up the code @bitpredator \ No newline at end of file +30. [esx-radialmenu]: chore: fix lint error + clean up the code @bitpredator +31. [esx-qalle-jail]: fix: fix lint error @bitpredator \ No newline at end of file diff --git a/server-data/resources/[esx_addons]/esx-qalle-jail/client/client.lua b/server-data/resources/[esx_addons]/esx-qalle-jail/client/client.lua index 7552e7cd7..45581cdcc 100644 --- a/server-data/resources/[esx_addons]/esx-qalle-jail/client/client.lua +++ b/server-data/resources/[esx_addons]/esx-qalle-jail/client/client.lua @@ -277,9 +277,9 @@ function OpenJailMenu() }, function(data2, menu2) local jailTime = tonumber(data2.value) - if jailTime == nil then + if jailTime == nil then ESX.ShowNotification(_U('time_minutes')) - else + else menu2.close() local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() @@ -291,9 +291,7 @@ function OpenJailMenu() title = "Jail Reason" }, function(data3, menu3) - - local reason = data3.value - + local reason = data3.value if reason == nil then ESX.ShowNotification(_U('put_something')) else diff --git a/server-data/resources/[esx_addons]/esx-qalle-jail/client/utils.lua b/server-data/resources/[esx_addons]/esx-qalle-jail/client/utils.lua index 656edb803..676d08af4 100644 --- a/server-data/resources/[esx_addons]/esx-qalle-jail/client/utils.lua +++ b/server-data/resources/[esx_addons]/esx-qalle-jail/client/utils.lua @@ -126,8 +126,7 @@ function TeleportPlayer(pos) table.insert(elements, { label = v, value = v }) end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'teleport_jail', + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'teleport_jail', { title = "Choose Position", align = 'center', diff --git a/server-data/resources/[esx_addons]/esx-qalle-jail/fxmanifest.lua b/server-data/resources/[esx_addons]/esx-qalle-jail/fxmanifest.lua index 76ae5ee15..c046a09f7 100644 --- a/server-data/resources/[esx_addons]/esx-qalle-jail/fxmanifest.lua +++ b/server-data/resources/[esx_addons]/esx-qalle-jail/fxmanifest.lua @@ -18,7 +18,6 @@ server_scripts { client_scripts { '@es_extended/locale.lua', "config.lua", - "client/utils.lua", + "client/*.lua", 'locales/*.lua', - "client/client.lua" } \ No newline at end of file diff --git a/server-data/resources/[esx_addons]/esx-qalle-jail/server/server.lua b/server-data/resources/[esx_addons]/esx-qalle-jail/server/server.lua index bb3363405..45ef6372f 100644 --- a/server-data/resources/[esx_addons]/esx-qalle-jail/server/server.lua +++ b/server-data/resources/[esx_addons]/esx-qalle-jail/server/server.lua @@ -1,6 +1,6 @@ ESX = exports["es_extended"]:getSharedObject() -RegisterCommand("jail", function(src, args, raw) +RegisterCommand("jail", function(src, args) local xPlayer = ESX.GetPlayerFromId(src) if xPlayer["job"]["name"] == "police" then @@ -15,7 +15,7 @@ RegisterCommand("jail", function(src, args, raw) JailPlayer(jailPlayer, jailTime) TriggerClientEvent("esx:showNotification", src, GetPlayerName(jailPlayer) .. " Jailed for " .. jailTime .. " minutes!") - + if args[3] ~= nil then GetRPName(jailPlayer, function(Firstname, Lastname) TriggerClientEvent('chat:addMessage', -1, { args = { "JUDGE", Firstname .. " " .. Lastname .. " Is now in jail for the reason: " .. args[3] }, color = { 249, 166, 0 } }) @@ -139,7 +139,7 @@ function GetRPName(playerId, data) end) end -ESX.RegisterServerCallback("esx-qalle-jail:retrieveJailedPlayers", function(source, cb) +ESX.RegisterServerCallback("esx-qalle-jail:retrieveJailedPlayers", function(_, cb) local jailedPersons = {}