Squirrel/Server/Functions/Camera/ShakeCamera
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|ShakeCamera}} This function shakes the camera of the given player. == Syntax == <code>bool ShakeCamera( Player plr, float intensity )</code> == Arguments == …') |
(→Example) |
||
Line 13: | Line 13: | ||
== Example == | == Example == | ||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( pPlayer, szCommand, szText ) | |
+ | { | ||
+ | if ( szCommand == "shake" ) | ||
+ | { | ||
+ | ShakeCamera( pPlayer, 4.00 ); | ||
+ | } | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in this example. More info about this in the corresponding page. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Camera}} | {{Squirrel/Server/Functions/Camera}} |
Revision as of 15:33, 29 September 2010
This function shakes the camera of the given player.
Syntax
bool ShakeCamera( Player plr, float intensity )
Arguments
- plr - This is the pointer of the player to whose camera should be shaken
- intensity - The intensity of the shaking
Example
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "shake" ) { ShakeCamera( pPlayer, 4.00 ); } }
Notes
The event onPlayerCommand was used in this example. More info about this in the corresponding page.