• Does chat.AddText trigger chat hooks?
    5 replies, posted
Does chat.AddText trigger chat hooks, like PlayerSay, PlayerCanSeePlayersChat, OnPlayerChat, et al? I'm trying to make some nice chat fuctions using chat.AddText, and I want to make it local( So that player X units away from you can't see your chat, like in DarkRP), and am trying to figure out the best way to do it. If it does trigger the chat hooks, would it still be better to localize it by filtering out players who can't hear you with the usermessage? (chat.AddText is clientside if you didn't know)
Theres a hook that is like CanPlayerSeePlayersChat or something odd like that, make it check the entitys radius(players radius) and if it's within a zone return true.
[QUOTE=Deutsch;21495082]Theres a hook that is like CanPlayerSeePlayersChat or something odd like that, make it check the entitys radius(players radius) and if it's within a zone return true.[/QUOTE] It's PlayerCanSeePlayersChat. I know how to make a local chat system. My question is if those hooks will be triggered by chat.Addtext(), and if it's a good idea to localize it by filtering players outside of the audible radius in the usermessage.
No, chat.AddText does not trigger those hooks.
[QUOTE=KingofBeast;21495356]No, chat.AddText does not trigger those hooks.[/QUOTE] Damn. Thank you. So should I filter out players who can hear me with the usermessage recipient filter?
That should work.
Sorry, you need to Log In to post a reply to this thread.