Skip to content

Commit

Permalink
Merge pull request #1282 from t1ger-scripts/dev
Browse files Browse the repository at this point in the history
ESX.CreateJob - Fixed error for skin no default value
  • Loading branch information
Arctos2win authored Jan 14, 2024
2 parents c010d53 + 82a9a1a commit a88846f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions [core]/es_extended/server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,12 @@ function ESX.CreateJob(name, label, grades)
local job = { name = name, label = label, grades = {} }

for _, v in pairs(grades) do
job.grades[tostring(v.grade)] = { job_name = name, grade = v.grade, name = v.name, label = v.label, salary = v.salary, skin_male = {}, skin_female = {} }
parameters[#parameters + 1] = { name, v.grade, v.name, v.label, v.salary }
job.grades[tostring(v.grade)] = { job_name = name, grade = v.grade, name = v.name, label = v.label, salary = v.salary, skin_male = v.skin_male or '{}', skin_female = v.skin_female or '{}' }
parameters[#parameters + 1] = { name, v.grade, v.name, v.label, v.salary, v.skin_male or '{}', v.skin_female or '{}'}
end

MySQL.insert('INSERT IGNORE INTO jobs (name, label) VALUES (?, ?)', { name, label })
MySQL.prepare('INSERT INTO job_grades (job_name, grade, name, label, salary) VALUES (?, ?, ?, ?, ?)', parameters)
MySQL.prepare('INSERT INTO job_grades (job_name, grade, name, label, salary, skin_male, skin_female) VALUES (?, ?, ?, ?, ?, ?, ?)', parameters)

ESX.Jobs[name] = job
end
Expand Down

0 comments on commit a88846f

Please sign in to comment.