Chat
The chat window of the game. Use the events of the built-in chat resource (chatMessage, chat:addMessage) in your scripts; these functions are what the chat resource itself uses.
Gampeon.ChatAddMessage
Section titled “Gampeon.ChatAddMessage”Gampeon.ChatAddMessage(author, text, color?)Show a line in the chat window of the game. Client only.
Most scripts use the chat:addMessage event instead, which the chat resource turns into this call. Line breaks become spaces, other control characters are removed, the author is cut at 64 bytes and the text at 1024 bytes.
| Parameter | Type | Description |
|---|---|---|
author |
string |
Shown before the text. Empty for a line without author. |
text |
string |
The message. |
color (optional) |
{integer, integer, integer} |
Color as {r, g, b} from 0 to 255. Default white. |
Gampeon.ChatAddMessage('System', 'Welcome to the server', {0, 200, 255})Compared to FiveM: GAMPEON function. FiveM scripts use the chat:addMessage event, which works the same with the built-in chat resource.
Gampeon.ChatClear
Section titled “Gampeon.ChatClear”Gampeon.ChatClear()Remove all lines from the chat window. Client only.
Compared to FiveM: GAMPEON function. The chat:clear event of the chat resource calls it.
Gampeon.ChatAddSuggestion
Section titled “Gampeon.ChatAddSuggestion”Gampeon.ChatAddSuggestion(name, help?)Suggest a command while the player types in the chat window. Client only.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The command with slash, for example “/tp”. |
help (optional) |
string |
Short help text. |
Compared to FiveM: GAMPEON function. The chat:addSuggestion event of the chat resource calls it. Parameter hints are not shown yet.
Gampeon.ChatRemoveSuggestion
Section titled “Gampeon.ChatRemoveSuggestion”Gampeon.ChatRemoveSuggestion(name)Remove a command suggestion. Client only.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The command with slash. |
Compared to FiveM: GAMPEON function. The chat:removeSuggestion event of the chat resource calls it.