setPlayerHudComponentVisible | Multi Theft Auto: Wiki Skip to content

setPlayerHudComponentVisible

Client-side
Server-side
Shared

Manual Review Required

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


This function will show or hide a part of the player's HUD.

OOP Syntax Help! I don't understand this!

  • Method:player:setHudComponentVisible(...)

Syntax

bool setPlayerHudComponentVisible ( ​string component, ​bool show )
Required arguments
  • component: The component you wish to show or hide. Valid values are:
  • show: MISSING_PARAM_DESC

Returns

Returns true if the component was shown or hidden succesfully, false if an invalid argument was specified.

  • bool: value

Code Examples

client

This example lets players hide or bring up their bottom-left radar with a command

function toggleRadar()
state = not state
setPlayerHudComponentVisible("radar", state)
end
addCommandHandler( "toggleradar", toggleRadar)

See Also