SetControlState: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Server client function}}
__NOTOC__  
__NOTOC__  
Sets a state of a specified player's control, as if they pressed or released it.
Sets a state of a specified player's control, as if they pressed or released it.
Line 13: Line 14:
Returns 'true' if the control state was successfully set, 'false' otherwise.
Returns 'true' if the control state was successfully set, 'false' otherwise.


<section name="Server & Client" class="both" show="false">
==Example==   
==Example==   
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.  
Line 24: Line 26:
end
end
</syntaxhighlight>
</syntaxhighlight>
 
</section>
==See Also==
==See Also==
{{Input functions}}
{{Input functions}}

Revision as of 11:01, 11 August 2007

Sets a state of a specified player's control, as if they pressed or released it.

Syntax

bool setControlState ( player thePlayer, 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.

Click to expand [+]
Server & Client

See Also