Difference between revisions of "Lua:AddHudTimer"

From Fortress Forever Wiki
Jump to navigationJump to search
(New page: {{Infobox manual/Header}} ==AddHudTimer== Puts a countdown timer on a player's screen. ===Usage=== <pre>AddHudTimer(player, hudID, timer, interval, x, y, align)</pre> ===Input=== * play...)
 
m (2.42)
Line 5: Line 5:
  
 
===Usage===
 
===Usage===
<pre>AddHudTimer(player, hudID, timer, interval, x, y, align)</pre>
+
<pre>AddHudTimer( player, huditemname, timername, x, y )
 +
AddHudTimer( player, huditemname, timername, x, y, align )
 +
AddHudTimer( player, huditemname, timername, x, y, alignx, aligny )</pre>
  
 
===Input===
 
===Input===

Revision as of 21:03, 25 June 2011


AddHudTimer

Puts a countdown timer on a player's screen.

Usage

AddHudTimer( player, huditemname, timername, x, y )
AddHudTimer( player, huditemname, timername, x, y, align )
AddHudTimer( player, huditemname, timername, x, y, alignx, aligny )

Input

  • player(CFFPlayer) A reference to the player receiving the timer
  • hudID(string) the name of this timer (so we can remove it later)
  • timer(integer?) the inital number of seconds on the timer
  • interval(integer?) amount of time to add to the timer per second?
  • x(integer) horizontal position
  • y(integer) vertical position
  • align(integer) x alignment options:
    • 0: align to left
    • 1: align to right
    • 2: align to left of center
    • 3: align to right of center

Output

Returns noting

Example

local player = CastToPlayer( player_entity )
AddHudTimer(player, "timer", 300, -1, 0, 70, 4)

Note

The timer is strictly a visual aid. To time actual game events, Use the Scheduling System