Tutorials

How to fix blue chat background?

How to create a custom message with an export?

How to use chat notifications in other scripts?

1.

How to fix blue chat background?

  1. Download chat file from the Installation Guide.

  2. Add the following into server.cfg, make sure chat resource starts before fivecode_rpchat

    ensure chat
    ensure fivecode_rpchat
  1. Go into server.cfg server file and change the following

    original:
    set resources_useSystemChat true
    
    changed:
    set resources_useSystemChat false

2.

How to create a custom message with an export?

-- 1: Message: The text to display in the chat notification.
-- 3: Everyone: If true, the message will be send to all players in the server.
-- 2: Args: A table containing display settings such as label, icon, and colors.

exports['fivecode_rpchat']:Message(message, everyone, args)



-- Example:
exports['fivecode_rpchat']:Message('Hello World.', false, {
    Label = 'Test Label:',
    Icon = 'fas fa-check',
    Color = {
        Label = '255, 255, 255',
        Text = '255, 255, 255',
        TextStyleNormal = '75, 206, 18',
        Background = '75, 2, 18, 0.9',
    },
})

3.

Use chat notifications in other scripts:

-- 1: Notification Type - (success, info, error)
-- 2: Notification message
-- 3: If true everyone in the server will see this message.

exports.fivecode_rpchat:Notify(type, message, everyone)

Notification types:

Config.ChatStyle = 'styleModern2'
Config.ChatStyle = 'styleModern'
Config.ChatStyle = 'styleNormal'

Last updated

Was this helpful?