Creator playbook Guide

Custom press E UI for FiveM QBCore: DrawText and input handling

Build a small QBCore interaction prompt with DrawText, a rebindable command and explicit cleanup. Separate the displayed hint from action validation and shared UI ownership.

Custom press E UI for FiveM QBCore: DrawText and input handling — original Magnate explanatory diagram Original explanatory diagram · Not game footage

A visible E hint does not create an interaction

Treat the prompt, input and gameplay action as separate parts. A string saying press E is display content. A command handles the player’s input. The job, shop or other interaction still owns its eligibility and any server-side state change.

This distinction helps diagnose failures: no hint, no command response and a denied action are different observations. Start with the smallest local display-and-input example before connecting inventory, payments or other gameplay.

What QBCore’s DrawText helpers actually do

The reviewed qb-core client/drawtext.lua is pinned to commit 9b3cddcce93e5e12cbcf6b47b866b687d32ac7bf. It exports DrawText, ChangeText, HideText and KeyPressed. DrawText and ChangeText send text and position through NUI messages; a non-string position defaults to left.

The KeyPressed helper sends its UI message, waits 500 milliseconds and hides the text. It is a feedback helper, not an input detector or a permission check. The example here uses an explicit HideText call so its local completion behavior is easy to inspect.

Create a small staging resource

Create a resource folder with the manifest below and client.lua from the next section. Start it only after the intended qb-core resource is available. This is an original illustrative example, not a runtime-tested resource or a replacement for your installed core UI.

The demonstration deliberately does not place a zone, move a player, grant an item or call a server event. It isolates showing a hint and handling one local command. Use the resource-manifest guide for folder setup.

fxmanifest.lua — original demo manifest
fx_version 'cerulean'
game 'gta5'
dependency 'qb-core'
client_script 'client.lua'

Show a prompt and connect a rebindable action

In a staging session, magnatepromptshow displays the demo hint. The mapped action prints a local diagnostic and hides the prompt only while the demo considers it visible. The default key is E, but the label says default because the mapping can be changed.

RegisterKeyMapping associates a command with a described default input. Do not keep an unconditional press E label if your production interface supports rebinding; design the displayed label for the actual control scheme. Magnate has not run this example in FiveM.

client.lua — original local-only example, not a gameplay authorization system
local visible = false

RegisterCommand('magnatepromptshow', function()
    visible = true
    exports['qb-core']:DrawText('Use demo action (default E)', 'left')
end, false)

RegisterCommand('magnatepromptaction', function()
    if not visible or IsPauseMenuActive() then return end
    visible = false
    exports['qb-core']:HideText()
    print('magnate prompt: local demo action only')
end, false)

RegisterKeyMapping('magnatepromptaction',
    'Magnate: local prompt demo', 'keyboard', 'E')

AddEventHandler('onResourceStop', function(name)
    if name ~= GetCurrentResourceName() or not visible then return end
    if GetResourceState('qb-core') == 'started' then
        exports['qb-core']:HideText()
    end
end)

Connect a real interaction through its owning system

For a location-specific prompt, your interaction or zone code should decide when the hint is relevant. Recheck eligibility when an action occurs, not only when the label first appears. A player can change position or state between seeing a prompt and pressing a key.

For rewards, purchases or restricted server changes, validate the required conditions on the server using that system’s documented integration. The client’s visible flag is not a security boundary. Keep the original denial reason and first error when a displayed action cannot complete.

Coordinate shared text UI ownership

The core helpers in the reviewed file do not provide a per-resource ownership handle. If several resources draw and hide the same prompt UI, one resource’s completion can interfere with another display. A local visible flag describes only this example’s state.

Use one interaction owner or an explicit coordination layer in a larger project. Test overlapping areas and rapid transitions, including a resource stopping while a prompt is shown. Do not resolve a conflict by calling DrawText every frame without first understanding which resource owns the current display.

Check display, input and cleanup separately

The following is an original proposed staging plan. It records no observed gameplay results. Use the actual installed core version and keep the command, prompt text and chosen binding with each observation.

Proposed prompt acceptance matrix
CheckExpected result to defineEvidence to retain
Show demo promptOne intended hint is visibleText, position and resource versions
Activate while visibleOne local response and prompt cleanupConsole result and UI state
Activate while hiddenNo demo actionInitial visibility and command result
Rebind the keyCommand follows selected mappingConfigured binding and truthful label
Stop the demo resourceIts visible hint is cleaned upStop order and first error
Overlapping prompt ownersDefined priority without stale textTransition sequence and owning resources
Real server actionValidated eligibility and intended state changeAllowed/denied results from the owning system

Review scope

Magnate reviewed the pinned QBCore helper and Cfx input/security references on November 15, 2026. No resource installation, FiveM session or gameplay test was performed. The code and acceptance plan are original illustrative material.

Use the NUI guide for a fully custom interface and the keybind guide for broader input questions. These GTA V/FiveM patterns do not establish GTA VI support.

Questions, answered.

Does DrawText automatically listen for E?

No. The helper displays NUI text. Register input handling separately.

Does KeyPressed authorize an action?

No. In the reviewed helper it sends feedback and hides text after a delay.

Is the example safe for shared production prompts without changes?

It is a local staging demonstration. Coordinate ownership and integrate actual action validation before adopting it.

Sources & editorial notes

Source review: November 15, 2026. Platform announcements can change. This guide separates published facts from Magnate’s original analysis and preparation advice.

  1. QBCore — pinned DrawText helpers Reviewed November 15, 2026. Source-level behavior; no game-runtime test.
  2. Cfx — RegisterKeyMapping declaration Reviewed November 15, 2026. Source-level behavior; no game-runtime test.
  3. Cfx — Secure your events Server-side validation of client-triggered actions.

Published by an independent editorial brand. Read our editorial standards.

Find your next move

Search the Magnate guide library.

Browse every guide