Squirrel/Server/Functions/Camera/RestoreCamera
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example) |
|||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
+ | This example command restores player's camera to original status when they type '/restorecamera'. | ||
+ | |||
+ | <code lang="squirrel"> | ||
function onPlayerCommand( player, command, text ) | function onPlayerCommand( player, command, text ) | ||
{ | { | ||
− | + | if ( command == "restorecamera" ) | |
+ | { | ||
+ | RestoreCamera( player ); | ||
+ | MessagePlayer( "Your camera has been restored.", player ); | ||
+ | } | ||
} | } | ||
</code> | </code> | ||
Line 20: | Line 27: | ||
=== Notes === | === Notes === | ||
− | The | + | The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in in this example. More info about them in the corresponding pages. |
+ | |||
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Camera}} | {{Squirrel/Server/Functions/Camera}} |
Revision as of 16:19, 7 January 2010
This function restores the camera for the given player.
Syntax
bool RestoreCamera( Player plr )
Arguments
- plr - This is the pointer of the player to whom the camera will be restored
Example
This example command restores player's camera to original status when they type '/restorecamera'.
function onPlayerCommand( player, command, text ) { if ( command == "restorecamera" ) { RestoreCamera( player ); MessagePlayer( "Your camera has been restored.", player ); } }
Notes
The function MessagePlayer and event onPlayerCommand were used in in this example. More info about them in the corresponding pages.
Related Functions
- FadeCamera
- GetCinematicBorder
- RestoreCamera
- ShakeCamera
- SetCameraMatrix
- SetCinematicBorder