Sleepless Prompts
Last updated on
An on-screen input prompt HUD for FiveM. Show keyboard and gamepad button icons with labels, follow player remaps, update groups while they are open, and place them in named screen slots.
Features
- Keyboard and gamepad icons from a bundled button pack
- Set
controlorkeybind. Icons are resolved from the live mapping - GTA control icons follow remaps in Settings (keyboard and gamepad)
- FiveM / ox_lib keybind icons follow remaps under Settings > Key Bindings > FiveM
- Live updates while a group is open
- Named slots (
bottom-center,top-right,middle-left, and more) plus custom coordinates - Auto Xbox vs DualSense / DualShock detection, or a locked mode
- Player command
/promptmodeto pick Auto, Keyboard, Xbox, or PlayStation - Hold progress, press hooks, and per-prompt disable / hide
- Interact-style actions:
onSelect,export,event,serverEvent,command - World targets that show and hide by distance to a coord, entity, or model
- Art styles for keyboard and gamepad
- The same visual themes as Interact (
modern,cyber,vice, and more), plus custom CSS looks
Dependencies
- ox_lib (required)
Installation
Download the Resource
Download a release or clone the repository. The HUD is vanilla HTML, CSS, and JavaScript under web/ and does not need a build step.
Add to Server
Place the sleepless_prompts folder in your server's resources directory.
Configure the Resource
Edit client/modules/config.lua for default slot, icon mode, styles, and theme. See the Configuration page for details.
Quick Start
Other resources can call exports, or import the global:
client_script '@sleepless_prompts/init.lua'Show a prompt group
prompts.show('vehicle', {
position = 'bottom-center',
prompts = {
{ id = 'enter', label = 'Enter', control = 38 },
{ id = 'lock', label = 'Lock', control = 182 },
{ id = 'horn', label = 'Horn', control = 86 },
{ id = 'engine', label = 'Engine', control = 23, holdTime = 1500 },
},
})The same call works through exports.sleepless_prompts:show(...).
Show a prompt near a coord
addCoords, addLocalEntity, addEntity, addModel, and addGlobalPed / Vehicle / Object / Player register a prompt that appears inside distance and hides when the player leaves. See World targets.
prompts.addCoords(vec3(100.0, 200.0, 30.0), {
name = 'open_stash',
label = 'Open',
control = 38,
distance = 2.0,
onSelect = function(data)
print(data.coordId)
end,
})Actions
Same trigger options as Interact. One action runs on press, or when holdTime completes:
{ id = 'lock', label = 'Lock', control = 182, event = 'myresource:lockVehicle' }
{ id = 'engine', label = 'Engine', control = 23, holdTime = 1500, serverEvent = 'myresource:toggleEngine' }
{ id = 'wave', label = 'Wave', control = 47, command = 'e wave' }Priority: onSelect, export, event, serverEvent, command. See Prompt Options.
Update while open
prompts.updatePrompt('vehicle', 'lock', { label = 'Unlock' })
prompts.setPosition('vehicle', 'top-right')
prompts.hide('vehicle')Live remapping
Icons update when the player remaps input. This applies to both:
- GTA controls (
control): keyboard and gamepad glyphs come fromGetControlInstructionalButton. Remap INPUT_PICKUP from E to G, or move it to another pad button, and the open prompt follows. - FiveM / ox_lib keybinds (
keybind): the keyboard icon comes from the liveRegisterKeyMappingbind. Remap it under Settings > Key Bindings > FiveM and the open prompt follows.
auto mode also swaps keyboard vs gamepad icons when the last input device changes.
GTA controls
{ id = 'enter', label = 'Enter', control = 38, disableControl = true }disableControl adds that control to lib.disableControls while the prompt is shown.
ox_lib keybinds
Pass the keybind name from lib.addKeybind, or the table it returns. key / gamepad are not required.
lib.addKeybind({
name = 'vehicle_enter',
description = 'Enter vehicle',
defaultKey = 'E',
onPressed = function() end,
})
prompts.show('vehicle', {
prompts = {
{ keybind = 'vehicle_enter', label = 'Enter' },
},
})prompts.getKeybindKey('vehicle_enter') returns the current keyboard key.
Gamepad names use Xbox layout (A south, B east, X west, Y north). PlayStation faces remap from that. See Prompt Options for the full property list and Client Exports for the API.
Icon mode
Players can run /promptmode to pick Auto, Keyboard, Xbox, or PlayStation. The choice is saved per client.
| Mode | Behavior |
|---|---|
auto | Follows last input device. Detects Xbox vs DualSense / DualShock |
keyboard | Always show keyboard / mouse icons |
xbox | Always show Xbox icons |
playstation | Always show DualSense icons |
Steam Input or DS4Windows wrapping a DualSense as Xbox is treated as Xbox, which matches the buttons the player actually presses.
Support
If you need help or have questions:
