Player::outputChatBox

From RAGE Multiplayer Wiki
Revision as of 10:07, 26 September 2017 by Xylum (talk | contribs) (Added use of variables)

This functions writes a chat message to player.

Syntax

player.outputChatBox(reason);

Arguments

  • reason - string

Example

This example welcomes player on connect.

mp.events.add('playerJoin', player => {
  player.outputChatBox('Welcome to the server, ' + player.name + '!');
  // Example of colours in chat:
  var red = "#ff0000"
  player.outputChatBox(`!{#dddddd}This is Grey! !{#ffffff}This is White! !{red} This is Red!`);
});

See Also