toggleAllControls
Client
Turns all of the local player's controls on or off at once.
Also exists on the server, with its own implementation: toggleAllControls
bool toggleAllControls(bool enabled [, bool gtaControls = true, bool mtaControls = true])
Parameters
| Name | Type | Description |
|---|---|---|
| enabled | bool | true to turn them on, false to turn them off. |
| gtaControls | bool | Whether it applies to the game's controls, such as walking, shooting and driving.default true |
| mtaControls | bool | Whether it applies to keys bound to commands with bindKey. While off, those keys do not run their command; keys bound to functions keep working.default true |
Returns
Always true.
Example
addEventHandler("onClientResourceStart", resourceRoot, function()
toggleAllControls(false, true, false)
setTimer(toggleAllControls, 5000, 1, true)
end)