Player::setPlayerCanDoDriveBy: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Set whether this player should be able to do drive-bys.<br><br>'A drive-by is when a ped is aiming/shooting from vehicle. This includes middle finger taunts. By setting this value to false I confirm the player is unable to do all that. Tested on tick.' - THEAETIK<br>
{{ClientsideJsFunction}}
{{JSContainer|
 
This function enables or disables the ability of a player to perform drive-bys (e.g., aiming or shooting from a vehicle). When set to `false`, the player is restricted from all drive-by actions, including taunting gestures.
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">player.setPlayerCanDoDriveBy(toggle);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.player.setPlayerCanDoDriveBy(toggle);</syntaxhighlight>
 
=== Required Arguments ===
=== Required Arguments ===
*'''toggle:''' Boolean
*'''toggle:''' Boolean
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
mp.game.player.setPlayerCanDoDriveBy(false); // Disable drive-by actions
mp.game.player.setPlayerCanDoDriveBy(true);  // Re-enable drive-by actions
</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 12:33, 2 November 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


This function enables or disables the ability of a player to perform drive-bys (e.g., aiming or shooting from a vehicle). When set to `false`, the player is restricted from all drive-by actions, including taunting gestures.

Syntax

mp.game.player.setPlayerCanDoDriveBy(toggle);

Required Arguments

  • toggle: Boolean

Return value

  • Undefined

Example

mp.game.player.setPlayerCanDoDriveBy(false); // Disable drive-by actions
mp.game.player.setPlayerCanDoDriveBy(true);  // Re-enable drive-by actions


See also