Hi guys,
I've been trying to create a custom chat for my server. I've already redone the skin and most of the other essential stuff. For some reason though, when I try to use 'RunConsoleCommand("say", text)' the chat box doesn't pick it up and display it. I've tried to use GM:OnPlayerChat() and GM:ChatText() to pick up when a user talks but neither of these work. I know the console command is being ran as I've debugged that by outputting text to the console. I also know that the chat box does pick up commands from sourcemod. I.E. if I type in '/say TextHere' the chatbox will display [Username]: TextHere. The scripts do not error so I cannot provide any error logs. If anything else is needed, I'd be grateful to give any other files in return for a fix. Thanks.
Edit:
Also, I believe it is a problem with RunConsoleCommand() as if I use ULX to run a console command off of my player nothing (I.E. My chat message) is shown in the server console nor is an error displayed.
Show the code?
[QUOTE=Chessnut;33801388]Show the code?[/QUOTE]
Here's the code that should be picking up the messages:
[lua]
function GM:PlayerSay(player, text, team)
if (self.Plugin:Call("PlayerChatPreCommand", player, text, team) == false) then
return "";
end
if (GM.Command) then
if (GM.Command:ParseSayText(player, text)) then
return "";
end;
end
if (self.Plugin:Call("PlayerChat", player, text, team) == false) then
return ""
end
if (GM.chat) then
GM.chat:ParseSayText(player, text, team);
end
return "";
end
[/lua]
Use [lua] tags on that
[QUOTE=MattJeanes;33818589]Use [lua] tags on that[/QUOTE]
Done.
Got it working; just needed to re-install the server.
Sorry, you need to Log In to post a reply to this thread.