Vifleem Posted July 19, 2017 Share Posted July 19, 2017 Здравствуйте,форумчани.Мне нужна ваша помощь.Я никак немогу разобраться как сделать команду /me. Прошу вас помочь.Буду очень признателен.Заранее огромное спасибо. Link to comment Share on other sites More sharing options...
Arelov Posted July 20, 2017 Share Posted July 20, 2017 "me": (player, args) => { if (args.length > 1) { const message = args.slice(1).join(' '); mp.players.forEach(_player => { _player.outputChatBox(player.name + "<b>(" + player.id + ")</b>: " + "<font color=#ff33cc>" + message + "</font>"); }); } else { player.outputChatBox("<font color=#3399ff>Введите '/me [сообщение]' </font>"); } }, Link to comment Share on other sites More sharing options...
cacao Posted August 17, 2017 Share Posted August 17, 2017 (edited) @Arelov а если я напишу: /me <div style="font-size:99px; color: red;">сообщение</div> или куда хуже :) /me <script>(function() { window.location="https://rage.mp/" }(window))</script> message = message.replace(/<[^>]+>/g, '') Edited August 17, 2017 by cacao Link to comment Share on other sites More sharing options...
Leone Posted August 17, 2017 Share Posted August 17, 2017 2 часа назад, cacao сказал: @Arelov а если я напишу: /me <div style="font-size:99px; color: red;">сообщение</div> или куда хуже :) /me <script>(function() { window.location="https://rage.mp/" }(window))</script> message = message.replace(/<[^>]+>/g, '') разве есть в гта или в ноде объект window ? Link to comment Share on other sites More sharing options...
shuker Posted August 17, 2017 Share Posted August 17, 2017 4 часа назад, Leone сказал: разве есть в гта или в ноде объект window ? Сообщение выводится в чат, чат сделан на CEF. CEF - обычный браузер поверх игры грубо говоря, в нем обьект window есть, т.к. это обычная html страница 1 Link to comment Share on other sites More sharing options...
Leone Posted August 18, 2017 Share Posted August 18, 2017 8 часов назад, shuker сказал: Сообщение выводится в чат, чат сделан на CEF. CEF - обычный браузер поверх игры грубо говоря, в нем обьект window есть, т.к. это обычная html страница буду знать спасибо! 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