Skip to content

Server Events

These events are provided for compatibility with other chat systems and can be triggered by other resources.

Legacy event for adding messages (compatibility mode).

TriggerServerEvent('chat:addMessage', msg)

Event Parameters:

  • msg (table) - Message data table

Message Data Structure:

{
args = table, -- Array of message parts
color = table -- RGB color array { r, g, b }
}

Example:

TriggerServerEvent('chat:addMessage', {
args = { "Hello", "world" },
color = { 255, 255, 255 }
})

Legacy event for adding command suggestions.

TriggerClientEvent('chat:addSuggestion', playerId, {
name = string,
help = string,
params = table
})

Event Parameters:

  • playerId (number) - Target player ID
  • data (table) - Suggestion data table

Suggestion Data Structure:

{
name = string, -- Command name (with or without '/')
help = string, -- Help text
params = table -- Array of parameter objects
}

Parameter Structure:

{
name = string, -- Parameter name
help = string -- Parameter help text
}

Example:

TriggerClientEvent('chat:addSuggestion', source, {
name = "/test",
help = "Test command",
params = {
{ name = "param1", help = "First parameter" }
}
})

Legacy event for adding multiple command suggestions.

TriggerClientEvent('chat:addSuggestions', playerId, suggestions)

Event Parameters:

  • playerId (number) - Target player ID
  • suggestions (table) - Array of suggestion objects

Example:

local suggestions = {
{ name = "/test1", help = "Test command 1" },
{ name = "/test2", help = "Test command 2" }
}
TriggerClientEvent('chat:addSuggestions', source, suggestions)

These events are used internally by the script and should not be triggered manually. They can be listened to for integration purposes.

The script handles various message-related events internally. These events are primarily for the script’s own use, but you can listen to them if needed for advanced integrations.

Channel-related events are managed internally and should not be triggered externally.