Exports
toggleHud
Toggle the entire HUD, or pass a boolean to hide or show it explicitly.
-- client only
-- show: boolean? - omit to toggle, true to show, false to hide
exports["jg-hud"]:toggleHud(show)
-- example: hide the HUD during a cutscene
exports["jg-hud"]:toggleHud(false)ToggleHud
An alias for toggleHud, with the same optional boolean argument.
-- client only; omit the argument to reverse the current visibility
exports["jg-hud"]:ToggleHud()hideHud
Hide the entire HUD, even if it is already hidden.
-- client only
exports["jg-hud"]:hideHud()showHud
Show the entire HUD, even if it is already visible.
-- client only
exports["jg-hud"]:showHud()toggleVehicleControl
Hide or show the vehicle control menu.
-- client only
-- show: boolean - true to show the menu, false to hide it
exports["jg-hud"]:toggleVehicleControl(show)CanUseVehicleControls
Choose who can use the vehicle control menu by editing Framework.Client.CanUseVehicleControls in framework/cl-functions.lua. This client helper is editable without opening the rest of the vehicle control code.
The default blocks handcuffed players. If your police resource uses its own cuff check, add that check here. Return false to block the menu and its actions. An open menu closes when the check stops allowing access.
-- vehicle: the player's current vehicle
function Framework.Client.CanUseVehicleControls(vehicle)
if not cache.ped then return false end
return not IsPedCuffed(cache.ped)
endRestart jg-hud after editing the helper. Check that restrained players cannot open the menu or use controls, and that other players still can.
setWeaponAmmoOverride
Overrides the clip and reserve ammo shown for the currently equipped weapon. This is useful for inventory systems that store ammo separately from GTA's native weapon ammo.
The override only changes the HUD display. It does not add or remove ammo from the weapon. It remains active until the weapon changes or clearWeaponAmmoOverride is called.
-- client only
-- clipAmmo: integer - ammo currently loaded in the weapon
-- reserveAmmo: integer - spare ammo, or -1 to show unlimited ammo
local success = exports["jg-hud"]:setWeaponAmmoOverride(clipAmmo, reserveAmmo)
-- example: show 7 rounds loaded and 21 in the inventory
exports["jg-hud"]:setWeaponAmmoOverride(7, 21)| Returns | Type | Description |
|---|---|---|
success | boolean | Whether an equipped weapon and valid values were found |
Call the export again whenever your inventory ammo changes.
clearWeaponAmmoOverride
Clears the ammo override and immediately returns the HUD to GTA's native ammo values.
-- client only
exports["jg-hud"]:clearWeaponAmmoOverride()Last updated 4 October 2026