PlayerClient

setPlayerInvincible

SET_PLAYER_INVINCIBLE0x239528EACDC3E7DE

The GTA V native SET_PLAYER_INVINCIBLE of the PLAYER namespace, as LS:MP client scripts call it: the global function setPlayerInvincible, in JavaScript and in Lua.

SignatureJavaScript
setPlayerInvincible(player: Player, toggle: boolean): void
SignatureLua
setPlayerInvincible(player: Player, toggle: boolean)

Usage

JavaScript
setPlayerInvincible(player, toggle);
Lua
setPlayerInvincible(player, toggle)

Parameters

ParameterTypeJavaScriptLua
playerPlayernumberinteger
toggleBOOLbooleanboolean

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.

Simply sets you as invincible (Health will not deplete).

Reference

Namespace
Player PLAYER
In the game
void SET_PLAYER_INVINCIBLE(Player player, BOOL toggle)
Hash
0x239528EACDC3E7DE

Open in the interactive natives reference