Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config Option Added for Real Estate | Police Job Checking Fixed #60

Merged
merged 3 commits into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/sv_property.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 = {}

Expand Down
2 changes: 2 additions & 0 deletions shared/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
complexza marked this conversation as resolved.
Show resolved Hide resolved

-- Realtor Commisions based on job grade, the rest goes to the owner, if any.
Config.Commissions = {
[0] = 0.05, -- 5% commision for each sale
Expand Down
14 changes: 7 additions & 7 deletions shared/framework.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
{
Expand All @@ -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,
},
{
Expand Down Expand Up @@ -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,
},
}
Expand Down Expand Up @@ -285,7 +285,7 @@ Framework.ox = {
local job = PlayerData.job
local jobName = job.name

return jobName == "realtor"
return jobName == Config.RealtorJobName
end,
},
{
Expand All @@ -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,
},
{
Expand All @@ -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 PoliceJobs[jobName] and onDuty and gradeAllowed
end,
},
},
Expand Down Expand Up @@ -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 PoliceJobs[jobName] and onDuty and gradeAllowed
end,
},
},
Expand Down