Jump to content
RAGE Multiplayer Community

CEF not working in chat


sianbg
 Share

Recommended Posts

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

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 by sianbg
Link to comment
Share on other sites

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 by MrCarter
Link to comment
Share on other sites

В 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...