Controls::isControlPressed: Difference between revisions
m (→Example) |
|||
| Line 10: | Line 10: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
// | if(mp.game.controls.isControlPressed(27, 71)) { | ||
// Vehicle Control: Pressed W | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
{{Controls_s_function_c}} | {{Controls_s_function_c}} | ||
[[Category:Clientside API]] | [[Category:Clientside API]] | ||
[[Category:TODO: Example]] | [[Category:TODO: Example]] | ||
Revision as of 17:06, 6 July 2020
index always is 2 for xbox 360 controller and razerblade
0, 1 and 2 used in the scripts. 0 is by far the most common of them.
Syntax
mp.game.controls.isControlPressed(inputGroup, control);
Required Arguments
- inputGroup: Int (Input Groups)
- control: Int (Controls)
Return value
- Boolean
Example
if(mp.game.controls.isControlPressed(27, 71)) {
// Vehicle Control: Pressed W
}