From ef07d479862c1e5c65a01d5c9fa7fcb5ca526cf9 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:14:30 +0200 Subject: [PATCH 1/3] fix: esx_society\client\main.lua fix lint error --- .../resources/[esx]/esx_society/client/main.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server-data/resources/[esx]/esx_society/client/main.lua b/server-data/resources/[esx]/esx_society/client/main.lua index 10b75374a..178f0c93f 100644 --- a/server-data/resources/[esx]/esx_society/client/main.lua +++ b/server-data/resources/[esx]/esx_society/client/main.lua @@ -45,7 +45,7 @@ function UpdateSocietyMoneyHUDElement(money) TriggerEvent('esx_society:setSocietyMoney', money) end -function OpenBossMenu(society, close, options) +function OpenBossMenu(society, _, options) options = options or {} local elements = { {unselectable = true, icon = "fas fa-user", title = _U('boss_menu')} @@ -165,11 +165,11 @@ function OpenManageEmployeesMenu(society, options) elements[#elements+1] = {icon = "fas fa-arrow-left", title = "Return", value = "return"} - ESX.OpenContext("right", elements, function(_,element) + ESX.OpenContext("right", elements, function(_, element) if element.value == "employee_list" then OpenEmployeeList(society, options) elseif element.value == "recruit" then - OpenRecruitMenu(society, options) + OpenRecruitMenu(society, options) elseif element.value == "return" then OpenBossMenu(society, nil, options) end @@ -190,7 +190,7 @@ function OpenEmployeeList(society, options) elements[#elements+1] = {icon = "fas fa-arrow-left", title = "Return", value = "return"} - ESX.OpenContext("right", elements, function(menu,element) + ESX.OpenContext("right", elements, function(_,element) if element.value == "return" then OpenManageEmployeesMenu(society, options) else @@ -200,7 +200,7 @@ function OpenEmployeeList(society, options) {icon = "fas fa-user", title = "Fire", value = "fire"}, {icon = "fas fa-arrow-left", title = "Return", value = "return"} } - ESX.OpenContext("right", elements2, function(menu2,element2) + ESX.OpenContext("right", elements2, function(_,element2) local employee = element.data if element2.value == "promote" then ESX.CloseContext() From 508227f95b5223eeba848ee39156c31c9b2f7473 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Wed, 20 Sep 2023 17:17:32 +0200 Subject: [PATCH 2/3] fix: esx_society\client\main.lua fix lint error --- server-data/resources/[esx]/esx_society/client/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-data/resources/[esx]/esx_society/client/main.lua b/server-data/resources/[esx]/esx_society/client/main.lua index 178f0c93f..1c495bd0c 100644 --- a/server-data/resources/[esx]/esx_society/client/main.lua +++ b/server-data/resources/[esx]/esx_society/client/main.lua @@ -271,7 +271,7 @@ function OpenPromoteMenu(society, employee, options) elements[#elements+1] = {icon = "fas fa-arrow-left", title = "Return", value = "return"} - ESX.OpenContext("right", elements, function(menu,element) + ESX.OpenContext("right", elements, function(_, element) if element.value == "return" then OpenEmployeeList(society, options) else @@ -281,7 +281,7 @@ function OpenPromoteMenu(society, employee, options) OpenEmployeeList(society, options) end, employee.identifier, society, element.value, 'promote') end - end, function(menu) + end, function() OpenEmployeeList(society, options) end) end, society) From 367f134cf939d51de3c5bc10d43faf0a3df1093a Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Wed, 20 Sep 2023 17:28:58 +0200 Subject: [PATCH 3/3] fix: esx_society\server\main.lua fix lint error --- .../[esx]/esx_society/server/main.lua | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server-data/resources/[esx]/esx_society/server/main.lua b/server-data/resources/[esx]/esx_society/server/main.lua index 4873663aa..bb3ea16b0 100644 --- a/server-data/resources/[esx]/esx_society/server/main.lua +++ b/server-data/resources/[esx]/esx_society/server/main.lua @@ -136,7 +136,7 @@ AddEventHandler('esx_society:washMoney', function(society, amount) xPlayer.removeAccountMoney('black_money', amount, "Washing") MySQL.insert('INSERT INTO society_moneywash (identifier, society, amount) VALUES (?, ?, ?)', {xPlayer.identifier, society, amount}, - function(rowsChanged) + function() xPlayer.showNotification(_U('you_have', ESX.Math.GroupDigits(amount))) end) else @@ -205,7 +205,7 @@ ESX.RegisterServerCallback('esx_society:getEmployees', function(_, cb, society) local employees = {} local xPlayers = ESX.GetExtendedPlayers('job', society) - for i=1, #(xPlayers) do + for i=1, #(xPlayers) do local xPlayer = xPlayers[i] local name = xPlayer.name @@ -234,11 +234,11 @@ ESX.RegisterServerCallback('esx_society:getEmployees', function(_, cb, society) MySQL.query(query, {society}, function(result) - for k, row in pairs(result) do + for _, row in pairs(result) do local alreadyInTable local identifier = row.identifier - for k, v in pairs(employees) do + for _, v in pairs(employees) do if v.identifier == identifier then alreadyInTable = true end @@ -270,11 +270,11 @@ ESX.RegisterServerCallback('esx_society:getEmployees', function(_, cb, society) end) -ESX.RegisterServerCallback('esx_society:getJob', function(source, cb, society) +ESX.RegisterServerCallback('esx_society:getJob', function(_, cb, society) local job = json.decode(json.encode(Jobs[society])) local grades = {} - for k,v in pairs(job.grades) do + for _,v in pairs(job.grades) do table.insert(grades, v) end @@ -311,7 +311,7 @@ ESX.RegisterServerCallback('esx_society:setJob', function(source, cb, identifier cb() else MySQL.update('UPDATE users SET job = ?, job_grade = ? WHERE identifier = ?', {job, grade, identifier}, - function(rowsChanged) + function() cb() end) end @@ -328,7 +328,7 @@ ESX.RegisterServerCallback('esx_society:setJobSalary', function(source, cb, job, if xPlayer.job.name == job and xPlayer.job.grade_name == 'boss' then if salary <= Config.MaxSalary then MySQL.update('UPDATE job_grades SET salary = ? WHERE job_name = ? AND grade = ?', {salary, job, grade}, - function(rowsChanged) + function() Jobs[job].grades[tostring(grade)].salary = salary ESX.RefreshJobs() Wait(1) @@ -356,7 +356,7 @@ ESX.RegisterServerCallback('esx_society:setJobLabel', function(source, cb, job, if xPlayer.job.name == job and xPlayer.job.grade_name == 'boss' then MySQL.update('UPDATE job_grades SET label = ? WHERE job_name = ? AND grade = ?', {label, job, grade}, - function(rowsChanged) + function() Jobs[job].grades[tostring(grade)].label = label ESX.RefreshJobs() Wait(1) @@ -376,12 +376,12 @@ ESX.RegisterServerCallback('esx_society:setJobLabel', function(source, cb, job, end) local getOnlinePlayers, onlinePlayers = false, {} -ESX.RegisterServerCallback('esx_society:getOnlinePlayers', function(source, cb) +ESX.RegisterServerCallback('esx_society:getOnlinePlayers', function(_, cb) if getOnlinePlayers == false and next(onlinePlayers) == nil then -- Prevent multiple xPlayer loops from running in quick succession getOnlinePlayers, onlinePlayers = true, {} local xPlayers = ESX.GetExtendedPlayers() - for i=1, #(xPlayers) do + for i=1, #(xPlayers) do local xPlayer = xPlayers[i] table.insert(onlinePlayers, { source = xPlayer.source, @@ -400,7 +400,7 @@ ESX.RegisterServerCallback('esx_society:getOnlinePlayers', function(source, cb) cb(onlinePlayers) end) -ESX.RegisterServerCallback('esx_society:getVehiclesInGarage', function(source, cb, societyName) +ESX.RegisterServerCallback('esx_society:getVehiclesInGarage', function(_, cb, societyName) local society = GetSociety(societyName) if not society then print(('[^3WARNING^7] Attempting To get a non-existing society - %s!'):format(societyName))