mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 18:01:31 +00:00
Fix for latest esx
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# esx_society
|
||||
|
||||
Society management for ESX. Adds employee management (hire, fire, promote / demote, change salary), society bank accounts and money washing. It's crucial that this script gets started before all resources that utilize societies do, or else many things will go wrong.
|
||||
|
||||
## Requirements
|
||||
@@ -52,7 +53,7 @@ end, {wash = false}) -- set custom options, e.g disable washing
|
||||
### License
|
||||
esx_society - societies for ESX
|
||||
|
||||
Copyright (C) 2015-2018 Jérémie N'gadi
|
||||
Copyright (C) 2015-2020 Jérémie N'gadi
|
||||
|
||||
This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.
|
||||
|
||||
|
||||
+7
-8
@@ -272,10 +272,9 @@ ESX.RegisterServerCallback('esx_society:setJob', function(source, cb, identifier
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_society:setJobSalary', function(source, cb, job, grade, salary)
|
||||
local isBoss = isPlayerBoss(source, job)
|
||||
local identifier = GetPlayerIdentifier(source, 0)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if isBoss then
|
||||
if xPlayer.job.name == job and xPlayer.job.grade_name == 'boss' then
|
||||
if salary <= Config.MaxSalary then
|
||||
MySQL.Async.execute('UPDATE job_grades SET salary = @salary WHERE job_name = @job_name AND grade = @grade', {
|
||||
['@salary'] = salary,
|
||||
@@ -286,21 +285,21 @@ ESX.RegisterServerCallback('esx_society:setJobSalary', function(source, cb, job,
|
||||
local xPlayers = ESX.GetPlayers()
|
||||
|
||||
for i=1, #xPlayers, 1 do
|
||||
local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
|
||||
local xTarget = ESX.GetPlayerFromId(xPlayers[i])
|
||||
|
||||
if xPlayer.job.name == job and xPlayer.job.grade == grade then
|
||||
xPlayer.setJob(job, grade)
|
||||
if xTarget.job.name == job and xTarget.job.grade == grade then
|
||||
xTarget.setJob(job, grade)
|
||||
end
|
||||
end
|
||||
|
||||
cb()
|
||||
end)
|
||||
else
|
||||
print(('esx_society: %s attempted to setJobSalary over config limit!'):format(identifier))
|
||||
print(('esx_society: %s attempted to setJobSalary over config limit!'):format(xPlayer.identifier))
|
||||
cb()
|
||||
end
|
||||
else
|
||||
print(('esx_society: %s attempted to setJobSalary'):format(identifier))
|
||||
print(('esx_society: %s attempted to setJobSalary'):format(xPlayer.identifier))
|
||||
cb()
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user