Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Out of character.
- nut.chat.register("ooc", {
- onCanSay = function(speaker, text)
- local delay = nut.config.get("oocDelay", 10)
- --if (speaker:getChar():hasFlags("u")) then --ooc banning
- -- return false
- --end
- -- 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
- speaker:notifyLocalized("oocDelay", delay - math.ceil(lastOOC))
- return false
- end
- end
- -- Save the last time they spoke in OOC.
- speaker.nutLastOOC = CurTime()
- end,
- onChatAdd = function(speaker, text)
- local icon = "icon16/user.png"
- local rank = " "
- if (speaker:SteamID() == "STEAM_0:0:50197118") then
- icon = "icon16/key.png"
- rank = " "
- elseif (speaker:IsSuperAdmin()) then
- icon = "icon16/shield.png"
- --rank = "S"
- elseif (speaker:IsAdmin()) then
- icon = "icon16/star.png"
- --rank = "A"
- elseif (speaker:IsUserGroup("moderator") or speaker:IsUserGroup("enforcer")) then
- icon = "icon16/wrench.png"
- --rank = "M"
- elseif (speaker:IsUserGroup("premium") or speaker:IsUserGroup("donator") or speaker:IsUserGroup("donor")) then
- icon = "icon16/heart.png"
- --rank = "D"
- end
- icon = Material(hook.Run("GetPlayerIcon", speaker) or icon)
- chat.AddText(icon, Color(255, 50, 50), " [OOC] ", speaker, color_white, ": "..text)
- end,
- prefix = {"//", "/ooc"},
- noSpaceAfter = true,
- filter = "ooc"
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement