AliGR Posted May 3, 2021 Share Posted May 3, 2021 Hello Guys I wanted to know if it is possible to silence someone privately for ourselves ?? setPlayerMute ( Local ) Thank you for helping me <3 Link to comment
Administrators Tut Posted May 3, 2021 Administrators Share Posted May 3, 2021 Welcome to the forums. Your thread has been moved into the Scripting section for best results Link to comment
SpecT Posted May 3, 2021 Share Posted May 3, 2021 (edited) Hey, Yeah, it's possible. Unfortunately, not with one line of code. A client-sided way to do it is to save the serials of the players you don't want messages from in a table and then save them in an xml file (you will need load and save operations of course - XML functions). And when the event onClientChatMessage is triggered check whether the source's serial is one of the ones in the xml file/table. If it is => cancelEvent() *Note that you will have the get player's serial from server! The server-sided way is to put the serials in a table and then convert it toJSON and save it as account data (setAccountData). To load them you will need to get them (getAccountData) and convert to a table (fromJSON). The thing is that you will need to cancel the onChatMessage event and re-write the operations of sending the messages to all the players (with a for loop). And then to do the filtering who should and who shouldn't receive the message by checking the serials in the table. In my opinion the client-sided one is better and easier. Especially if you are new to scripting. I hope I gave you enough information on how it can be done. Edited May 3, 2021 by SpecT Link to comment
AliGR Posted May 4, 2021 Author Share Posted May 4, 2021 18 hours ago, SpecT said: Hey, Yeah, it's possible. Unfortunately, not with one line of code. A client-sided way to do it is to save the serials of the players you don't want messages from in a table and then save them in an xml file (you will need load and save operations of course - XML functions). And when the event onClientChatMessage is triggered check whether the source's serial is one of the ones in the xml file/table. If it is => cancelEvent() *Note that you will have the get player's serial from server! The server-sided way is to put the serials in a table and then convert it toJSON and save it as account data (setAccountData). To load them you will need to get them (getAccountData) and convert to a table (fromJSON). The thing is that you will need to cancel the onChatMessage event and re-write the operations of sending the messages to all the players (with a for loop). And then to do the filtering who should and who shouldn't receive the message by checking the serials in the table. In my opinion the client-sided one is better and easier. Especially if you are new to scripting. I hope I gave you enough information on how it can be done. Hello I want to create a blocking system so that one player can block another player for herself !! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now