From 4cf6aa1033e1a0708bb6827f79b41d9bd4f1364d Mon Sep 17 00:00:00 2001 From: t1ger-scripts <67964693+t1ger-scripts@users.noreply.github.com> Date: Sun, 14 Jan 2024 04:09:31 +0100 Subject: [PATCH 1/2] Fixed error for skin no default value skin_male and skin_female fields in job_grades table does not have a default value and there for server console spits error when creating job in runtime. This is now fixed. --- [core]/es_extended/server/functions.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index 49ee3a8e9..e6402fd2c 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -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 From 82a9a1a6a8a662557504952611c5a1b7bd399cae Mon Sep 17 00:00:00 2001 From: t1ger-scripts <67964693+t1ger-scripts@users.noreply.github.com> Date: Sun, 14 Jan 2024 13:38:40 +0100 Subject: [PATCH 2/2] Fixed typo fixed a typo --- [core]/es_extended/server/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index e6402fd2c..87751761f 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -407,7 +407,7 @@ 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 = v.skin_male or {}, skin_female = v.skin_female or {} } + 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