Player::isSpecialAbilityActive

From RAGE Multiplayer Wiki
Revision as of 18:51, 5 November 2024 by Shr0x (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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