HUDClient

setWarningMessage

SET_WARNING_MESSAGE0x7B1776B3B53F8D74

The GTA V native SET_WARNING_MESSAGE of the HUD namespace, as LS:MP client scripts call it: the global function setWarningMessage, in JavaScript and in Lua.

SignatureJavaScript
setWarningMessage(
  titleMsg: string,
  flags: number,
  promptMsg: string,
  p3: boolean,
  p4: number,
  p5: string,
  p6: string,
  showBackground: boolean,
  errorCode: number
): void
SignatureLua
setWarningMessage(
  titleMsg: string,
  flags: integer,
  promptMsg: string,
  p3: boolean,
  p4: integer,
  p5: string,
  p6: string,
  showBackground: boolean,
  errorCode: integer
)

Usage

JavaScript
setWarningMessage(titleMsg, flags, promptMsg, p3, p4, p5, p6, showBackground, errorCode);
Lua
setWarningMessage(titleMsg, flags, promptMsg, p3, p4, p5, p6, showBackground, errorCode)

Parameters

ParameterTypeJavaScriptLua
titleMsgstringstringstring
flagsintnumberinteger
promptMsgstringstringstring
p3BOOLbooleanboolean
p4intnumberinteger
p5stringstringstring
p6stringstringstring
showBackgroundBOOLbooleanboolean
errorCodeintnumberinteger

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

You can only use text entries. No custom text.

Example: setWarningMessage("t20", 3, "adder", false, -1, 0, 0, true);

errorCode: shows an error code at the bottom left if nonzero

Reference

Namespace
HUD HUD
In the game
void SET_WARNING_MESSAGE(const char* titleMsg, int flags, const char* promptMsg, BOOL p3, int p4, const char* p5, const char* p6, BOOL showBackground, int errorCode)
Hash
0x7B1776B3B53F8D74

Open in the interactive natives reference