Controls::disableControlAction: Difference between revisions
m (Replaced HTML with template) |
|||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{ClientsideJsFunction}} | |||
Disable a control so it cannot be used. | |||
== Syntax == | |||
<pre> | <pre> | ||
mp.game.controls.disableControlAction(inputGroup, control, disable); | mp.game.controls.disableControlAction(inputGroup, control, disable); | ||
| Line 4: | Line 8: | ||
=== Required Arguments === | === Required Arguments === | ||
*'''inputGroup:''' | *'''inputGroup:''' {{RageType|Int}} ([[InputGroup|Input Groups]]) | ||
*'''control:''' | *'''control:''' {{RageType|Int}} ([[Controls|Game Controls]]) | ||
*'''disable:''' Boolean | *'''disable:''' {{RageType|Boolean}} | ||
===Return value=== | ===Return value=== | ||
| Line 12: | Line 16: | ||
==Example== | ==Example== | ||
{{ClientsideCode| | {{ClientsideCode| | ||
<pre> | <pre> | ||
// This will disable using the character wheel | |||
mp.events.add('render', () => { | mp.events.add('render', () => { | ||
mp.game.controls.disableControlAction(2, 19, true); | mp.game.controls.disableControlAction(2, 19, true); | ||
}); | |||
// Disable vehicle weapon on RMB. | |||
mp.events.add('render', () => { | |||
mp.game.controls.disableControlAction(32, 68, true); // Use inputGroup 32 in case you are not sure, it seems to have the whole collection of control actions. | |||
mp.game.controls.disableControlAction(32, 70, true); | |||
}); | }); | ||
</pre> | </pre> | ||
| Line 21: | Line 33: | ||
==See also== | ==See also== | ||
{{Controls_functions_c}} | |||
[[Category:Clientside API]] | [[Category:Clientside API]] | ||
Latest revision as of 10:55, 14 May 2024
Client-Side Function
Disable a control so it cannot be used.
Syntax
mp.game.controls.disableControlAction(inputGroup, control, disable);
Required Arguments
- inputGroup: Int (Input Groups)
- control: Int (Game Controls)
- disable: Boolean
Return value
- Boolean
Example
Client-Side
// This will disable using the character wheel
mp.events.add('render', () => {
mp.game.controls.disableControlAction(2, 19, true);
});
// Disable vehicle weapon on RMB.
mp.events.add('render', () => {
mp.game.controls.disableControlAction(32, 68, true); // Use inputGroup 32 in case you are not sure, it seems to have the whole collection of control actions.
mp.game.controls.disableControlAction(32, 70, true);
});
See also
- mp.game.controls.disableAllControlActions
- mp.game.controls.disableControlAction
- mp.game.controls.enableAllControlActions
- mp.game.controls.enableControlAction
- mp.game.controls.getControlActionName
- mp.game.controls.getControlValue
- mp.game.controls.getControlNormal
- mp.game.controls.getDisabledControlNormal
- mp.game.controls.isControlEnabled
- mp.game.controls.isControlJustReleased
- mp.game.controls.isControlJustPressed
- mp.game.controls.isControlPressed
- mp.game.controls.isControlReleased
- mp.game.controls.isDisabledControlJustReleased
- mp.game.controls.isDisabledControlJustPressed
- mp.game.controls.isDisabledControlPressed
- mp.game.controls.isInputDisabled
- mp.game.controls.isInputJustDisabled
- mp.game.controls.setControlNormal
- mp.game.controls.setInputExclusive
- mp.game.controls.setPadShake
- mp.game.controls.setPlayerpadShakesWhenControllerDisabled
- mp.game.controls.stopPadShake
- mp.game.controls.useDefaultVehicleEntering
- mp.game.controls.setDisableControlActionBatch
- mp.game.controls.applyDisableControlActionBatch