Player::isSpecialAbilityActive: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{ClientsideJsFunction}}
{{JSContainer|
==Description==
This function checks if the player’s special ability is currently active. Special abilities are unique powers available in single-player modes, such as invincibility or increased accuracy. While these abilities may not have full functionality in RageMP, this function can be used to detect whether any such state is active, which could be helpful for custom mechanics or game events.
===Required Params===
* None
===Return value===
* '''{{RageType|boolean}}''' - Returns `true` if the player's special ability is active, otherwise `false`.


==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">player.isSpecialAbilityActive();</syntaxhighlight>
<syntaxhighlight lang="javascript">
=== Required Arguments ===
mp.game.player.isSpecialAbilityActive();
===Return value===
</syntaxhighlight>
*'''Boolean'''
 
==Example==
==Example==
This example checks the special ability's status and logs it to the console:
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
const isActive = mp.game.player.isSpecialAbilityActive();
mp.gui.chat.push(`Special ability active: ${isActive}`);
</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 18:51, 5 November 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


Description

This function checks if the player’s special ability is currently active. Special abilities are unique powers available in single-player modes, such as invincibility or increased accuracy. While these abilities may not have full functionality in RageMP, this function can be used to detect whether any such state is active, which could be helpful for custom mechanics or game events.

Required Params

  • None

Return value

  • 'boolean' - Returns `true` if the player's special ability is active, otherwise `false`.

Syntax

mp.game.player.isSpecialAbilityActive();

Example

This example checks the special ability's status and logs it to the console:

const isActive = mp.game.player.isSpecialAbilityActive();
mp.gui.chat.push(`Special ability active: ${isActive}`);


See also