Player::setUsingActionMode: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
p2 is usually -1 in the scripts. action is either 0 or 'DEFAULT_ACTION'.
p2 is usually -1 in the scripts. action is either 0 or 'DEFAULT_ACTION'.
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">player.setUsingActionMode(p1, p2, action);</syntaxhighlight>
<syntaxhighlight lang="javascript">player.setUsingActionMode(state, timeout, action);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''p1:''' Boolean
*'''state:''' Boolean
*'''p2:''' unknown (to be checked)
*'''timeout:''' Number
*'''action:''' String
*'''action:''' String
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
This will clear melee stance almost instantly when attacking.
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
if (player.isUsingActionMode()) {
  player.setUsingActionMode(-1, -1, 1)
}
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 13:14, 26 May 2020

p2 is usually -1 in the scripts. action is either 0 or 'DEFAULT_ACTION'.

Syntax

player.setUsingActionMode(state, timeout, action);

Required Arguments

  • state: Boolean
  • timeout: Number
  • action: String

Return value

  • Undefined

Example

This will clear melee stance almost instantly when attacking.

if (player.isUsingActionMode()) {
   player.setUsingActionMode(-1, -1, 1)
}

See also