Controls::disableControlAction: Difference between revisions
MrPancakers (talk | contribs) No edit summary |
(More explanatory.) |
||
| Line 16: | 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> | ||
Revision as of 11:04, 24 August 2020
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);
});