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.
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.
Why this over other sleep scripts
| Other Sleep Scripts | rde_sleep |
|---|---|
| Skinless placeholder ped | Full skin restore via illenium-appearance or manual fallback |
| Static T-pose on disconnect | Two-phase animation: real lie-down → breathing idle loop |
| No inventory interaction | Full ox_inventory stash — rob sleeping players |
| Hardcoded position on reconnect | Player wakes up exactly where they were carried and dropped |
Quick Start
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.
Configuration
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' },
}
Sleeping Animations
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).
-- ✅ 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' }
Exports
| Export | Side | Returns |
|---|---|---|
| GetSleepingPlayer(stateId) | Server | table | nil |
| GetAllSleepingPlayers() | Server | table<stateId, data> |
| RemoveSleepingPlayer(stateId) | Server | — (programmatic wake) |
| IsSleepingClone(entity) | Client | boolean |
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.
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.
Changelog
Fixed clone standing upright after restart — post-skin delay increased to 1000ms with animation verification.
Fixed stash item duplication on resource restart.
Two-phase animation system — @base intro once, then @idle_a loop. Fixed idle-twitch bug.