SendChatMessageToAll: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Sends a message to the targeted player.
Sends a chat message to all clients.
 
'''2 overloads'''


==Syntax==
==Syntax==
<syntaxhighlight lang="C#" >void NAPI.Chat.SendChatMessageToPlayer(Client player, string message, bool oldColors = true);</syntaxhighlight>
<syntaxhighlight lang="C#" >void NAPI.Chat.SendChatMessageToAll(string sender, string message, bool oldColors = true);</syntaxhighlight>
<syntaxhighlight lang="C#" >void NAPI.Chat.SendChatMessageToPlayer(Client player, string sender, string message, bool oldColors = true);</syntaxhighlight>
<syntaxhighlight lang="C#" >void NAPI.Chat.SendChatMessageToAll(string message, bool oldColors = true);</syntaxhighlight>


'''Required Arguments'''
'''Required Arguments'''
*'''player:''' parameter input should be in '''Client''' type.
*'''message:''' parameter input should be in '''string''' type.
*'''message:''' parameter input should be in '''string''' type.


Line 16: Line 13:


==Usage examples==
==Usage examples==
<syntaxhighlight lang="C#" >NAPI.Chat.SendChatMessageToPlayer(player, "This is a message!");</syntaxhighlight>
<syntaxhighlight lang="C#" >NAPI.Chat.SendChatMessageToAll("Example!");</syntaxhighlight>
<syntaxhighlight lang="C#" >NAPI.Chat.SendChatMessageToPlayer(player, "Example says", "This is a message!");</syntaxhighlight>
<syntaxhighlight lang="C#" >NAPI.Chat.SendChatMessageToAll("Server", "Example!");</syntaxhighlight>


[[Category:Serverside API]]
[[Category:Serverside API]]

Latest revision as of 12:45, 27 November 2019

Sends a chat message to all clients.

Syntax

void NAPI.Chat.SendChatMessageToAll(string sender, string message, bool oldColors = true);
void NAPI.Chat.SendChatMessageToAll(string message, bool oldColors = true);

Required Arguments

  • message: parameter input should be in string type.

Optional Arguments

  • sender: parameter input should be in string type.
  • oldColors: parameter input should be in bool type.

Usage examples

NAPI.Chat.SendChatMessageToAll("Example!");
NAPI.Chat.SendChatMessageToAll("Server", "Example!");