SetControlState: Difference between revisions
Jump to navigation
Jump to search
m (Moved the section header) |
|||
Line 18: | Line 18: | ||
Returns 'true' if the control state was successfully set, 'false' otherwise. | Returns 'true' if the control state was successfully set, 'false' otherwise. | ||
==Example== | |||
<section name="Server" class="server" show="false"> | <section name="Server" class="server" show="false"> | ||
This example will disable the use of the accelerate, brake/reverse and handbrake keys, then force the accelerate on for any player who enters a vehicle. | This example will disable the use of the accelerate, brake/reverse and handbrake keys, then force the accelerate on for any player who enters a vehicle. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 33: | Line 33: | ||
<section name="Client" class="client" show="false"> | <section name="Client" class="client" show="false"> | ||
This example will disable the use of the accelerate, brake/reverse and handbrake keys, then force the accelerate on for any player who enters a vehicle. | This example will disable the use of the accelerate, brake/reverse and handbrake keys, then force the accelerate on for any player who enters a vehicle. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> |
Revision as of 14:10, 11 August 2007
Sets a state of a specified player's control, as if they pressed or released it.
Syntax
Click to collapse [-]
Serverbool setControlState ( player thePlayer, string control, bool state )
Click to collapse [-]
Clientbool setControlState ( string control, bool state )
Required Arguments
- thePlayer: The player you wish to set the control state of.
- control: The control that you want to set the state of. See control names for a list of possible controls.
- state: A boolean value representing whether or not the key will be set to pressed or not.
Returns
Returns 'true' if the control state was successfully set, 'false' otherwise.
Example
Click to expand [+]
ServerClick to expand [+]
ClientSee Also
- addCommandHandler
- bindKey
- executeCommandHandler
- getCommandHandlers
- getFunctionsBoundToKey
- getKeyBoundToFunction
- isControlEnabled
- removeCommandHandler
- toggleAllControls
- toggleControl
- unbindKey