Squirrel/Server/Functions/Camera/FadeCamera
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This function fades the camera for the given player. It is also possible to set the fading colour. == Syntax == ''FadeCamera'' can take 3 different lists of parameters. These a...) |
(→Example) |
||
Line 22: | Line 22: | ||
{{Squirrel/NeedsExample}} | {{Squirrel/NeedsExample}} | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( player, cmd, text ) | |
+ | { | ||
+ | if ( cmd == "fade" ) FadeCamera( player ); | ||
+ | } | ||
</code> | </code> | ||
Revision as of 20:12, 8 December 2009
This function fades the camera for the given player. It is also possible to set the fading colour.
Syntax
FadeCamera can take 3 different lists of parameters. These are:
bool FadeCamera( Player plr, float speed, bool fadeIn )
bool FadeCamera( Player plr, float speed, bool fadeIn, Colour col )
bool FadeCamera( Player plr, float speed, bool fadeIn, int r, int g, int b )
Arguments
- plr - This is the pointer of the player to fade the camera for
- speed - The fading speed. The higher the value, the slower the fade
- fadeIn - A boolean representing whether the camera should be faded in or out
- col - A pointer to a predefined colour object to set the fade colour
- r, g, b - Integer values for the fading colours - red, green, blue. Values range from 0 to 255
Example
This function needs an example. You can help us complete the wiki by writing one, or maybe even more :o
function onPlayerCommand( player, cmd, text ) { if ( cmd == "fade" ) FadeCamera( player ); }
Notes
-- Example notes here