Player::setEnableHandcuffs: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(Updated page with proper info.)
 
Line 1: Line 1:
ped can not pull out a weapon when true
__NOTOC__
==Syntax==
{{ClientsideJsFunction}}
<syntaxhighlight lang="javascript">player.setEnableHandcuffs(toggle);</syntaxhighlight>
When enabled, players can no longer pull out a weapon. The weapon wheel can still be opened, but it won't equip any selected weapon.
=== Required Arguments ===
 
'''NOTE''': This does not add the hand cuffs or play the animation on the player, this only stops weapons being equiped.
 
{{JSContainer|
== Syntax ==
 
<pre>
player.setEnableHandcuffs(toggle);
</pre>
 
=== Parameters ===
*'''toggle:''' Boolean
*'''toggle:''' Boolean
===Return value===
 
*'''Undefined'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
Enables the cuff effect when the event is called.
// todo
{{ClientsideCode|
</syntaxhighlight>
<pre>
mp.events.add('cuffPlayer', (item) => {
    mp.players.local.setEnableHandcuffs(true);
})
</pre>
}}
}}
==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:Client-side Function]]

Latest revision as of 11:17, 18 July 2021

Client-Side
Function

 JavaScript



When enabled, players can no longer pull out a weapon. The weapon wheel can still be opened, but it won't equip any selected weapon.

NOTE: This does not add the hand cuffs or play the animation on the player, this only stops weapons being equiped.

JavaScript Syntax

Syntax

player.setEnableHandcuffs(toggle);

Parameters

  • toggle: Boolean

Example

Enables the cuff effect when the event is called.

Client-Side
mp.events.add('cuffPlayer', (item) => {
    mp.players.local.setEnableHandcuffs(true);
})


See also