Skip to content
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
10 changes: 5 additions & 5 deletions gamemode/core/hooks/sv_hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,11 @@ function GM:CreateSalaryTimer(client)
if (not character) then return end

local faction = nut.faction.indices[character:getFaction()]
if (not faction or not isnumber(faction.pay) or faction.pay <= 0) then
return
end
local class = nut.class.indices[character:getClass()]

local pay = hook.Run("GetSalaryAmount", client, faction, class) or (class and class.pay) or (faction and faction.pay) or nil

if (!pay) then return end

local timerID = "nutSalary"..client:SteamID()
local timerFunc = timer.Exists(timerID) and timer.Adjust or timer.Create
Expand All @@ -736,8 +738,6 @@ function GM:CreateSalaryTimer(client)
return
end


local pay = hook.Run("GetSalaryAmount", client, faction) or faction.pay
character:giveMoney(pay)
client:notifyLocalized("salary", nut.currency.get(pay))
end)
Expand Down
6 changes: 6 additions & 0 deletions plugins/scoreboard/derma/cl_scoreboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ local PANEL = {}
elseif (!visible and amount > 0) then
v:SetVisible(true)
end

local faction = nut.faction.indices[k]

if (amount != 0) then
v:SetVisible(hook.Run("ShowFactionInScoreboard", faction) ~= false or LocalPlayer():IsAdmin())
end
end

for k, v in pairs(self.slots) do
Expand Down