PlayerChat: Difference between revisions

From RAGE Multiplayer Wiki
(Fix the bad English. ;))
No edit summary
Line 27: Line 27:


==See also==
==See also==
[[Category:Player Events API]]
{{Player_events}}

Revision as of 20:09, 18 September 2017

This event is triggered when a player send a message in the chat.

Parameters

  • player - player, who send message
  • text - the text that was sent

Example

This example will kick a player if his nickname is "Modernß" and he types "хай гэрлз" in chat.

Server-Side
let checkChatMessage = (player, text) => {
	let playerNickname = player.name;
	if ((playerNickname == "Modernß") && (text == "хай гэрлз")) {
		player.kick();
	};
};

mp.events.add(
	{
		"playerChat": checkChatMessage
	}
);

See also

Checkpoint

Colshape

Entity

Player

Streaming

Vehicle

Waypoint