Controls
constControls:object
Defined in: client/api.d.ts:711
Controls whether local gameplay input is accepted, and which individual abilities it drives.
Type Declaration
Section titled “Type Declaration”
readonlyStyle:Readonly<Record<"Walk"|"Run"|"Sprint"|"Use"|"CloseCombat"|"Fire"|"CarInOut"|"CarDrive"|"CarAccessories"|"Covers"|"Obstacles"|"WeaponManip"|"WeaponSelect"|"Zoom"|"Crouch"|"ForceCrosshairOn"|"ForceCrosshairOff"|"WeaponPickup"|"CarShootDisabled"|"All"|"None"|"NoWeapons",number>>
Per-ability input mask bits for Controls.setStyle. A set bit allows that ability; All is the default and None blocks everything. NoWeapons blocks firing, reloading, and drawing while leaving melee and movement intact.
disable()
Section titled “disable()”disable():
void
Disables local gameplay controls until they are enabled again.
Returns
Section titled “Returns”void
enable()
Section titled “enable()”enable():
void
Enables local gameplay controls, also releasing a hold left by a finished scripted animation.
Returns
Section titled “Returns”void
getStyle()
Section titled “getStyle()”getStyle():
number
Returns the ability mask currently applied to local input.
Returns
Section titled “Returns”number
Bitmask of Controls.Style values.
isEnabled()
Section titled “isEnabled()”isEnabled():
boolean
Checks whether local gameplay controls are currently enabled.
Returns
Section titled “Returns”boolean
True when gameplay input is accepted.
setEnabled()
Section titled “setEnabled()”setEnabled(
enabled):void
Sets whether local gameplay controls are enabled.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
True to accept gameplay input; false to lock it.
Returns
Section titled “Returns”void
setStyle()
Section titled “setStyle()”setStyle(
flags):void
Sets which abilities the local client accepts input for. Pass Controls.Style.NoWeapons for a weapons-free area or Controls.Style.All to restore the default; the mask survives respawn.
Parameters
Section titled “Parameters”number
Bitmask of Controls.Style values; a set bit allows that ability.
Returns
Section titled “Returns”void
