ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPlayerHudComponentProperty

Function

setPlayerHudComponentProperty

Stores a HUD component's appearance: one property or a whole table. Properties: posX, posY, size, fillColor, fillColorSecondary, textColor, alignment, drawBlackBorder, drawPercentage, blinkingTimeLimit, textOutline, textShadow, useFontTexture.

Syntax

bool setPlayerHudComponentProperty(player thePlayer, string component, mixed property [, mixed value = nil])

Arguments

thePlayerplayer
The player.Different type in MTA:SA: string component
componentstring
The component.
propertymixed
A property name or a {name = value} table.
valuemixed, optional = nil
The value (when a name is given).Not in MTA:SA

Differences from MTA:SA

  • Arguments in a different colour differ from MTA:SA.

In MTA:SA

setPlayerHudComponentProperty(string component, string property, mixed value)

Returns

true on success.

Example

setPlayerHudComponentProperty(player, "health", { fillColor = { 0, 200, 0, 255 }, drawPercentage = true })

Notes

State for scripts. The server stores the appearance and returns it from getPlayerHudComponentProperty; the game HUD does not apply it yet.

See also