Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tagcol=Color(100,100,100)
- local teamcol=Color(80,151,199)
- local white=Color(255,255,255)
- local green=Color(0,255,0)
- local red=Color(255,0,0)
- local joinmsgs={
- "is attending",
- "is attending the sessions",
- "wants to game",
- "is joining",
- "is coming to the server",
- "is sending tcp packets",
- "is coming!!!!",
- "is in connect state",
- "joining the server",
- "is joining the server",
- "is joining the game",
- "joining the server",
- "is knocking the gates",
- "is signing in",
- "will be here shortly",
- "should arrive shortly",
- "joining the game",
- }
- local discmsg={
- "left",
- "no longer interest",
- "fuck this shit",
- "left the server",
- "had enough",
- "hit the wrong button",
- "just disconnected",
- "I wonder what this button does",
- "bye",
- "baibai",
- "found better things to do",
- "disconnected",
- "leaving",
- "unattending the session",
- "abandoned the server",
- "brb, gentoo",
- }
- hook.Add('ChatText','JoinDisconnectReplace', function ( UserID, Name, msg, msgtype )
- if (msgtype!='joinleave') then return end
- local join=string.gmatch(tostring(msg) or "", "Player (.+) has joined the game")()
- if join then
- chat.AddText(green," ● ",team.GetColor(100) or teamcol,join,white," ",table.Random(joinmsgs))
- return true
- end
- local leave
- local leavemsg
- for _Name,_leavemsg in string.gmatch(tostring(msg) or "", "Player (.+) left the game %((.+)%)") do
- leave=_Name
- leavemsg=_leavemsg
- end
- if leave then
- leavemsg=leavemsg or ""
- leavemsg=string.gsub(leavemsg,"Kicked by Console : ","")
- leavemsg=string.gsub(leavemsg,"Disconnect by user%.",table.Random(discmsg))
- if string.find(leavemsg,"time",1,true) then
- leavemsg="Crashed!"
- end
- if string.find(leavemsg,"steam logon",1,true) then
- leavemsg="Blame steam!"
- end
- chat.AddText(red," ● ",team.GetColor(100) or teamcol,leave,white," left: ",Color(200,200,255),tostring(leavemsg))
- return true
- end
- error("Unhandled join/disconnect message, dying: "..tostring(msg))
- end)
Advertisement
Add Comment
Please, Sign In to add comment