sianbg Posted November 14, 2017 Share Posted November 14, 2017 Hello. I'm trying to use <b> tag in chat messages. It not working. Display <b>Word</b> and its not bold. I'm using cracked client. My code "playerChat": (player, text) => { // we can use html-tags in the chat, since it is made on HTML (cef), // Using the Selection tag to highlight the number of murders each const str = player.name + "<b>(" + player.kills + ")</b>: " + text; // We send a message to all players mp.players.forEach(_player => { _player.outputChatBox(str); }); }, Link to comment Share on other sites More sharing options...
sianbg Posted November 14, 2017 Author Share Posted November 14, 2017 (edited) 47 minutes ago, kemperrr said: in the client-side script write this mp.gui.chat.safeMode = false; thanks its work. I want to ask: Is this dangerous for other clients ? Maybe some exploit and other clients run my js ? Sorry for my bad english. Edited November 14, 2017 by sianbg Link to comment Share on other sites More sharing options...
MrCarter Posted November 14, 2017 Share Posted November 14, 2017 (edited) To prevent any html output in your chat, which is no permitted from you, you can use this: https://hastebin.com/axilacuxox.php mp.players.broadcast(striptags(message, '<b><s><u><strong>')); <-- define your allowed tags, leave it empty '' when you don't want this Credits to Donboo from Rage:MP Example Gamemode. https://github.com/Donboo/RageMP-Example/tree/master/packages/keker Edited November 14, 2017 by MrCarter Link to comment Share on other sites More sharing options...
kostya_nad Posted November 16, 2017 Share Posted November 16, 2017 В 14.11.2017 в 22:02, sianbg сказал: thanks its work. I want to ask: Is this dangerous for other clients ? Maybe some exploit and other clients run my js ? Sorry for my bad english. Yes, it is danger only to current client. Any player can put in chat JS-code or HTML-code and it will work for client without safe mode. Link to comment Share on other sites More sharing options...
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