Squirrel/Server/Functions/Camera/RestoreCamera

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This function restores the camera for the given player. == Syntax == <code>bool RestoreCamera( Player plr )</code> == Arguments == * '''plr''' - This is the pointer of the pl...)
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|RestoreCamera}}
 
This function restores the camera for the given player.
 
This function restores the camera for the given player.
  
Line 12: Line 12:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
+
This example command restores player's camera to original status when they type '/restorecamera'.
 +
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( player, command, text )
 +
{
 +
    if ( command == "restorecamera" )
 +
    {
 +
          RestoreCamera( player );
 +
          MessagePlayer( "Your camera has been restored.", player );
 +
    }
 +
   
 +
    return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- Example notes here
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Camera}}
 
{{Squirrel/Server/Functions/Camera}}

Latest revision as of 02:38, 25 September 2010

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

This function restores the camera for the given player.

[edit] Syntax

  1. bool RestoreCamera( Player plr )

[edit] Arguments

  • plr - This is the pointer of the player to whom the camera will be restored

[edit] Example

This example command restores player's camera to original status when they type '/restorecamera'.

  1.  
  2. function onPlayerCommand( player, command, text )
  3. {
  4. if ( command == "restorecamera" )
  5. {
  6. RestoreCamera( player );
  7. MessagePlayer( "Your camera has been restored.", player );
  8. }
  9. return 1;
  10. }
  11.  

[edit] Notes

The function MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox