Help Home


Weapon Scr. I
Weapon Scr. II


All Commands

Commands: hud


  • X - X is a number
  • 'X' - X is a string (a letter/word/text)
  • [X=0] - X is an optional parameter with value 0 when omitted (NEVER add [] to your script!)
  • hard sync - command is hard synced

hudammobar(AMMO, TOTAL)

AMMO - left ammo value
TOTAL - total ammo value
Draws a 'ammo bar' HUD element which shows how many ammo is left.

hudchargebar(CHARGE, TOTAL)

CHARGE - current charge value
TOTAL - maximum charge value
Draws a 'charge bar' HUD element which shows the charge power of your weapon.
CHARGE has to be <= TOTAL. The bar is full as soon as CHARGE equals TOTAL.

hudcrosshair([X OFFSET=0], [Y OFFSET=0])

[X OFFSET=0] - crosshair x offset
[Y OFFSET=0] - crosshair y offset
Draws a crosshair for the current player. Use X OFFSET and Y OFFSET to adjust the crosshair position.

hudinfo('TEXT', [CURRENT ONLY=1], [RED=255], [GREEN=255], [BLUE=255])

'TEXT' - info text
[CURRENT ONLY=1] - show for current player only?
[RED=255] - color red (0 to 255)
[GREEN=255] - color green (0 to 255)
[BLUE=255] - color blue (0 to 255)
Displays TEXT at the screen.
By default this message is only displayed for the current player. All other players don't see it. Use 0 for CURRENT ONLY if you want everyone to see the message.
The color of TEXT is white by default. You can use the RED, GREEN and BLUE parameters to change this color.

Attention: The weapon selection menu has to be closed to see TEXT!

hudmapborder([MODE=0] , [OFFSET=0])

Draws a red border around the map (the same border is also displayed in certain positioning modes)

You can also use a yellow border which is only displayed at the top of the map by setting the MODE parameter to 1! In this case you can also specify a drawing OFFSET from the actual top map border (positive values: lower than actual border, negative values: higher).

hudpositioning(MODE, [IMAGE=0], [RANGE=100], [TERRAIN=1], [PLAYERS=1], [OBJECTS=1])

MODE - positioning mode
[IMAGE=0] - optional ID of image which will be positioned
[RANGE=100] - positioning range around the player
[TERRAIN=1] - check col. with terrain
[PLAYERS=1] - check col. with players
[OBJECTS=1] - check col. with objects
Lets the player define a position by left-clicking the map. A valid click will then set some Lua variables.
There are different modes availabe:

pos_normal: free positioning, RANGE doesn't matter, an X marks the position

pos_invisible: same as pos_normal but without the X

pos_build: positioning within RANGE around the player, also displays the borders of the map + positions close to enemies may be blocked depending on host settings

pos_build_noblock: same as pos_build but positions close to enemies are not blocked

pos_range: positioning within RANGE around the player, doesn't show borders of the map

pos_drop: same as pos_invisible but with a yellow border which marks the top of the map. RANGE is 0 by default when using this mode. It can be used to specify a vertical position offset for the yellow border.

This command affects 3 global weapon variables. As soon as the player clicks a valid position it will set:
weapon_position = 1
weapon_x = clicked X coordinate
weapon_y = clicked Y coordinate

Use IMAGE to define an image which will check collisions at the clicked position. The position will only be accepted when this image does not collide with terrain/players/objects (depending on TERRAIN, PLAYERS and OBJECTS). The image will also be drawn at the players mouse position when using pos_build as MODE. Just use 0 for IMAGE if you do not want to use an image.

hudtext('TEXT', X, Y, [RED=255], [GREEN=255], [BLUE=255], [ALIGN=0])

'TEXT' - info text
X - x coordinate
Y - y coordinate
[RED=255] - color red (0 to 255)
[GREEN=255] - color green (0 to 255)
[BLUE=255] - color blue (0 to 255)
[ALIGN=0] - text alignment (0=left, 1=center, 2=right)
Draws a text on the HUD (covers all regular graphics on the screen). All players can see this text. Use the commands screenwidth and screenheight if you want to show the text at the right side/bottom of the screen.

Note: This command can be used multiple times to draw multiple different texts at different spots (not like hudinfo which will always only display one text at a time)

hudtimer(INITIAL, [MIN=1], [MAX=5])

INITIAL - initial timer value
[MIN=1] - minimum timer value (1-10)
[MAX=5] - maximum timer value (1-10)
Draws a 'timer bar' HUD element which shows the current weapon timer setting. The setting can be changed in-game with the numeric keys (1,2,3,4,5,6,7,8,9,0[=10]) on the keyboard and will be saved in the global Lua variable weapon_timer.
By default the timer ranges from 1 (minimum) to 5 (maximum).
It will be automatically set to the initial value on each turn/weapon change.