Squirrel/Client/Functions/Camera/ShakeCamera

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 1: Line 1:
 
{{Squirrel/Title|ShakeCamera}}
 
{{Squirrel/Title|ShakeCamera}}
This function shakes the camera of the given player.
+
This function shakes the camera of the client.
  
 
== Syntax ==
 
== Syntax ==
  
<code>bool ShakeCamera( float intensity )</code>
+
<code>bool ShakeCamera( int intensity )</code>
  
 
== Arguments ==
 
== Arguments ==
Line 12: Line 12:
 
== Example ==
 
== Example ==
  
This will shake the players camera when they type /shake
+
This will shake the players camera when they type '/shake'.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
Line 19: Line 19:
 
if ( szCommand == "shake" )
 
if ( szCommand == "shake" )
 
{
 
{
ShakeCamera( 5.00 );
+
ShakeCamera( 250 );
 
}
 
}
 
 
Line 29: Line 29:
  
 
The event [[Squirrel/Client/Events/Player/onClientCommand|onClientCommand]] was used in this example. More info about this in the corresponding page.
 
The event [[Squirrel/Client/Events/Player/onClientCommand|onClientCommand]] was used in this example. More info about this in the corresponding page.
This function currently shakes the camera continuously and won't stop.
 
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Client/Functions/Camera}}
 
{{Squirrel/Client/Functions/Camera}}

Latest revision as of 19:50, 28 October 2010

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

This function shakes the camera of the client.

[edit] Syntax

  1. bool ShakeCamera( int intensity )

[edit] Arguments

  • intensity - The intensity of the shaking

[edit] Example

This will shake the players camera when they type '/shake'.

  1.  
  2. function onClientCommand( szCommand, szText )
  3. {
  4. if ( szCommand == "shake" )
  5. {
  6. ShakeCamera( 250 );
  7. }
  8. return 1;
  9. }
  10.  

[edit] Notes

The event onClientCommand was used in this example. More info about this in the corresponding page.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox