- Documentation
- Shared functions
- isControlEnabled
Function
isControlEnabled
Checks whether a game control is enabled (not blocked with toggleControl or toggleAllControls).
Syntax
Server
bool isControlEnabled(player thePlayer, string control)Client
bool isControlEnabled(string control)Arguments
thePlayerplayer- The player (server only).
controlstring- The control name.
Returns
true when the control works.
Example
if not isControlEnabled("fire") then
dxDrawText("Tu nie wolno strzelać", 20, 340)
end
See also
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.toggleAllControlsEnables or disables all game controls at once (e.g. during a cutscene or when freezing a player). Chat, console andbindKeykeys keep working.