fix console messages not being relayed ('say word')

This commit is contained in:
edshot99 2024-11-27 21:56:00 -06:00
parent d7ea74c929
commit 143c4e493d

View File

@ -2,12 +2,20 @@ import guard from ChatTransit
ChatTransit.ReceiveMessage = (data) => ChatTransit.ReceiveMessage = (data) =>
:userid, :text, :teamonly = data :userid, :text, :teamonly = data
nick, steamid64 = nil
ply = Player userid ply = Player userid
return if teamonly == 1 return if teamonly == 1
return unless text return unless text
return if text == "" return if text == ""
if IsValid ply
nick = ply\Nick!
steamid64 = ply\SteamID64!
else
nick = "Console"
steamid64 = "0"
shouldRelay = hook.Run "CFC_ChatTransit_ShouldRelayChatMessage", ply, text, teamonly shouldRelay = hook.Run "CFC_ChatTransit_ShouldRelayChatMessage", ply, text, teamonly
return if shouldRelay == false return if shouldRelay == false
@ -16,8 +24,8 @@ ChatTransit.ReceiveMessage = (data) =>
Data: Data:
Type: "message" Type: "message"
Content: text Content: text
SteamName: ply\Nick! SteamName: nick
SteamId: ply\SteamID64! SteamId: steamid64
IrisId: "none" IrisId: "none"
gameevent.Listen "player_say" gameevent.Listen "player_say"