RDE_BODYGUARDS DOCS
RED DRAGON ELITE // ox_core NATIVE

Command your squad.
Sell the rest.

rde_bodyguards is AI companion management for ox_core — recruit by rarity, give real follow/guard/patrol orders to an active squad, and list anyone you don't need on a public marketplace where payouts reach the seller even while they're offline.

3
Max Active
20
Max Owned
5
Rarity Tiers
01 / Start Here

Overview

rde_bodyguards is a full AI-companion system: recruit bodyguards with a rarity roll, level them up, deploy up to three at once, and give squad-wide or individual orders. A public marketplace lets players sell bodyguards they don't want to anyone browsing — not a targeted 1:1 offer, an actual listing board.

Core Principle Marketplace payouts run through rde_banking's offline-safe balance export — a seller gets paid whether or not they're online when the sale happens.
02 / Start Here

Quick Start

server.cfg
ensure ox_core
ensure ox_lib
ensure ox_inventory
ensure ox_target
ensure oxmysql
ensure rde_phone
ensure rde_banking      -- marketplace payouts depend on it
ensure rde_bodyguards
03 / Start Here

F6 Keybind Fallback

The chat command /bg is disabled by default on purpose — F6 is the intended non-phone fallback, chosen specifically to avoid chat spam. Both work independently of whether the phone app is running.

04 / Reference

Rarity & Recruitment

Common Uncommon Rare Epic Legendary

Rarity is rolled at recruitment and affects base stats and skill generation. A recruited bodyguard counts against Config.MaxOwned (20 by default) regardless of rarity.

05 / Reference

Squad Orders

OrderBehavior
FollowStays close, matches player movement.
GuardHolds a position, engages threats nearby.
PatrolRoams a defined radius.
PeacefulHolsters weapons, non-combative.
DismissDespawns — returns to roster, still owned, not deleted.

Mass orders apply to the whole active squad at once — useful mid-fight without opening a menu per bodyguard.

06 / Reference

Public Marketplace

Distinct from the older direct-trade system (which still exists, targeting a specific buyer's character ID). The marketplace is a real listing board: list a bodyguard with a price, anyone browsing can buy it, no target buyer required at listing time.

Race-condition safe Purchases claim the listing via UPDATE ... WHERE status = 'active' — if two players buy the same listing in the same instant, only one succeeds; the other is automatically refunded. No bodyguard is ever sold twice.

A bodyguard must be despawned (not currently active) before it can be listed.

07 / More

Common Pitfalls

NPWD bridge code was pasted inside another function's body

The old roster-push logic for the NPWD phone bridge wasn't placed alongside the real rde_bg:getAll callback — it was pasted inside it, between the real logic and its closing return. The event handlers it registered (AddEventHandler('ox:playerLoaded', ...) and two RegisterNetEvent calls) only actually registered the first time getAll was called — not at resource start, as intended.

Fix: separated back into a clean, self-contained callback. The lesson generalizes — a function body should never contain another feature's setup code, even if it "happens to run eventually."

Direct-trade payouts silently failed for offline sellers

The original 1:1 trade system paid the seller via an online-only money export — an offline seller simply never received payment, with no error surfaced.

Fix: the new public marketplace pays through rde_banking's AdjustBalanceByCharId, which works regardless of the seller's online status. The old direct-trade system was left as-is rather than retrofitted — the marketplace is the recommended path going forward.

08 / More

FAQ

Can I list a bodyguard while it's deployed?

No — despawn it first. This matches the existing direct-trade system's rule.

Does the marketplace require rde_banking?

Yes, for payouts specifically. The rest of the squad-management system doesn't depend on it.

What happens to a listing if the seller goes offline?

Nothing — it stays active and purchasable. Only the payout needs the seller to be reachable, and AdjustBalanceByCharId doesn't need them online for that either.

09 / More

Changelog

Latest

Public marketplace added — offline-safe payouts via rde_banking, atomic purchase claim prevents double-selling.

NPWD/Module Federation removed. Nested-function bug in the roster callback found and fixed.