For script developers
ox_target, qtarget, qb-target
Call them as you always have. HZ-TextUi answers 24 ox_target exports:
addBoxZone, addSphereZone, addPolyZone, removeZone, zoneExists, addGlobalPed, addGlobalVehicle, addGlobalObject, addGlobalPlayer, addGlobalOption and their remove*, addModel / removeModel, addLocalEntity / removeLocalEntity, addEntity / removeEntity, getTargetOptions, isActive, disableTargeting.
The PascalCase qtarget and qb-target names are served too: AddBoxZone, AddCircleZone, AddPolyZone, AddEntityZone, AddTargetModel, AddTargetEntity, AddTargetBone, AddGlobalPed / Vehicle / Object / Player, and their Remove*. Job, gang and item filters carry over.
Option fields follow ox_target and qb-target: label, icon, distance, onSelect, canInteract, groups, items, menuName, openMenu.
The HZ prompts
Eight exports drive the 3D TextUI directly, with a pin visible on proximity rather than on Alt:
exports['hz_textui']:create3DTextUI('my-id', {
coords = vector3(-1461.18, -31.48, 54.63),
displayDist = 6.0, -- distance at which the pin appears
interactDist = 2.0, -- distance at which the label opens
enableKeyClick = true,
keyNum = 38, key = 'E',
text = 'My interaction',
theme = 'green', -- 'green' or 'red'
job = 'all',
canInteract = function() return true end,
triggerData = { triggerName = 'my:event', isServer = false, args = {} },
})
exports['hz_textui']:update3DTextUI('my-id', 'New text', 'red')
exports['hz_textui']:delete3DTextUI('my-id')
The others: create3DTextUIOnEntity, create3DTextUIOnPlayers, delete3DTextUIOnPlayers, openTextUi for a scrollable 3D menu, and closeTextUi.
One thing to know about canInteract
canInteract points into a state that no longer exists and fails on every check.HZ-TextUi drops the option after three failures and prints which option and which resource, instead of filling your console.
Remove what you registered when your resource stops, or register it again on start.
