Toggle Display
You can toggle display of whole HUD if you need this (ex. in clothing shop).
Copy -- With export
exports[ "17mov_Hud" ]: ToggleDisplay (state)
-- With client event
TriggerEvent ( "17mov_Hud:ToggleDisplay" , state)
Argument Type Optional Default Value Explanation
Hide Radar
You can force rader to be hidden, no matter of player settings.
Copy exports[ "17mov_Hud" ]: HideRadar (state)
Argument Type Optional Default Value Explanation
Notification
It's showing new notification
Copy -- With export
exports[ "17mov_Hud" ]: ShowNotification (text, type , title, time)
-- With client event
TriggerEvent ( "17mov_Hud:ShowNotification" , text, type , title, time)
Help Notification
It's start showing of Help Notification.
You can use controls like ~INPUT_CONTEXT~
and colors like ~g~
It should be used without any loop!
Later you can need to hide it with HideHelpNotification()
Copy -- With export
exports[ "17mov_Hud" ]: ShowHelpNotification (text)
-- With client event
TriggerEvent ( "17mov_Hud:ShowHelpNotification" , text)
Hide Help Notification
When you first use ShowHelpNotification()
then you need to hide it with this function.
Copy -- With export
exports[ "17mov_Hud" ]: HideHelpNotification ()
-- With client event
TriggerEvent ( "17mov_Hud:HideHelpNotification" )
Help Notification (while)
There is also avabile version of Help Notification to use into while loops. It's hiding automatically when stop hooking.
Copy -- With export
exports[ "17mov_Hud" ]: ShowHelpNotificationWhile (text)
-- With client event
TriggerEvent ( "17mov_Hud:ShowHelpNotificationWhile" , text)
Progress Bar
Starting new progress bar
Copy -- With export
exports[ "17mov_Hud" ]: StartProgress (action, onStart, onTick, onFinish)
-- With client event
TriggerEvent ( "17mov_Hud:StartProgress" , action, onStart, onTick, onFinish)
Argument action object with default values
Copy local action = {
duration = 0 , -- Type: number (Progress bar time (in ms))
label = "" , -- Type: string (Progress bar text)
useWhileDead = false , -- Type: boolean (Can be used while player is dead?)
canCancel = true , -- Type: boolean (Is can be canceled?)
controlDisables = { -- If you want to disable some controls set it here
disableMovement = false , -- Type: boolean (Disable movement controls?)
disableCarMovement = false , -- Type: boolean (Disable car movement controls?)
disableMouse = false , -- Type: boolean (Disable mouse controls?)
disableCombat = false , -- Type: boolean (Disable combat controls?)
},
animation = { -- Here you can play some animation/scenario
animDict = nil , -- Type: string (Animation dict)
anim = nil , -- Type: string (Animation name)
flags = 0 , -- Type: number (Animation flags)
task = nil , -- Type: string (Scenario name)
},
prop = { -- Spawning prop for progress bar
model = nil , -- Type: number (Model hash)
bone = nil , -- Type: string (Bone name)
coords = vec3 ( 0.0 , 0.0 , 0.0 ), -- Type: vector3 (Attachment offsets coords)
rotation = vec3 ( 0.0 , 0.0 , 0.0 ), -- Type: vector3 (Attachment rotation)
},
propTwo = { -- Spawning prop for progress bar if you need two props
model = nil , -- Type: number (Model hash)
bone = nil , -- Type: string (Bone name)
coords = vec3 ( 0.0 , 0.0 , 0.0 ), -- Type: vector3 (Attachment offsets coords)
rotation = vec3 ( 0.0 , 0.0 , 0.0 ), -- Type: vector3 (Attachment rotation)
},
}
Stop Progress
With this function you can stop progress bar in any moment. Then onFinish will return false.
Copy -- With export
exports[ "17mov_Hud" ]: StopProgress ()
-- With client event
TriggerEvent ( "17mov_Hud:StopProgress" )
Open Settings
You can open HUD Settings using:
Copy -- With export
exports[ "17mov_Hud" ]: OpenSettings ()
-- With client event
TriggerEvent ( "17mov_Hud:OpenSettings" )
Getting HUD colors
You can get current HUD colors as HEX codes to use them for ex. in chat to made everyting fits.
Copy -- With export
exports[ "17mov_Hud" ]: GetTheme ( function ( theme )
-- local lightmode = theme['dark']
-- print("Lightmode - Primary color:", lightmode['--color-primary'])
-- print("Lightmode - Secondary color:", lightmode['--color-secondary'])
-- print("Lightmode - Text Primary color:", lightmode['--color-text-primary'])
-- print("Lightmode - Text Secondary color:", lightmode['--color-text-secondary'])
-- print("Lightmode - Transparent color:", lightmode['--color-transparent'])
-- local darkmode = theme['dark']
-- print("Darkmode - Primary color:", darkmode['--color-primary'])
-- print("Darkmode - Secondary color:", darkmode['--color-secondary'])
-- print("Darkmode - Text Primary color:", darkmode['--color-text-primary'])
-- print("Darkmode - Text Secondary color:", darkmode['--color-text-secondary'])
-- print("Darkmode - Transparent color:", darkmode['--color-transparent'])
end )
-- With client event
TriggerEvent ( "17mov_Hud:GetTheme" , function ( theme )
-- local lightmode = theme['dark']
-- print("Lightmode - Primary color:", lightmode['--color-primary'])
-- print("Lightmode - Secondary color:", lightmode['--color-secondary'])
-- print("Lightmode - Text Primary color:", lightmode['--color-text-primary'])
-- print("Lightmode - Text Secondary color:", lightmode['--color-text-secondary'])
-- print("Lightmode - Transparent color:", lightmode['--color-transparent'])
-- local darkmode = theme['dark']
-- print("Darkmode - Primary color:", darkmode['--color-primary'])
-- print("Darkmode - Secondary color:", darkmode['--color-secondary'])
-- print("Darkmode - Text Primary color:", darkmode['--color-text-primary'])
-- print("Darkmode - Text Secondary color:", darkmode['--color-text-secondary'])
-- print("Darkmode - Transparent color:", darkmode['--color-transparent'])
end )
Or you can also obtain colors with every update from settings with:
Copy RegisterNetEvent ( "17mov_Hud:UpdateTheme" , function ( theme )
-- local lightmode = theme['dark']
-- print("Lightmode - Primary color:", lightmode['--color-primary'])
-- print("Lightmode - Secondary color:", lightmode['--color-secondary'])
-- print("Lightmode - Text Primary color:", lightmode['--color-text-primary'])
-- print("Lightmode - Text Secondary color:", lightmode['--color-text-secondary'])
-- print("Lightmode - Transparent color:", lightmode['--color-transparent'])
--
-- local darkmode = theme['dark']
-- print("Darkmode - Primary color:", darkmode['--color-primary'])
-- print("Darkmode - Secondary color:", darkmode['--color-secondary'])
-- print("Darkmode - Text Primary color:", darkmode['--color-text-primary'])
-- print("Darkmode - Text Secondary color:", darkmode['--color-text-secondary'])
-- print("Darkmode - Transparent color:", darkmode['--color-transparent'])
end )
Getting HUD settings
You can also get current HUD settings.
Copy -- With export
exports[ "17mov_Hud" ]: GetSettings ( function ( settings )
-- print(settings)
end )
-- With client event
TriggerEvent ( "17mov_Hud:GetSettings" , function ( settings )
-- print(settings)
end )
You can also obtain settings with every update:
Copy RegisterNetEvent ( "17mov_Hud:UpdateSettings" , function ( settings )
-- print(settings)
end )