- Documentation
- Shared functions
- lockControls
Function
lockControls
Locks controls on behalf of an owner. A control comes back only when its last owner releases it, so several resources can lock it without unlocking each other. A resource's locks disappear when it stops.
Syntax
bool lockControls(mixed ...)Arguments
...mixed- Server:
player, owner, controls; client:owner, controls.owneris any name,controlsis a control name or a list of names.
Returns
true on success.
Example
lockControls("sklep", { "fire", "aim_weapon", "enter_exit" })
setTimer(function() unlockControls("sklep") end, 5000, 1)
See also
unlockControlsReleases an owner's locks: the given controls, or all of them when the list is omitted.getControlLocksReturns the list of locks on a control as"resource:owner", for diagnostics. The server and the client have separate locks.toggleControlEnables or disables one game control, e.g. shooting (fire), jumping (jump) or entering vehicles (enter_exit). A disabled control ignores the player's keys. On the server you pass a player orroot.