From b3799caff086677f6afc53289406d45a981c59fd Mon Sep 17 00:00:00 2001 From: Complex Date: Fri, 28 Jul 2023 16:23:46 +0200 Subject: [PATCH 1/3] Config Option Added | Police Table Fixes --- server/sv_property.lua | 4 ++-- shared/config.lua | 2 ++ shared/framework.lua | 12 ++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/server/sv_property.lua b/server/sv_property.lua index db39088..60545bf 100644 --- a/server/sv_property.lua +++ b/server/sv_property.lua @@ -476,7 +476,7 @@ RegisterNetEvent("ps-housing:server:showcaseProperty", function(property_id) local jobName = job.name local onDuty = job.onduty - if jobName == "realtor" and onDuty then + if jobName == Config.RealtorJobName and onDuty then local showcase = lib.callback.await('ps-housing:cb:showcase', src) if showcase == "confirm" then property:PlayerEnter(src) @@ -762,7 +762,7 @@ lib.callback.register('ps-housing:cb:getPropertyInfo', function (source, propert local jobName = job.name local onDuty = job.onduty - if not jobName == "realtor" and not onDuty then return end + if not jobName == Config.RealtorJobName and not onDuty then return end local data = {} diff --git a/shared/config.lua b/shared/config.lua index a47e646..9e1bca8 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -35,6 +35,8 @@ Config.MinGradeToRaid = 3 -- Minimum grade to raid a property Config.RaidTimer = 5-- 5 minutes +Config.RealtorJobName = "realtor" -- Set your Real Estate here + -- Realtor Commisions based on job grade, the rest goes to the owner, if any. Config.Commissions = { [0] = 0.05, -- 5% commision for each sale diff --git a/shared/framework.lua b/shared/framework.lua index cd3eaba..37aa211 100644 --- a/shared/framework.lua +++ b/shared/framework.lua @@ -84,7 +84,7 @@ Framework.qb = { local job = PlayerData.job local jobName = job.name local onDuty = job.onduty - return jobName == "realtor" and onDuty + return jobName == Config.RealtorJobName and onDuty end, }, { @@ -96,7 +96,7 @@ Framework.qb = { local job = PlayerData.job local jobName = job.name local onDuty = job.onduty - return jobName == "realtor" and onDuty + return jobName == Config.RealtorJobName and onDuty end, }, { @@ -285,7 +285,7 @@ Framework.ox = { local job = PlayerData.job local jobName = job.name - return jobName == "realtor" + return jobName == Config.RealtorJobName end, }, { @@ -297,7 +297,7 @@ Framework.ox = { local job = PlayerData.job local jobName = job.name local onDuty = job.onduty - return jobName == "realtor" and onDuty + return jobName == Config.RealtorJobName and onDuty end, }, { @@ -320,7 +320,7 @@ Framework.ox = { local gradeAllowed = tonumber(job.grade.level) >= Config.MinGradeToRaid local onDuty = job.onduty - return jobName == "police" and onDuty and gradeAllowed + return jobName == PoliceJobs[jobName] and onDuty and gradeAllowed end, }, }, @@ -361,7 +361,7 @@ Framework.ox = { local gradeAllowed = tonumber(job.grade.level) >= Config.MinGradeToRaid local onDuty = job.onduty - return jobName == "police" and onDuty and gradeAllowed + return jobName == PoliceJobs[jobName] and onDuty and gradeAllowed end, }, }, From 3319973e32564e705c73129f57256ddb2078c11a Mon Sep 17 00:00:00 2001 From: Complex Date: Sat, 29 Jul 2023 16:48:43 +0200 Subject: [PATCH 2/3] Small Fix --- shared/framework.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/framework.lua b/shared/framework.lua index 37aa211..b170ee5 100644 --- a/shared/framework.lua +++ b/shared/framework.lua @@ -163,7 +163,7 @@ Framework.qb = { local gradeAllowed = tonumber(job.grade.level) >= Config.MinGradeToRaid local onDuty = job.onduty - return jobName == PoliceJobs[jobName] and gradeAllowed and onDuty + return PoliceJobs[jobName] and gradeAllowed and onDuty end, }, } @@ -320,7 +320,7 @@ Framework.ox = { local gradeAllowed = tonumber(job.grade.level) >= Config.MinGradeToRaid local onDuty = job.onduty - return jobName == PoliceJobs[jobName] and onDuty and gradeAllowed + return PoliceJobs[jobName] and onDuty and gradeAllowed end, }, }, @@ -361,7 +361,7 @@ Framework.ox = { local gradeAllowed = tonumber(job.grade.level) >= Config.MinGradeToRaid local onDuty = job.onduty - return jobName == PoliceJobs[jobName] and onDuty and gradeAllowed + return PoliceJobs[jobName] and onDuty and gradeAllowed end, }, }, From f484a0793dfd85229279ee61c2fa5083d78950aa Mon Sep 17 00:00:00 2001 From: Rian <74205343+complexza@users.noreply.github.com> Date: Sat, 29 Jul 2023 21:09:16 +0200 Subject: [PATCH 3/3] Update shared/config.lua Co-authored-by: BackSH00TER <18689469+BackSH00TER@users.noreply.github.com> --- shared/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/config.lua b/shared/config.lua index 9e1bca8..35ff963 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -35,7 +35,7 @@ Config.MinGradeToRaid = 3 -- Minimum grade to raid a property Config.RaidTimer = 5-- 5 minutes -Config.RealtorJobName = "realtor" -- Set your Real Estate here +Config.RealtorJobName = "realtor" -- Set your Real Estate job here -- Realtor Commisions based on job grade, the rest goes to the owner, if any. Config.Commissions = {