Squirrel/Server/Functions/Checkpoints/Colour
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example 1. Returning) |
(→Example 2. Setting) |
||
Line 27: | Line 27: | ||
== Example 2. Setting == | == Example 2. Setting == | ||
− | |||
<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. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Checkpoints}} | {{Squirrel/Server/Functions/Checkpoints}} |
Revision as of 15:48, 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
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.