Controls::applyDisableControlActionBatch: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "{{ClientsideJsFunction}} {{JSContainer| Applies disabled control given in https://wiki.rage.mp/index.php?title=Controls::setDisableControlActionBatch setDisableControlActionBatch === Return Value === *'''void''' {{RageType|void}} ==Syntax== <pre> mp.game.controls.applyDisableControlActionBatch(); </pre> ==Example== {{ClientsideCode| <syntaxhighlight lang="javascript"> const disablePlayerControls = [ 0, 30, 31, 21, 36, 22, 44, 38, 71, 72, 59, 60, 42, 43, 85, 8...")
 
 
Line 35: Line 35:
}}
}}
==See also==
==See also==
{{Controls_s_function_c}}
{{Controls_functions_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 10:59, 14 May 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


Applies disabled control given in [setDisableControlActionBatch]

Return Value

  • void void

Syntax

mp.game.controls.applyDisableControlActionBatch();

Example

Client-Side
const disablePlayerControls = [
    0, 30, 31, 21, 36, 22, 44, 38, 71, 72, 59, 60, 42, 43, 85, 86, 75, 15, 14,
    228, 37, 229, 348, 156, 199, 204, 172, 173, 37, 199, 44, 178, 244, 220,
    221, 218, 219, 16, 17, 200, 202, 322
];
mp.game.controls.setDisableControlActionBatch(false, disablePlayerControls);


mp.events.add('render', () => {
    mp.game.controls.applyDisableControlActionBatch()
});

//re-enable player controls after 5 seconds
setTimeout(() => {
    mp.game.controls.setDisableControlActionBatch(false, []);
}, 5000);


See also