Controls::disableControlAction: Difference between revisions

From RAGE Multiplayer Wiki
(More explanatory.)
 
(One intermediate revision by the same user not shown)
Line 33: Line 33:


==See also==
==See also==
[[Controls_s_function_c]]
{{Controls_functions_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]

Latest revision as of 10:55, 14 May 2024

Client-Side
Function

 JavaScript



Disable a control so it cannot be used.

Syntax

mp.game.controls.disableControlAction(inputGroup, control, disable);

Required Arguments

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