Squirrel/Server/Functions/Checkpoints/Colour
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This ''Checkpoint'' class member returns or sets the colour of the checkpoint. == Syntax == You can either return or set a new value using this member: <code>Colour Checkpoint.C...) |
(→Example 1. Returning) |
||
Line 13: | Line 13: | ||
== Example 1. Returning == | == Example 1. Returning == | ||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerFootCheckpointHit( player, checkpoint ) | |
+ | { | ||
+ | local COL_RED = Colour( 255, 0, 0 ); | ||
+ | checkpoint.Colour = COL_RED | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | This example will turn the checkpoint red when a player enters it whilst on foot. | |
== Example 2. Setting == | == Example 2. Setting == |
Revision as of 15:47, 7 January 2010
This Checkpoint class member returns or sets the colour of the checkpoint.
Syntax
You can either return or set a new value using this member:
Colour Checkpoint.Colour
Checkpoint.Colour = Colour col
Arguments
- col - This is the pointer to a pre-defined colour object.
Example 1. Returning
function onPlayerFootCheckpointHit( player, checkpoint ) { local COL_RED = Colour( 255, 0, 0 ); checkpoint.Colour = COL_RED }
Notes
This example will turn the checkpoint red when a player enters it whilst on foot.
Example 2. Setting
This function needs an example. You can help us complete the wiki by writing one, or maybe even more :o
-- todo
Notes
-- Example notes/used functions here