HUD
This page describes the HUD API
Fadeout
hudFadeout(player, int, int, int)
Fades the screen to a specified color with a duration.
Has to be called twice to cause blink effect, see example.
Arguments
0 for fadeout, 1 to fade in
Color to fade into / fade out from
Returns
0 if successful, -1 if failed
oak.event('playerConnect', async pid => {
console.log('[info] player connected', pid)
// Cause a white blink effect
oak.hudFadeout(pid, 1, 0.5, 0xFFFFFF)
oak.hudFadeout(pid, 0, 0.5, 0xFFFFFF)
oak.playerPositionSet(pid, [-1774.59301758, -4.88487052917, -2.40491962433])
oak.playerHealthSet(pid, 200)
oak.playerSpawn(pid)
})
Countdown
hudCountdown(player, int)
Displays a race countdown number.
Call it in interval to actually count numbers down.
Arguments
Color to fade into / fade out from
Returns
0 if successful, -1 if failed
Announce
hudAnnounce(player, string, int)
Displays a splash/alert message in the centre of the screen.
Arguments
Returns
0 if successful, -1 if failed
Message
hudMessage(player, string, int)
Displays a message in the left bottom corner of the screen.
Arguments
Returns
0 if successful, -1 if failed