Player::outputChatBox: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
m (Added colour example to chat)
Line 14: Line 14:
mp.events.add('playerJoin', player => {
mp.events.add('playerJoin', player => {
   player.outputChatBox('Welcome to the server, ' + player.name + '!');
   player.outputChatBox('Welcome to the server, ' + player.name + '!');
  // Example of colours in chat:
  player.outputChatBox(`!{#dddddd}This is Grey! !{#ffffff}This is White!`);
});
});
</syntaxhighlight>
</syntaxhighlight>

Revision as of 10:04, 26 September 2017

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:
  player.outputChatBox(`!{#dddddd}This is Grey! !{#ffffff}This is White!`);
});

See Also