Gmod scorpy's chatbox issueTTT

So I’ll start off here, in the original chatbox in TTT when you’re dead or in spectator room and you’d press “y” you would auto get this message “HINT: As spectator, use team chat to talk during an active round!” but, in scorpy’s chat box addon when you press “y” the chat bar appears and you can type, when you press enter that is when you get this message “HINT: As spectator, use team chat to talk during an active round!” How would I make it so as soon as you press “y” the message will show up? I’m tired of typing something long and getting that message and having to re type it.

Before the chatbox is drawn, check if the player is alive.

[editline]23rd August 2014[/editline]

For all-chat that is.

I’ll be honest here, I have no idea how to do that.

Well you’re going to want to find some sort of function that has a word in it that is a synonym to start. So anything like Initialize, etc. Figure out where the function is where it actually pulls up the chatbox, then put a check to see if the ply is alive so something like [lua]if !ply:Alive() then return end[/lua]

Pretty sure I found it, where would I have to put in the code you posted? This is the open code


hook.Add("PlayerBindPress", "Scorpy's Simple Chatbox - Open", function(ply, bind, pressed)
	if string.find(bind, "messagemode2") then
		Chatbox:Open(true)
		return true
	elseif string.find(bind, "messagemode") then
		Chatbox:Open(false)
		return true
	end
end)

Edit:

I also found this, there was one for all chat but this is the team chat one.


function SSC_Chatbox_Panel:Open(team_chat)
	if self.IsOpen then return end
	self.IsOpen = true
	gamemode.Call("StartChat")
	
	self.TeamChat = team_chat
	self.ChatTypeLabel:SetText(team_chat and "Say (Team):" or "Say:")
	self.ChatTypeLabel:SizeToContentsX()
	self:InvalidateLayout(true)
	
	self:SetMouseInputEnabled(true)
	self:SetKeyboardInputEnabled(true)
	self:MakePopup()
	self.TextEntry:RequestFocus()
	
	if self.FirstOpen then
		self:SetSkin("ScorpyChatbox")
		self.SSCDropdown:SetSkin("ScorpyChatbox")
		self.ScrollBar:SetSkin("ScorpyChatbox")
		
		self:AddSSCButtons()
		
		self.FirstOpen = false
	end
	
	for _,btn in pairs(self.ButtonsList) do
		btn:SetVisible(true)
	end
	self.SSCDropdown:InvalidateLayout(true)
	
	self:SetRecentMessages()
	
	self:MoveTo( 0, self.y, 0.25, 0, 1)
	timer.Simple(0.30, function()
		if self.IsOpen then
			if SSC.EnableDropDown then
				self.SSCDropdown:SetVisible(true)
				self.SSCDropdown:MoveTo( self.SSCDropdown.x, self.y + self:GetTall(), 0.25)
			end
			self.ScrollBar:AlphaTo(255, 0.25)
		end
	end)
end

The second one would be around what you were looking for. Now you might want to look for something like SSC_Chatbox:Open or Chatbox:Open

[editline]23rd August 2014[/editline]

Actually, you could always try to put something like [lua]if !ply:Alive() then ply:ChatPrint(“HINT: As spectator, use team chat to talk during an active round!”) end[/lua] in the first function you provided

That’s the code, It still does the same thing.


hook.Add("PlayerBindPress", "Scorpy's Simple Chatbox - Open", function(ply, bind, pressed)
	if string.find(bind, "messagemode2") then
		Chatbox:Open(true)
		return true
	elseif string.find(bind, "messagemode") then
		Chatbox:Open(false)
		return true
	end
	if !ply:Alive() then ply:ChatPrint("HINT: As spectator, use team chat to talk during an active round!") 
	end
end)

Because you are returning true before it can even reach that.

Asking here because you didn’t by the script on CoderHire right?

So I put it before that?

[editline]24th August 2014[/editline]

I’ll be honest, the old server I was on I was a super admin. The current server now, the owner gave me permission to do all the files and what not. So I asked the old owner for a couple addons. And here I am .-. Idm if you complain about me not buying it. I came here for help, whoever still wants to help may do so. I appreciate all that I can get.

[editline]24th August 2014[/editline]

Tried putting it before each return true. Still nothing :c


hook.Add("PlayerBindPress", "Scorpy's Simple Chatbox - Open", function(ply, bind, pressed)
 if string.find(bind, "messagemode2") then
  Chatbox:Open(true)
if !ply:Alive() then ply:ChatPrint("HINT: As spectator, use team chat to talk during an active round!") end
  return true
 elseif string.find(bind, "messagemode") then
  Chatbox:Open(false)
  return true
 end
end)

[editline]24th August 2014[/editline]

Screw it. Felt bad. Bought it. Thanks for the help.