Player::getInvincible: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(One intermediate revision by the same user not shown)
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>
{{ClientsideJsFunction}}
{{JSContainer|
Returns the Player's Invincible status.
 
===Return value===
*''' {{RageType|boolean}} '''
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">player.getInvincible();</syntaxhighlight>
<syntaxhighlight lang="javascript">
=== Required Arguments ===
mp.game.player.getInvincible();
===Return value===
</syntaxhighlight>
*'''Boolean'''
 
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
//todo
</syntaxhighlight>
</syntaxhighlight>
}}
==See also==
==See also==
{{Player_function_c}}
{{Player_functions_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 10:42, 9 June 2024

Client-Side
Function

 JavaScript



JavaScript Syntax

Returns the Player's Invincible status.

Return value

  • boolean

Syntax

mp.game.player.getInvincible();

Example

//todo



See also