SendClientMessage
Description:
Function SendClientMessage sends a message to a specific player with a chosen color in the chat. The whole line in the chatbox will be in the set color unless color embedding is used (0.3c or later).
|
|
Parameters:
(playerid, color, message[])
int | playerid | The ID of the player to display the message to. |
int | color | The color of the message (0xRRGGBBAA Hex format). |
string | message | The text that will be displayed (max 144 characters). |
Return Values:
- 1: The function was executed successfully. Success is reported when the string is over 144 characters, but the message won't be sent.
- 0: The function failed to execute. The player is not connected.
Examples:
#define COLOR_RED 0xFF0000FF public OnPlayerConnect(playerid) { SendClientMessage(playerid, COLOR_RED, "This text is red"); SendClientMessage(playerid, 0x00FF00FF, "This text is green."); SendClientMessage(playerid, -1, "This text is white."); return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- SendClientMessageToAll: Send a message to all players.
- SendPlayerMessageToPlayer: Force a player to send text for one player.
- SendPlayerMessageToAll: Force a player to send text for all players.
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnPlayerText: Called when a player sends a message via the chat.