Squirrel/Client/Functions/Controls/ToggleCameraMovement
From Liberty Unleashed Wiki
(Difference between revisions)
m |
(Added example) |
||
Line 13: | Line 13: | ||
== Example == | == Example == | ||
− | + | This code will disallow the player from moving the camera when they use the command '/stopmoving' | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onClientCommand(cmd, text) | |
+ | { | ||
+ | if(cmd == "stopmoving") | ||
+ | { | ||
+ | ToggleCameraMovement( false ); | ||
+ | } | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The event [[Squirrel/Client/Events/Player/onClientCommand|onClientCommand]] was used in this example. More information is available on its corresponding page. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Client/Functions/Controls}} | {{Squirrel/Client/Functions/Controls}} |
Latest revision as of 22:55, 2 August 2011
This function toggles moving the camera with the mouse on or off.
[edit] Syntax
ToggleCameraMovement( bool toggle )
[edit] Arguments
- toggle - A boolean value to set the camera movements by mouse on or off
[edit] Example
This code will disallow the player from moving the camera when they use the command '/stopmoving'
function onClientCommand(cmd, text) { if(cmd == "stopmoving") { ToggleCameraMovement( false ); } }
[edit] Notes
The event onClientCommand was used in this example. More information is available on its corresponding page.
[edit] Related Functions
- BindKey
- GetKeyStatus
- IsMouseCursorShowing
- GetMouseCursorPos
- SetMouseCursorPos
- ShowMouseCursor
- ToggleCameraMovement
- UnbindKey