RDE_MOTD DOCS
RED DRAGON ELITE // ECONOMY & GAMEPLAY

The MOTD From CS / HL1.
Reborn for FiveM.

rde_motd replaces static rules.txt files and Discord pins with a full in-game WYSIWYG-edited server manual — six tabs, native Markdown, and statebag-synced publishing. Edit live and every online player sees it instantly. No restarts. No file edits. No downtime.

01 / Start Here

Overview

Every tab and entry is stored in MySQL. On every server start, the full snapshot publishes to GlobalState.rde_motd_data. Clients subscribe via AddStateBagChangeHandler — no RPC on join, no polling, no race conditions.

Core Principle There is no RPC on join. The statebag delivers the snapshot — cold-join players get the current version from GlobalState in the same frame they subscribe.

Why this over rules.txt / Discord pins

Editing rules.txt / Discord pinsrde_motd
Edit a file over SSH, restart resourceFull in-game WYSIWYG editor
Rules change → players don't knowVersion-based reshow — bump version, everyone sees it again
Static text, no formattingFull Markdown + GFM tables + code blocks + admonitions
Restart required to publishStatebag-synced — instant, zero restart
02 / Start Here

Quick Start

server.cfg
ensure oxmysql
ensure ox_lib
ensure ox_core
ensure rde_motd

add_ace group.admin rde_motd.admin allow

All four tables auto-create and professional default content seeds automatically on first boot. Type /motdadmin and replace every default entry — takes about 10 minutes.

03 / Reference

Six Editable Tabs

TabSeeded Default Content
Welcome / NewsMarkdown intro + server info table
Server Rules5 sections — Core Conduct, Roleplay Standards, Combat & Conflict, Staff, Glossary
Server Laws8-Title IC penal code with charge numbers, fines, RP minutes
Commands5 reference tables — Basic, Communication, Inventory, Phone, Staff
Update LogTimeline view with automatic timestamps
Family / TeamCard grid with role badge, avatar, Markdown bio

Tabs are fully configurable in-game — create custom tabs with any icon, ordering, and type.

04 / Reference

Statebag Sync

Write path
Admin saves entry
  → server callback validates + writes to DB
  → refreshCache() reloads all tabs + entries from DB
  → publish() writes GlobalState.rde_motd_data
  → GlobalState.rde_motd_version increments

Every online client
  → AddStateBagChangeHandler fires automatically
  → NUI open? pushes fresh data instantly
  → NUI closed? data ready the moment player opens /motd
05 / Reference

WYSIWYG Editor (RDWE Editor v1.0)

A full rich-text editor embedded as an iframe — four modes: Visual, Source, Markdown, Preview. Toolbar covers formatting, color picker, table insertion, link/image dialogs, and Find & Replace (Ctrl+H).

postMessage save protocol Content is extracted from the editor iframe via postMessage({ type: 'rde_get_content' }) — a deliberate design choice to work around FiveM's NUI iframe isolation, where direct contentDocument cross-frame access silently returns null.
06 / Reference

Configuration

config.lua
Config.AutoOpenOnJoin      = true
Config.AutoOpenDelayMs     = 4500
Config.ReshowOnVersionBump = true

Config.Editor.maxBodyBytes   = 256 * 1024
Config.Editor.sanitizeOnSave = true  -- strips script/iframe/on* attrs
07 / Reference

Exports API

ExportSideNotes
reload()ServerForce reload from DB and republish
forceReshow()ServerBump version + force MOTD open for all online players
open() / close()ClientOpen/close the MOTD viewer programmatically
08 / More

Common Pitfalls

Markdown content not showing after save

The postMessage bridge between admin.html and editor.html requires the editor iframe to be fully loaded before clicking Save.

Fix: wait for the "Ready" badge in the editor status bar before saving.

Default seeds didn't load

Seeds only run when rde_motd_entries is empty — a previous install may have left rows in place.

Fix: drop the table and restart to re-seed, or add content manually via /motdadmin.

09 / More

FAQ

Does editing content require a restart?

No — every save publishes instantly via GlobalState, live for every online player with zero restart.

Can I force everyone to see an update immediately?

Yes — the Force Reshow button pushes the MOTD to all online players in one click, versus Bump Version which shows it only on next join.

10 / More

Changelog

v1.0.0

Initial release — six default tabs, WYSIWYG editor with postMessage save protocol, RDWEMarkdown v1.0 renderer, statebag-driven sync, triple-layer admin check.