[QB, QBOX, ESX] Roleplay Chat, Theme ++ [Updated]

Introducing the roleplay chat for FiveM inspired from SA:MP, a comprehensive chat system that enhances the communication experience in your FiveM server. This script provides several commands, including /me, /do, /ooc and /dice, along with additional features to enrich player interactions and improve roleplaying scenarios.

FEATURES :nail_care:t2:


  • Stay Anon: If you are wearing a mask or any helmet that hides your face, your character’s name will not be visible in the chat.
  • Configurable Proximity: Commands have a proximity range that can be adjusted in the config file.
  • Clear Chat: Clear chat command for user and staff team.
  • Stylish :sunglasses:: Who doesn’t appreciate a simple and elegant design? Plus, the ability to customize your chat strings adds even more flexibility.
  • Customizable Commands: You have the flexibility to customize any command, including their associated help texts.
  • Anti-Spam: You can customize the frequency at which players can send messages to prevent spamming.
  • Same Emote: You have the option to configure whether players can repeatedly use the same command or emote.
  • Join/Leave Messages: You can toggle join and leave messages in config file.
  • Chat Sounds: Sends a tick sound effect(native) if chat visible or visible when active.
    (If player hides the chatbox, it does not.)
  • Drawable Masks: You’ll able to add clothes like masks, it will hide your name in chat.
    Update 02.24.2024:
  • 3D Hologram Emote: 3D Hologram emotes now updated.
  • Collusion: If emote sender is behind a collusion for receiver, it won’t show receiver the hologram and chat message.

EXAMPLE :framed_picture:


image



TO-DO :hammer_and_wrench:


  • :white_check_mark: 3D Text: We will make a 3D hologram text that includes players’ emotes displayed on their ped.
  • [SUG] Typing: We may consider adding animated dots above players’ heads while the chat box is open…
    (If this feature is suggested, we will implement it and provide a toggle option for users to enable or disable it)
  • :white_check_mark: Drawable Masks: You will have the option to add clothing components, drawables such as masks, which will hide your name in the chat…
    (We have already implemented this feature while working on the topic)
  • Changeable Chat Style: You will have the ability to customize the chat style, including options such as displaying names, IDs, or leaving the name empty.
    (Current is name type)

LINKS :link:

Tebex Store (4$)

CONFIG FILE

CONFIG

return {
    -- Main configuration
    Framework = 'auto',                             -- 'auto' or 'custom' 
    PlaySound = true,                               -- Sends a tick sound effect(native) if chat visible or visible when active. (If player hides the chatbox, it does not.) (default: true)
    EnableJoinMessage = false,                      -- Enables join/leave message. Change it to the false for disable. (default: false)
    DisableChat = true,                             -- Toggle chat, you can leave it at true. You can still use the commands (all). (default: true)
    DisableEmoteEntry = false,                      -- Toggle the /me /do emote write on chat as entry (default: false)
    EmoteVisibilityCollusion = true,                -- Toggle emotes visibility collision (default: true)
    EmoteShowTime = 10000,                          -- you know the drill (3D emote)
    EmoteCooldown = 2,                              -- Cooldown for command usage (seconds)
    ForceCapital = true,                            -- a-A

    CommandOptions = {
        ['me'] = {
            proximity = 20,
            help_text = 'It indicates the movement and action of the character.',
            color = '#F2A2DA',
            args = {
                name = 'Action',
                help = 'You can use your action without the *Person* suffix.',
            },
            draw = {
                enabled = true,
                bone = 12844,       -- Head
                offset = vec3(0.0, 0.0, 0.4)
            },
            permission = 'group.user'
        },

        ['do'] = {
            proximity = 20,
            help_text = 'It indicates the character\'s situation and thoughts.',
            color = '#33CCFF',
            args = {
                name = 'Status',
                help = 'You can use your status without the *Person* suffix.',
            },
            draw = {
                enabled = true,
                bone = 11816,       -- Pelvis
                offset = vec3(0.0, 0.0, 0.3)
            },
            permission = 'group.user',
        },

        ['ooc'] = {
            proximity = 10,
            help_text = 'Out of character message.',
            color = '#DBFFFF',
            args = {
                name = 'Message',
                help = 'Your OOC message.',
            },
            draw = {
                enabled = false,
                bone = nil,
                offset = nil
            },
            permission = 'group.user',
        },
    },

    Dice = {
        command = 'dice',
        proximity = 10,
        help_text = "Throws a dice.",
        color = '#FFFFFF',
        args = {
            ['min'] = 1,
            ['max'] = 60,
        },
        draw = {
            enabled = true,
            bone = 11816,       -- Pelvis
            offset = vec3(0.0, 0.0, 0.3)
        },
    },

    ClearChat = {
        ['Self Chat Box'] = {
            command = 'clearchat',
            helptext = 'Clear chat for yourself'
        },

        ['Server Chat Box'] = {
            command = 'ccall',
            permission = 'group.admin',
            helptext = 'Clear chat for everyone'
        }
    },

    -- Please exclude IDs from being considered as masks within the 'MASK/BEARD' category.
    BlacklistedMasks = {
        ['mp_m_freemode_01'] = {1, 2, 3},           -- Male blacklisted masks.
        ['mp_f_freemode_01'] = {1, 2, 3}            -- Female blacklisted masks.
    },

    -- For props like helmet, glasses and others
    -- Check for prop ids, or just ask in our Discord server.
    -- Example usage: ["1"] = {1},
    ExtraPropMasks = {
        ['mp_m_freemode_01'] = {
            ['0'] = {50, 51, 52, 53},           -- Hats/Helmets
            -- ['3'] = {1, 2}
        },

        ['mp_f_freemode_01']= {
            ['0'] = {49, 50, 51, 52},           -- Hats/Helmets
            -- ['1'] = {}
        }
    },

    -- For other categories just check drawable id and put it inside the list.
    -- Check for drawable component ids, or just ask in our Discord server.
    -- Same usage with `ExtraPropMasks`.
    -- https://forum.cfx.re/t/how-to-streaming-addon-clothes-and-ped-props-for-mp-freemode-models/458854
    ExtraDrawableMasks = {
        ['mp_m_freemode_01'] = {
            -- ['0'] = {},
            -- ['1'] = {}
        },
        ['mp_f_freemode_01']= {
            -- ['0'] = {},
            -- ['1'] = {}
        }
    },

    Locales = {
        ['me'] = "* %s: %s",
        ['do'] = "* [%s] %s",
        ['ooc'] = "(( %s: %s ))",
        ['dice'] = "%s rolls a dice and it lands on %d.",
        
        ['anon_name'] = "Anonymous",
        ['spam_message'] = "You can emote in every %s seconds."
    }
}

For any questions or support join our Discord server. :sunglasses:

Code is accessible Partial (Config file)
Subscription-based No
Lines (approximately) 300~
Requirements QBCore Framework, ox_lib
Support Yes
7 Likes

Updated. ++

E(Q5HTA0X1OI$G4WQGF4
Is it possible to modify the message displayed by /me ​​or /do to be displayed above the player’s head?
like this↓
50A{WCF8B%BX`TIN9FCQPY

I will make it configurable. Thanks for suggestion.

Has it been updated?

Not yet, you can check updates by joining discord server. You can make suggestions.

Updated+

+ New file order.
+ Most of the parts are re-written.
+ Added standalone and ESX support suggestion by @xeunoiax
+ Added 3D text positions by bone coords.
+ Added toggleable 3D texts for each command.

- Removed unnecessary lines.
- Removed extra checks for strings.

This feature is available in the new update, within the offset of the player’s bone coordinates.