Exports

With these exports, you will be able to manipulate the system from scripts external to it.

Client Exports

AddMessage
exports.origen_chat:addMessage(message)
  • message: table

    • args: table or string

    • title?: string

    • barColor?: string or [number, number, number]

    • type?: string (error, warning, info, success, debug)

    • timestap?: string

    • icon?: string

Example:

exports.origen_chat:addMessage({
    args = {'Test message'},
    barColor = '#00FF00',
    type = 'info',
    title = 'INFO',
    timestamp = "13:00",
    icon = 'lucide:info'
})
AddSuggestion
exports.origen_chat:addSuggestion(name, help, params)
  • name: string

  • help: string

  • params: table

    • name: string

    • help: string

    • disasbled: boolean

Example:

exports.origen_chat:addSuggestion('test_command', 'Test description', {
    {
        name = 'player',
        help = 'The player to greet',
        disabled = false
    },
    {
        name = 'message',
        help = 'The message to send',
        disabled = false
    }
}, false)
RemoveSuggestion
exports.origen_chat:removeSuggestion(name)
  • name: string

Example:

exports.origen_chat:removeSuggestion('test_command')
ClearChat
exports.origen_chat:clearChat()

Server Exports

AddMessage
exports.origen_chat:addMessage(target, message)
  • target: number

  • message: table

    • args: table or string

    • title?: string

    • barColor?: string or [number, number, number]

    • type?: string (error, warning, info, success, debug)

    • timestap?: string

    • icon?: string

Example:

exports.origen_chat:addMessage(1, {
    args = {'Test message'},
    barColor = '#00FF00',
    type = 'info',
    title = 'INFO',
    timestamp = "13:00",
    icon = 'lucide:info'
})
RegisterCommand
exports.origen_chat:registerCommand(config, callback)
  • config: table

    • command: string

    • help: string

    • params?: table

      • name: string

      • type?: string (number, text, player, longText)

      • help: string

      • optional?: boolean

    • permissions?: table or string

  • callback: function

    • source: number

    • args: table

    • raw: string

Example:

exports.origen_chat:registerCommand({
    command = 'command_name',
    help = 'Command description',
    params = {
        {
            name = 'arg1',
            type = 'number',
            help = 'Number argument',
        },
        {
            name = 'arg2',
            type = 'text',
            help = 'Text argument',
            optional = true,
        },
        {
            name = 'arg3',
            type = 'player',
            help = 'Player argument',
        },
        {
            name = 'arg4',
            type = 'longText',
            help = 'Long text argument',
        },
    },
    permissions = {
        'admin',
        'mod',
    },
}, function(source, args, raw)
    local arg1 = args.arg1
    local arg2 = args.arg2
    local arg3 = args.arg3
    local arg4 = args.arg4

    print(arg1, arg2, arg3, arg4)
end)
ResetChat
exports.origen_chat:resetChat(playerId)
  • playerId?: number

Example:

-- Delete the chat of a specific user
exports.origen_chat:resetChat(1)

-- Delete chat for all
exports.origen_chat:resetChat()

Last updated