Squirrel/Client/Functions/Controls/ToggleCameraMovement

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m
(Added example)
 
Line 13: Line 13:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
+
This code will disallow the player from moving the camera when they use the command '/stopmoving'
Explanation for the example
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- Todo
+
function onClientCommand(cmd, text)
 +
{
 +
    if(cmd == "stopmoving")
 +
    {
 +
        ToggleCameraMovement( false );
 +
    }
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- List of used functions and other notes here.
+
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

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function toggles moving the camera with the mouse on or off.

[edit] Syntax

  1. 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'

  1.  
  2. function onClientCommand(cmd, text)
  3. {
  4. if(cmd == "stopmoving")
  5. {
  6. ToggleCameraMovement( false );
  7. }
  8. }
  9.  

[edit] Notes

The event onClientCommand was used in this example. More information is available on its corresponding page.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox