mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Fix MySQL to get propper job grade
and filter it if the character is Unemployed
This commit is contained in:
@@ -56,12 +56,16 @@ function GetPlayerCharacters(source)
|
||||
|
||||
for i = 1, #Chars, 1 do
|
||||
charJob = MySQLAsyncExecute("SELECT * FROM `jobs` WHERE `name` = '"..Chars[i].job.."'")
|
||||
charJobgrade = MySQLAsyncExecute("SELECT * FROM `job_grades` WHERE `grade` = '"..Chars[i].job_grade.."'")
|
||||
charJobgrade = MySQLAsyncExecute("SELECT * FROM `job_grades` WHERE `grade` = '"..Chars[i].job_grade.."' AND `job_name` = '"..Chars[i].job.."'")
|
||||
local accounts = json.decode(Chars[i].accounts)
|
||||
Chars[i].bank = accounts["bank"]
|
||||
Chars[i].money = accounts["money"]
|
||||
Chars[i].job = charJob[1].label
|
||||
Chars[i].job_grade = charJobgrade[1].label
|
||||
if charJobgrade[1].label ~= "Unemployed" then
|
||||
Chars[i].job_grade = charJobgrade[1].label
|
||||
else
|
||||
Chars[i].job_grade = ""
|
||||
end
|
||||
end
|
||||
|
||||
return Chars
|
||||
|
||||
Reference in New Issue
Block a user