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

Add option to disable business in config #469

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion gamemode/config/sh_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ ix.config.Add("weaponRaiseTime", 1, "The time it takes for a weapon to raise.",
data = {min = 0.1, max = 60, decimals = 1},
category = "server"
})
ix.config.Add("allowBusiness", true, "Whether or not business is enabled.", nil, {
category = "server"
})
ix.config.Add("maxHoldWeight", 100, "The maximum weight that a player can carry in their hands.", nil, {
data = {min = 1, max = 500},
category = "interaction"
Expand Down Expand Up @@ -217,4 +220,4 @@ ix.config.Add("secondsPerMinute", 60, "How many seconds it takes for a minute to
end, {
data = {min = 0.01, max = 120},
category = "date"
})
})
6 changes: 6 additions & 0 deletions gamemode/core/hooks/cl_hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,12 @@ function GM:HUDDrawTargetID()
return false
end

function GM:BuildBusinessMenu()
if (!ix.config.Get("allowBusiness", true)) then
return false
end
end

gameevent.Listen("player_spawn")
hook.Add("player_spawn", "ixPlayerSpawn", function(data)
local client = Player(data.userid)
Expand Down
4 changes: 4 additions & 0 deletions gamemode/core/hooks/sh_hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ function GM:TranslateActivity(client, act)
end

function GM:CanPlayerUseBusiness(client, uniqueID)
if (!ix.config.Get("allowBusiness", true)) then
return false
end

local itemTable = ix.item.list[uniqueID]

if (!client:GetCharacter()) then
Expand Down
Loading