Skip to content
Merged
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
26 changes: 14 additions & 12 deletions gamemode/core/libs/sh_chatbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,14 @@ do
else
local delay = nut.config.get("oocDelay", 10)

-- Admin delay bypass
if (speaker:IsAdmin() and nut.config.get("oocDelayAdmin", false)) then
-- Only need to check the time if they have spoken in OOC chat before.
if (delay > 0 and speaker.nutLastOOC) then
local lastOOC = CurTime() - speaker.nutLastOOC

-- Use this method of checking time in case the oocDelay config changes.
if (lastOOC <= delay) then
-- Only need to check the time if they have spoken in OOC chat before.
if (delay > 0 and speaker.nutLastOOC) then
local lastOOC = CurTime() - speaker.nutLastOOC

-- Use this method of checking time in case the oocDelay config changes.
if (lastOOC <= delay) then
-- Admin delay bypass
if (!speaker:IsAdmin() or speaker:IsAdmin() and nut.config.get("oocDelayAdmin", false)) then
speaker:notifyLocalized("oocDelay", delay - math.ceil(lastOOC))

return false
Expand Down Expand Up @@ -321,17 +321,19 @@ do
onCanSay = function(speaker, text)
local delay = nut.config.get("loocDelay", 0)

-- Admin delay bypass
-- Only need to check the time if they have spoken in LOOC chat before.
if (speaker:IsAdmin() and nut.config.get("loocDelayAdmin", false)) then
-- Only need to check the time if they have spoken in OOC chat before.
if (delay > 0 and speaker.nutLastLOOC) then
local lastLOOC = CurTime() - speaker.nutLastLOOC

-- Use this method of checking time in case the oocDelay config changes.
if (lastLOOC <= delay) then
speaker:notifyLocalized("loocDelay", delay - math.ceil(lastLOOC))
-- Admin delay bypass
if (!speaker:IsAdmin() or speaker:IsAdmin() and nut.config.get("oocDelayAdmin", false)) then
speaker:notifyLocalized("oocDelay", delay - math.ceil(lastOOC))

return false
return false
end
end
end
end
Expand Down