Ui::setShowHudComponentsThisFrameBatch
Not available on SYNC MP yet
This member is part of the RAGE:MP API but SYNC MP does not implement it yet (Client-side JavaScript). Calling it does nothing or throws.
JavaScript
Required Params
- show Boolean
- components Number[]
Return Value
- void void
Syntax
mp.game.hud.setShowHudComponentsThisFrameBatch(show, components);
Example
Client-Side
const hudComponents = {
HUD_WANTED_STARS: 1,
HUD_WEAPON_ICON: 2,
HUD_CASH: 3,
HUD_MP_CASH: 4
}
//hide hud components
mp.game.hud.setShowHudComponentsThisFrameBatch(false, [hudComponents.HUD_CASH, hudComponents.HUD_MP_CASH, hudComponents.HUD_WANTED_STARS, hudComponents.HUD_WEAPON_ICON]);
mp.events.add('render', () => {
mp.game.hud.applyShowHudComponentsThisFrameBatch()
});
//Show hud components after 5 seconds
setTimeout(() => {
mp.game.hud.setShowHudComponentsThisFrameBatch(true, [hudComponents.HUD_CASH, hudComponents.HUD_MP_CASH, hudComponents.HUD_WANTED_STARS, hudComponents.HUD_WEAPON_ICON]);
}, 5000);
//or to reset hud components that you've shown just set the array to an empty array eg:
mp.game.hud.setShowHudComponentsThisFrameBatch(true, []);