messageClient: Difference between revisions
Jump to navigation
Jump to search
m (Mex moved page MessageClient to messageClient) |
No edit summary |
||
| Line 12: | Line 12: | ||
|notes = [[Server/Defines#Colour_Defines|Server colour defines]]<br> | |notes = [[Server/Defines#Colour_Defines|Server colour defines]]<br> | ||
[[Client/Defines#Colour_Defines|Client colour defines]] | [[Client/Defines#Colour_Defines|Client colour defines]] | ||
|exampleJSSS = addCommandHandler("message1", (command, text, client) => | |||
{ | |||
if (client.player) | |||
{ | |||
messageClient('You are spawned!', client); | |||
} | |||
else | |||
{ | |||
messageClient('You are not spawned!', client); | |||
} | |||
}); | |||
}} | }} | ||
Latest revision as of 19:11, 15 June 2026
Function Server Only
![]()
Online and Offline
Available since Server 1.0.0
void messageClient(string message, Client client, [ int colour = COLOUR_LIME ])
The messageClient function is used to add a message to the chat box for only one client.
Parameters
| 1) | string | message | The message to display in the chat box. |
| 2) | Client | client | The client to send the chat message to. |
| 3) | int | colour | Optional, defaults to COLOUR_LIME. The text colour for the message. |
Return
| void | This function doesn't return a value. |
Notes
Examples
Example 1 - JavaScript - Server-Side:
addCommandHandler("message1", (command, text, client) =>
{
if (client.player)
{
messageClient('You are spawned!', client);
}
else
{
messageClient('You are not spawned!', client);
}
});
Compatibility
There isn't any compatibility information for this function.
Related
Server Related
message
messageAllExcept
messageClient