Skip to content
M2O Scripting APIScripting reference
Global objectClient APIGenerated

Hud

const Hud: object

Defined in: client/api.d.ts:7

Drives Mafia II’s native heads-up display for this client: the whole layer, hints and messages, the countdown timer, and the wanted, recognition and drunkenness widgets.

clearRecognition(): void

Empties the recognition/search meter.

void

clearWantedLevel(): void

Clears the wanted-level HUD icon.

void

clearWantedTag(): void

Hides the wanted-person HUD tag.

void

destroyHint(tag): void

Removes a persistent HUD hint.

number

Tag assigned when the persistent hint was shown.

void

hide(): void

Hides the native gameplay HUD.

void

isVisible(): boolean

Checks whether the native gameplay HUD layer is visible.

boolean

True when the HUD layer is enabled.

setDrunkLevel(value): void

Applies the native temporary drunkenness effect, including camera shake and aim sway.

number

Drunkenness from 0 for sober to 1 for fully drunk.

void

setRecognition(value, instant?): void

Sets the recognition/search meter beside the minimap.

number

Recognition level from 0 for empty to 1 for full.

boolean

Whether the meter snaps to the value instead of animating; defaults to true.

void

setVisible(visible): void

Sets visibility of the native gameplay HUD. A hide holds until the HUD is shown again; repeated calls are idempotent.

boolean

True to show the HUD; false to hide it.

void

setWantedLevel(level): void

Sets the native wanted-level HUD icon.

number

Wanted escalation level from 0 through 4.

void

setWantedTag(shown): void

Sets visibility of the wanted-person HUD tag.

boolean

Whether the native wanted-person icon is shown.

void

show(): void

Shows the native gameplay HUD.

void

showHint(text, area?, color?, durationSeconds?, persist?, tag?): void

Shows a configurable native hint on the HUD.

string

Hint text displayed on the HUD.

number

Native script-hint area identifier from 0 through 3; defaults to 0.

number

ARGB color value; -1, the default, uses white.

number

Display duration in seconds when the hint is not persistent; defaults to 5.

boolean

Whether the hint remains until explicitly destroyed; defaults to false.

number

Caller-defined identifier used by destroyHint; use a non-zero value for persistent hints.

void

showMessage(text, durationSeconds?): void

Shows a temporary native HUD message.

string

Message displayed on the top HUD message line.

number

How long the message remains visible, in seconds; defaults to 5.

void

startTimer(seconds): void

Sets, shows, and starts the native countdown timer.

number

Initial countdown duration in seconds.

void

stopTimer(): void

Stops and hides the native countdown timer.

void