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.
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.
Why this over rules.txt / Discord pins
| Editing rules.txt / Discord pins | rde_motd |
|---|---|
| Edit a file over SSH, restart resource | Full in-game WYSIWYG editor |
| Rules change → players don't know | Version-based reshow — bump version, everyone sees it again |
| Static text, no formatting | Full Markdown + GFM tables + code blocks + admonitions |
| Restart required to publish | Statebag-synced — instant, zero restart |
Quick Start
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.
Six Editable Tabs
| Tab | Seeded Default Content |
|---|---|
| Welcome / News | Markdown intro + server info table |
| Server Rules | 5 sections — Core Conduct, Roleplay Standards, Combat & Conflict, Staff, Glossary |
| Server Laws | 8-Title IC penal code with charge numbers, fines, RP minutes |
| Commands | 5 reference tables — Basic, Communication, Inventory, Phone, Staff |
| Update Log | Timeline view with automatic timestamps |
| Family / Team | Card grid with role badge, avatar, Markdown bio |
Tabs are fully configurable in-game — create custom tabs with any icon, ordering, and type.
Statebag Sync
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
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({ 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.
Configuration
Config.AutoOpenOnJoin = true
Config.AutoOpenDelayMs = 4500
Config.ReshowOnVersionBump = true
Config.Editor.maxBodyBytes = 256 * 1024
Config.Editor.sanitizeOnSave = true -- strips script/iframe/on* attrs
Exports API
| Export | Side | Notes |
|---|---|---|
| reload() | Server | Force reload from DB and republish |
| forceReshow() | Server | Bump version + force MOTD open for all online players |
| open() / close() | Client | Open/close the MOTD viewer programmatically |
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.
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.
Changelog
Initial release — six default tabs, WYSIWYG editor with postMessage save protocol, RDWEMarkdown v1.0 renderer, statebag-driven sync, triple-layer admin check.