Berkan Kılıç

Docs

Chat & ME-DO Documentation

Chat & ME-DO →

Installation

  1. Disable the default chat resource (remove ensure chat from server.cfg). Two chats cannot run at the same time.
  2. Put the sz_chat folder into your resources folder. Do not rename the folder; the script will not run if it is renamed.
  3. Add ensure sz_chat to server.cfg after qb-core.
  4. Configure everything in config.lua. No database table is needed.

Requirements: QBCore (qb-core) and FiveM server build 7290 or newer.

Commands

CommandDescription
T keyOpens the chat (players can change it in settings)
/me [action]Character action; above the head and in nearby players' chat
/do [state]Character or scene state
/gme, /gdoHidden-name variants
/sme [seconds] [text], /sdo ...Text that stays for the given time
/scancelRemoves your active texts
/zarat [min] [max]Rolls a dice (result decided by the server)
/clearClears your own chat
/clearallClears everyone's chat (staff)
/callsign [sign]Sets your callsign
/reportkapat, /reportaçTurns report messages off / on (staff)
Job chatsCommands you define in Config.MeslekSohbetleri

All command names can be changed in Config.Komutlar.

Configuration

config.lua is split into sections and every setting has a short description next to it.

  • General: language ('tr' / 'en'), debug, permission levels, turning the /me /do and dice modules on or off
  • Chat: message length, callsign rules and jobs, duty requirements, nearby OOC, job chats
  • /me /do: cooldown, duration limits, distances, "Anonymous" when masked, above-head text color, duration, size and distance, hiding behind obstacles
  • Dice: range limits, cooldown, animation
  • Appearance: chat window size, background, stay-open time, suggestion count, all colors, above-head font and shadow, message templates (HTML)
  • Texts: name format and hidden name; all player-facing texts are in locales/tr.json and locales/en.json

Debugging: set Config.Debug = true, or run chatdebug on / chatdebug off in the server console.

For Developers

Show a /me or /do text from any server script:

exports['sz_chat']:MeDo(source, 'me', 'opens the door', 5, false)
-- type ('me' / 'do'), text, duration (seconds), hide name

Standard chat events are supported, so your other scripts keep working: chat:addMessage, chat:addSuggestion, chat:removeSuggestion, chat:addTemplate, chat:clear, chatMessage.