RDE_SLEEP DOCS
RED DRAGON ELITE // PLAYER SYSTEMS

Sleeping Players.
Not Skinless Ghosts.

rde_sleep spawns a real, fully-skinned clone of a disconnected player — proximity-loaded so it only exists when someone's nearby, robbable via ox_inventory, and carryable across the map. Two-phase animation means it actually lies down and breathes instead of T-posing.

01 / Start Here

Overview

Every other sleep script either ignores disconnected players entirely or shows a static, skinless, unanimated ghost. rde_sleep spawns a proximity-loaded clone with full skin restore (via illenium-appearance, with a manual fallback), a robbable ox_inventory stash, and a carry system — pick the player up and drop them anywhere, position persists to the characters table.

Core Principle Zero entities when nobody is nearby. Clones spawn within renderDistance and despawn beyond despawnDistance — a server with thousands of sleeping players costs nothing while everyone's spread across the map.

Why this over other sleep scripts

Other Sleep Scriptsrde_sleep
Skinless placeholder pedFull skin restore via illenium-appearance or manual fallback
Static T-pose on disconnectTwo-phase animation: real lie-down → breathing idle loop
No inventory interactionFull ox_inventory stash — rob sleeping players
Hardcoded position on reconnectPlayer wakes up exactly where they were carried and dropped
02 / Start Here

Quick Start

server.cfg
ensure oxmysql
ensure ox_lib
ensure ox_core
ensure ox_target
ensure ox_inventory
ensure rde_sleep

-- optional but recommended for full skin restore
-- ensure illenium-appearance (before rde_sleep)

Tables auto-create on first run. Key config values to check before going live: Config.PlayerSkinsColumn (must match your playerskins table's charId column — citizenid or charid) and Config.Performance.renderDistance.

03 / Reference

Configuration

config.lua
Config.Performance.renderDistance  = 200.0  -- clone spawn range
Config.Performance.proximityTick   = 1000   -- proximity loop (ms)
Config.Performance.maxVisiblePeds  = 50     -- max simultaneous clones
Config.InvinciblePeds = true             -- clones take no damage
Config.PlayerSkinsColumn = 'citizenid'   -- playerskins column → charId

Config.AdminSystem = {
    acePermission = 'rde.sleepmod',
    checkOrder    = { 'ace', 'oxcore', 'steam' },
}
04 / Reference

Sleeping Animations

Important Config.SleepingAnimations accepts only @idle_a entries. The @base lie-down intro is derived and played automatically — adding your own @base clips causes the idle-twitch bug (they loop forever).
config.lua
-- ✅ Correct
{ dict = 'amb@world_human_bum_slumped@male@laying_on_back@idle_a', clip = 'idle_a' }

-- ❌ Wrong — @base clips loop the lie-down intro forever
{ dict = 'amb@world_human_bum_slumped@male@laying_on_back@base', clip = 'base' }
05 / Reference

Exports

ExportSideReturns
GetSleepingPlayer(stateId)Servertable | nil
GetAllSleepingPlayers()Servertable<stateId, data>
RemoveSleepingPlayer(stateId)Server— (programmatic wake)
IsSleepingClone(entity)Clientboolean
06 / More

Common Pitfalls

Sleeping clone stands upright after server restart

The post-skin delay was 500ms — not enough on restart because illenium-appearance clears ped tasks asynchronously.

Fix (v1.3.2): delay increased to 1000ms, plus animation verification with auto-retry via IsEntityPlayingAnim.

Items duplicate in the stash after resource restart

activeStashes is in-memory only and clears on restart, but ox_inventory persists stash contents in DB — snapshot items were added on top of what was already there.

Fix (v1.3.2): RegisterStash now checks GetInventory first and only populates if the stash is genuinely empty.

Sleeping clone twitches instead of sleeping

@base clips with loop flag=1 repeat the lie-down intro forever.

Fix (v1.3.0): Config now accepts @idle_a entries only — the base intro plays once automatically, then transitions to the loop.

07 / More

FAQ

Is illenium-appearance required?

No — it's optional. Without it, rde_sleep falls back to manual component/overlay/tattoo application for skin restore.

Can admins wake sleeping players?

Yes — triple-layer auth: ACE → ox_core groups → Steam ID whitelist, configurable check order.

What happens to items stolen from a sleeping player?

They're deducted from the actual player's inventory the moment they reconnect — the stash isn't a separate pool.

08 / More

Changelog

v1.3.2

Fixed clone standing upright after restart — post-skin delay increased to 1000ms with animation verification.

v1.3.1

Fixed stash item duplication on resource restart.

v1.3.0

Two-phase animation system — @base intro once, then @idle_a loop. Fixed idle-twitch bug.