ShowPlayerHudComponent: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Put 'clock' in alphabetical order)
Line 16: Line 16:
:*'''armour:''' The display showing the player's armor
:*'''armour:''' The display showing the player's armor
:*'''breath:''' The display showing the player's breath
:*'''breath:''' The display showing the player's breath
:*'''clock:''' The display showing the in-game time
:*'''health:''' The display showing the player's health
:*'''health:''' The display showing the player's health
:*'''money:''' The display showing how much money the player has
:*'''money:''' The display showing how much money the player has
Line 21: Line 22:
:*'''vehicle_name:''' The text that appears containing the player's vehicle name when the player enters a vehicle
:*'''vehicle_name:''' The text that appears containing the player's vehicle name when the player enters a vehicle
:*'''weapon:''' The display showing the player's weapon
:*'''weapon:''' The display showing the player's weapon
:*'''clock:''' The display showing the in-game time
*'''show:''' Specify if the componenet should be shown (''true'') or hidden (''false'')
*'''show:''' Specify if the componenet should be shown (''true'') or hidden (''false'')
</section>
</section>
Line 35: Line 35:
:*'''armour:''' The display showing the player's armor
:*'''armour:''' The display showing the player's armor
:*'''breath:''' The display showing the player's breath
:*'''breath:''' The display showing the player's breath
:*'''clock:''' The display showing the in-game time
:*'''health:''' The display showing the player's health
:*'''health:''' The display showing the player's health
:*'''money:''' The display showing how much money the player has
:*'''money:''' The display showing how much money the player has
Line 40: Line 41:
:*'''vehicle_name:''' The text that appears containing the player's vehicle name when the player enters a vehicle
:*'''vehicle_name:''' The text that appears containing the player's vehicle name when the player enters a vehicle
:*'''weapon:''' The display showing the player's weapon
:*'''weapon:''' The display showing the player's weapon
:*'''clock:''' The display showing the in-game time
*'''show:''' Specify if the componenet should be shown (''true'') or hidden (''false'')
*'''show:''' Specify if the componenet should be shown (''true'') or hidden (''false'')
</section>
</section>

Revision as of 15:57, 18 November 2007

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

Syntax

Click to collapse [-]
Server
bool showPlayerHudComponent ( player thePlayer, string component, bool show )

Required Arguments

  • thePlayer: description
  • component: The component you wish to show or hide. Valid values are:
  • ammo: The display showing how much ammo the player has in their weapon
  • area_name: The text that appears containing the name of the area a player has entered
  • armour: The display showing the player's armor
  • breath: The display showing the player's breath
  • clock: The display showing the in-game time
  • health: The display showing the player's health
  • money: The display showing how much money the player has
  • radar: The bottom-left corner miniradar
  • vehicle_name: The text that appears containing the player's vehicle name when the player enters a vehicle
  • weapon: The display showing the player's weapon
  • show: Specify if the componenet should be shown (true) or hidden (false)
Click to expand [+]
Client

Returns

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

Example

Click to collapse [-]
Server

This example hides the ammo and weapon displays for players when they join.

function hudChanger ()
    showPlayerHudComponent ( source, "ammo", false )    -- Hide the ammo displays for the newly joined player
    showPlayerHudComponent ( source, "weapon", false )  -- Hide the weapon displays for the newly joined player
end
-- Make our hudChanger function called when the player joins
addEventHandler ( "onPlayerJoin", getRootElement(), hudChanger )

See Also