GetPlayerHudComponentProperty

From Multi Theft Auto: Wiki
Revision as of 19:27, 31 December 2024 by FileEX (talk | contribs) (Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0161|1.6.0|22868|This function gets the value of the specified HUD property.}} ==Syntax== <syntaxhighlight lang="lua"> mixed getPlayerHudComponentProperty (string component, string property) </syntaxhighlight> {{OOP||player:getHudComponentProperty||setPlayerHudComponentProperty}} ===Required Arguments=== *'''component:''' The component whose property you want to retrieve. See HUD Components. *'''property:''' T...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.6.0 r22868:
This function gets the value of the specified HUD property.

Syntax

mixed getPlayerHudComponentProperty (string component, string property)

OOP Syntax Help! I don't understand this!

Method: player:getHudComponentProperty(...)
Counterpart: setPlayerHudComponentProperty


Required Arguments

  • component: The component whose property you want to retrieve. See HUD Components.
  • property: The name of the property you want to read. See HUD Properties.

Returns

Returns different values depending on the type. It can be bool, string, int, int int, or int int int int. If something goes wrong, it returns false.

Example

local r, g, b, a = getPlayerHudComponentProperty('clock', 'fillColor')
local w, h = getPlayerHudComponentProperty('health', 'size')
local outline = getPlayerHudComponentProperty('money', 'fontOutline')

See Also