Перейти к содержанию

OnChatMessage

Материал из RAGE MP Wiki Archive
Версия от 19:20, 13 мая 2021; imported>Phill (Changed Client to Player)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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


<syntaxhighlight lang="csharp"> [ServerEvent(Event.ChatMessage)] </syntaxhighlight>

Parameters

  • player: parameter input should be in Player type
  • message: parameter input should be in string type

Example

<syntaxhighlight lang="csharp"> [ServerEvent(Event.ChatMessage)] public void OnChatMessage(Player player, string message) {

   NAPI.Chat.SendChatMessageToAll($"{player.Name} ({player.Handle}): {message}");

} </syntaxhighlight>