Player::getPlayerInvincible: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(yay)
 
Line 1: Line 1:
Returns the Player's Invincible status.<br><br>This function will always return false if 0x733A643B5B0C53C1 is used to set the invincibility status. To always get the correct result, use this:<br><br> bool IsPlayerInvincible(Player player)<br> {<br> auto addr = getScriptHandleBaseAddress(GET_PLAYER_PED(player)); <br><br> if (addr)<br> {<br> DWORD flag = *(DWORD *)(addr + 0x188);<br> return ((flag &amp; (1 &lt;&lt; 8)) != 0) || ((flag &amp; (1 &lt;&lt; 9)) != 0);<br> }<br><br> return false;<br> }<br><br>
Returns the Player's Invincible status.<br><br>This function will always return false if 0x733A643B5B0C53C1 is used to set the invincibility status. To always get the correct result, use this:<br><br> bool IsPlayerInvincible(Player player)<br> {<br> auto addr = getScriptHandleBaseAddress(GET_PLAYER_PED(player)); <br><br> if (addr)<br> {<br> DWORD flag = *(DWORD *)(addr + 0x188);<br> return ((flag &amp; (1 &lt;&lt; 8)) != 0) || ((flag &amp; (1 &lt;&lt; 9)) != 0);<br> }<br><br> return false;<br> }<br><br>
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">player.getPlayerInvincible();</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.player.getPlayerInvincible();</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
===Return value===
===Return value===
Line 7: Line 7:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
// todo
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Player_function_c}}
{{Player_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 21:30, 6 May 2017

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

mp.game.player.getPlayerInvincible();

Required Arguments

Return value

  • Boolean

Example

// todo

See also