• Client-side chat detection
    22 replies, posted
Is it possible to detect whether other players are chatting using only a client-side script? P.S. I'm fairly new to lua. [highlight](User was banned for this post ("Wrong section" - mahalis))[/highlight]
No. To do this you'd have to send a msg to the server that a player is typing, and then the server tells each person's client that they are typing.
Yea that's what I though I'd have to do. Thanks for the help anyways.
[LUA] if SERVER then hook.Add( "PlayerSay" , "SendToClient" , function( entity_Player , string_Text , bool_Team ) umsg.Start( "PlayerSay" ) umsg.Entity( entity_Player ) umsg.String( string_Text ) umsg.Bool( bool_Team ) umsg.End() end) else usermessage.Hook( "PlayerSay" , function( um ) local entity_Player = um:ReadEntity() local string_Text = um:ReadString() local bool_Team = um:ReadBool() hook.Call( "PlayerSay", GAMEMODE , entity_Player , string_Text , bool_Team ) end) end [/LUA] is this what you are looking for?
[QUOTE=Ningaglio;26482400][LUA] if SERVER then hook.Add( "PlayerSay" , "SendToClient" , function( entity_Player , string_Text , bool_Team ) umsg.Start( "PlayerSay" ) umsg.Entity( entity_Player ) umsg.String( string_Text ) umsg.Bool( bool_Team ) umsg.End() end) else usermessage.Hook( "PlayerSay" , function( um ) local entity_Player = um:ReadEntity() local string_Text = um:ReadString() local bool_Team = um:ReadBool() hook.Call( "PlayerSay", GAMEMODE , entity_Player , string_Text , bool_Team ) end) end [/LUA] is this what you are looking for?[/QUOTE] [QUOTE=sabreman;26479233]Is it possible to detect whether other players are chatting [b]using only a client-side script[/b]?[/QUOTE]
Oh :3 rate me dumb
I'm a bit unsure about the description, do you want to know whether people are currently chatting or what they have typed and sent?
[QUOTE=decyg;26483590]I'm a bit unsure about the description, do you want to know whether people are currently chatting or what they have typed and sent?[/QUOTE] My guess is he wants to know when another player has the chatbox open, before the player sends any text.
Ah, no idea then.
ChatTextChanged + concommand + usermessage
[QUOTE=sabreman;26479233]Is it possible to detect whether other players are chatting using only a client-side script? P.S. I'm fairly new to lua.[/QUOTE] He did say client-side for a reason.
[QUOTE=decyg;26483928]He did say client-side for a reason.[/QUOTE] And it's impossible, so don't try to contradict me and/or make me look like an idiot when you seem to know nothing of networking in general.
Why bother answering to a question that was never asked then? (Y) On topic - It's not possible unless you have a serversided script.
So not telling him anything would be better than telling him it will never work as he wants it to?
Not really. Ningaglio already posted what you posted but he gave working code.
[QUOTE=decyg;26484236]Not really. Ningaglio already posted what you posted but he gave working code.[/QUOTE] If you read the code you would realise it doesn't do what the OP wants.
Did you actually read what i said. I said [b]"Ningaglio already posted what you posted but he gave working code."[/b] Just drop it, it's going nowhere.
[QUOTE=decyg;26484541]Did you actually read what i said. I said [b]"Ningaglio already posted what you posted but he gave working code."[/b][/QUOTE] But it wasn't what the OP wanted.
[QUOTE=decyg;26484541]Did you actually read what i said. I said [b]"Ningaglio already posted what you posted but he gave working code."[/b][/QUOTE] [lua]hook.Add("OnPlayerChat" , 0 , function(pl , text , team) hook.Call("PlayerSay" , nil , pl , text , team) end )[/lua] That does exactly the same as his does, entirely clientside. Are you sure his works now?
Why does it matter. What are you trying to prove, that you're better at me than lua? Okay then, great, i don't give a fuck, also, nice going rating all of my posts dumb.
[QUOTE=decyg;26484673]also, nice going rating all of my posts dumb.[/QUOTE] I rated them dumb because they all were dumb.
Alright then, valid enough reason.
Yes it is possible, With the following hook: OnPlayerChat. Syntax: GM:OnPlayerChat( Player player, String text, Boolean TeamChat, Boolean PlayerIsDead )
Sorry, you need to Log In to post a reply to this thread.