Triggering this event allows you to send a chat message to this client. Message object structure:
message = {
template = template,
color = color,
multiline = true,
args = {author, otherArgs...}
}
chat:addMessage
object message
This example sends a chat message to a player locally from a client script (only the executing client will see it).
TriggerEvent('chat:addMessage', {
color = { 255, 0, 0},
multiline = true,
args = {"Me", "Please be careful to not step on too many snails!"}
})
TriggerEvent("chat:addMessage", new
{
color = new[] {255, 0, 0},
multiline = true,
args = new[] {"Me", "Please be careful to not step on too many snails!"}
});
emit('chat:addMessage', {
color: [255, 0, 0],
multiline: true,
args: ['Me', 'Please be careful to not step on too many snails!']
});