isPlayerHudComponentVisible | Multi Theft Auto: Wiki Skip to content

isPlayerHudComponentVisible

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function can be used to check whether an hud component is visable or not.

Syntax

isPlayerHudComponentVisible ( )

Code Examples

client
addEventHandler("onClientResourceStart",resourceRoot,function()
local components = {"ammo","area_name","armour","breath","clock","health","money",
"radar","vehicle_name","weapon","radio","wanted","crosshair"
} --Table filled with all the available components to check
for _,component in ipairs(components)do
if isPlayerHudComponentVisible(component)then --check if the component is visible
outputChatBox("Hud Component: "..component.." is visible!") --if it is then tell the client that
else
outputChatBox("Hud Component: "..component.." is not visible!") --if it is not then tell the client that it isn't
end
end
end)

See Also