Solstice-CyberChat

A cyberpunk-themed advanced chat system for FiveM

1. Installation

Requirements

  • FiveM Server

  • OneSync Enabled (recommended)

Quick Install

  1. Copy the Solstice-CyberChat folder to your server's resources directory

  2. Add ensure Solstice-CyberChat to your server.cfg

  3. Restart your server

Disable Default Chat (Important)

Add these lines to your server.cfg to disable the default FiveM chat:

setr game_enableFallbackChat 0
sv_useDirectListing true

2. Features

Core Features

  • 🎨 Cyberpunk-themed UI with customizable colors

  • 💬 Command auto-completion

  • 🔔 Advanced notification system

  • 📜 Message history

  • 🎯 Command suggestions

  • 🔄 Message fade effects

  • 🎨 Message type styling (error, success, warning, info)

Key Controls

  • T - Open/Close chat

  • L - Cycle notification modes (Always, Active, Hidden)

  • ESC - Close chat

  • ↑/↓ - Navigate message history

  • TAB - Auto-complete commands

  • ENTER - Send message

Notification Modes

  1. Always: Notifications always visible

  2. Active: Only show when chat is open

  3. Hidden: No notifications shown

3. Configuration

Edit shared/config.lua to customize the chat system:

Chat Colors

Config.Colors = {
    primary = {
        main = 'rgb(0, 255, 255)',      -- Main accent color
        dark = 'rgb(0, 200, 200)',      -- Darker variant
        dim = 'rgba(0, 255, 255, 0.1)', -- Background effects
        glow = 'rgba(0, 255, 255, 0.2)' -- Glow effects
    },
    background = {
        main = 'rgba(0, 20, 40, 0.85)', -- Main background
        dark = 'rgba(0, 10, 20, 0.95)'  -- Darker background
    },
    types = {
        error = 'rgb(255, 50, 50)',     -- Error messages
        success = 'rgb(50, 255, 50)',   -- Success messages
        warning = 'rgb(255, 200, 50)',  -- Warning messages
        info = 'rgb(50, 150, 255)'      -- Info messages
    }
}

Message Settings

Config.MessageSettings = {
    cooldown = 3000,        -- Message cooldown in ms
    maxLength = 256,        -- Maximum message length
    rateLimitCount = 5,     -- Messages per minute
    rateLimitTime = 60000   -- Rate limit window (ms)
}

Default Settings

Config.DefaultSettings = {
    notificationMode = 'active', -- Default mode (always/active/hidden)
    fadeTime = 5000,            -- Message fade duration
    maxMessages = 100,          -- Maximum messages shown
    maxMessageLength = 256      -- Maximum message length
}

4. Export Functions

Client Exports

Show Notification

exports['Solstice-CyberChat']:showNotification(message, type, duration, persistent)
  • message: Message text

  • type: 'success', 'error', 'warning', 'info'

  • duration: Duration in ms (default: 3000)

  • persistent: Boolean, stays visible in any mode

Example:

exports['Solstice-CyberChat']:showNotification('Item purchased!', 'success', 3000)

Add Message

exports['Solstice-CyberChat']:addMessage({
    type = 'info',
    text = 'Message text',
    author = 'System'
})

Add Command Suggestion

exports['Solstice-CyberChat']:addSuggestion(command, description, params)

Example:

exports['Solstice-CyberChat']:addSuggestion(
    '/car', 
    'Spawn a vehicle', 
    {
        { name = 'model', help = 'Vehicle model name' }
    }
)

Server Exports

Register Command

exports['Solstice-CyberChat']:registerChatCommand(command, description, handler)

Example:

exports['Solstice-CyberChat']:registerChatCommand('heal', 'Heal a player', function(source, args)
    local target = args[1] and tonumber(args[1]) or source
    -- Healing logic here
end)

5. Developer Integration

Adding Custom Commands

Server-side:

RegisterServerEvent('myscript:initialize')
AddEventHandler('myscript:initialize', function()
    exports['Solstice-CyberChat']:registerChatCommand('customcmd', 'Description', function(source, args)
        -- Command logic
    end)
end)

Custom Notification Types

Create a new notification type in your resource:

-- Add to Config.Colors.types in config.lua
types = {
    custom = 'rgb(150, 75, 255)'
}

-- Using the custom type
exports['Solstice-CyberChat']:showNotification('Custom message', 'custom', 3000)

Message Formatting

The chat supports:

  • URLs: Automatically converted to clickable links

  • IDs: #123 format

  • Mentions: @username format

  • Colors: ^1 to ^9 color codes

  • Commands: /command highlighting

6. Troubleshooting

Common Issues

Chat Not Appearing

  1. Check ensure Solstice-CyberChat is in your server.cfg

  2. Verify default chat is disabled

  3. Check console for errors

Commands Not Registering

  1. Ensure commands are registered after resource start

  2. Check for naming conflicts

  3. Verify permissions if applicable

Notification Issues

  1. Check current notification mode (press L to cycle)

  2. Verify notification settings in config

  3. Check if other resources are conflicting

Support

For additional support or feature requests:

  1. Join our Discord community

  2. Contact our support team

8. License

This resource is protected by copyright law. Redistribution or resale is strictly prohibited.

Need more help? Join our Discord server or contact support!

Last updated

Was this helpful?