Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
Update sh_basic_commands.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
sophfee authored Dec 17, 2021
1 parent 5caa8a6 commit 448ceca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugins/sh_basic_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ end
if CLIENT then
landis.DefineSetting("oocEnabled",{type="tickbox",name="OOC Chat Enabled",default=true,category="Chatbox"})
net.Receive("landisOOCMessage",function()
local ply = net.ReadEntity()
local txt = net.ReadString()
if landis.GetSetting("oocEnabled") then
chat.AddText(Color(255,0,0),"[OOC] ",landis.chatbox.CommandColors[ply:GetPermissionLevel()], ply:Nick(), Color(245,245,245,255),": ", txt)
end
end)
end
Expand All @@ -268,9 +270,15 @@ local oocCommand = {
HelpDescription = "Send an out of character message",
onRun = function(self,ply,args)
local text = table.concat(args, " ")
for v,k in ipairs(player.get
if text then
net.Start("landisOOCMessage")
net.WriteEntity(ply)
net.WriteString(text)
net.Broadcast()
end
end
}

-- OOC
landis.RegisterChatCommand("/ooc",)
landis.RegisterChatCommand("/ooc",oocCommand)
landis.RegisterChatCommand("//",oocCommand)

0 comments on commit 448ceca

Please sign in to comment.