Player::getInvincible: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
Line 10: Line 10:
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Player_function_c}}
{{Player_functions_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Revision as of 10:40, 9 June 2024

Returns the Player's Invincible status.

This function will always return false if 0x733A643B5B0C53C1 is used to set the invincibility status. To always get the correct result, use this:

bool IsPlayerInvincible(Player player)
{
auto addr = getScriptHandleBaseAddress(GET_PLAYER_PED(player));

if (addr)
{
DWORD flag = *(DWORD *)(addr + 0x188);
return ((flag & (1 << 8)) != 0) || ((flag & (1 << 9)) != 0);
}

return false;
}

Syntax

player.getInvincible();

Required Arguments

Return value

  • Boolean

Example

// todo

See also