- Documentation
- Shared functions
- isValidControlName
Function
isValidControlName
Checks whether a control name is known to the game.
Syntax
bool isValidControlName(string control)Arguments
controlstring- The control name.
Returns
true for a valid name.
Example
addCommandHandler("zablokuj", function(player, _, control)
if not isValidControlName(control or "") then
outputChatBox("Nie ma takiego sterowania.", player)
return
end
toggleControl(player, control, false)
end)
See also
getControlNamesReturns the game control names accepted bytoggleControl,setControlStateandisControlEnabled.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.