PlayerChat: Difference between revisions
(Made example look cooler) |
(Fix the bad English. ;)) |
||
| Line 2: | Line 2: | ||
==Parameters== | ==Parameters== | ||
* '''player''' - player, who send message | * '''player''' - player, who send message | ||
* '''text''' - sent | * '''text''' - the text that was sent | ||
==Example== | ==Example== | ||
Revision as of 19:59, 18 September 2017
This event is triggered when player send 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
}
);