Squirrel/Server/Functions/Camera/GetCinematicBorder
From Liberty Unleashed Wiki
(Difference between revisions)
m |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|GetCinematicBorder}} | |
− | This function | + | This function will return whether the cinematic border (widescreen effect) is in use. The function will return a boolean value of either true or false. |
== Syntax == | == Syntax == | ||
− | '' | + | <code>bool GetCinematicBorder( [ Player plr ] )</code> |
+ | |||
+ | == Arguments == | ||
+ | |||
+ | * '''plr''' - If this optional argument is used, the status of the given player is returned. Otherwise returns whether the cinematic border has been enabled globally | ||
== Example == | == Example == | ||
+ | |||
+ | This example returns whether the cinematic border is in use globally when a player types '/cinema'. | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
Line 12: | Line 18: | ||
{ | { | ||
if ( command == "cinema" ) MessagePlayer( "Cinematic border is currently set to " + GetCinematicBorder(), player ); | if ( command == "cinema" ) MessagePlayer( "Cinematic border is currently set to " + GetCinematicBorder(), player ); | ||
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> | ||
Line 17: | Line 25: | ||
=== Notes === | === Notes === | ||
− | + | This is useful for checking that the cinematic border isn't already active before setting it to true. | |
+ | |||
+ | 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:37, 25 September 2010
This function will return whether the cinematic border (widescreen effect) is in use. The function will return a boolean value of either true or false.
[edit] Syntax
bool GetCinematicBorder( [ Player plr ] )
[edit] Arguments
- plr - If this optional argument is used, the status of the given player is returned. Otherwise returns whether the cinematic border has been enabled globally
[edit] Example
This example returns whether the cinematic border is in use globally when a player types '/cinema'.
function onPlayerCommand( player, command, text ) { if ( command == "cinema" ) MessagePlayer( "Cinematic border is currently set to " + GetCinematicBorder(), player ); return 1; }
[edit] Notes
This is useful for checking that the cinematic border isn't already active before setting it to true.
The function MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.
[edit] Related Functions
- FadeCamera
- GetCinematicBorder
- RestoreCamera
- ShakeCamera
- SetCameraMatrix
- SetCinematicBorder