ToggleAllControls: Difference between revisions
Jump to navigation
Jump to search
JonChappell (talk | contribs) mNo edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool toggleAllControls ( player thePlayer, bool enabled ) </syntaxhighlight> | <syntaxhighlight lang="lua">bool toggleAllControls ( player thePlayer, bool enabled, [bool gtaContols=true, bool mtaControls=true] ) </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== |
Revision as of 08:43, 6 August 2007
Enables or disables the use of all GTA controls for a specified player.
Syntax
bool toggleAllControls ( player thePlayer, bool enabled, [bool gtaContols=true, bool mtaControls=true] )
Required Arguments
- thePlayer: The player you wish to toggle the control ability of.
- enable: A boolean value representing whether or not the controls will be usable or not.
Example
This function will disable the use of all controls in order to freeze a player, which will be used every time someone enters a vehicle.
function freezeThisDude ( thePlayer, time ) toggleAllControls ( thePlayer, false ) -- disable this players controls setTimer ( "toggleAllControls", time, 1, thePlayer, true ) -- enable this players controls after the specified time end addEventHandler ( "onPlayerEnterVehicle", root, "onPlayerEnterVehicle" ) function onPlayerEnterVehicle ( theVehicle, seat, jacked ) freezeThisDude ( source, 5000 ) -- 'freeze' him for 5000ms/5secs end
See Also
- addCommandHandler
- bindKey
- executeCommandHandler
- getCommandHandlers
- getFunctionsBoundToKey
- getKeyBoundToFunction
- isControlEnabled
- removeCommandHandler
- toggleAllControls
- toggleControl
- unbindKey