Player::notify: Difference between revisions

From RAGE Multiplayer Wiki
m (Cleaned up page, added example.)
mNo edit summary
Line 2: Line 2:
This function sends a notification to the player.
This function sends a notification to the player.


'''Codes:'''
You can use the colour codes found here: [[Fonts_and_Colors|Fonts and colors]]
 
*'''~n~''' New line
*'''~r~''' Red
*'''~g~''' Green
*'''~b~''' Blue
*'''~w~''' or ~s~ White
*'''~y~''' Yellow
*'''~p~''' Purple
*'''~l~''' Black (lower case L)


== Syntax ==
== Syntax ==

Revision as of 12:43, 29 September 2018

This function sends a notification to the player.

You can use the colour codes found here: Fonts and colors

Syntax

player.notify(message)

Parameters

  • message - String

Example

Creates a command to let the player enter a message which will then come up as a notification.

Server-Side
mp.events.addCommand('notify', (player, message) => {
	if(!message) return player.outputChatBox("You need to enter a message.");
	player.notify(message);
});

See Also