Squirrel/Server/Functions/Checkpoints/Colour
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example 2. Setting) |
(→Example 1. Returning) |
||
Line 16: | Line 16: | ||
function onPlayerFootCheckpointHit( player, checkpoint ) | function onPlayerFootCheckpointHit( player, checkpoint ) | ||
{ | { | ||
− | + | MessagePlayer( "The current RGB colour of this checkpoint is: " + checkpoint.Colour, player ) | |
− | + | ||
} | } | ||
</code> | </code> | ||
Line 23: | Line 22: | ||
=== Notes === | === Notes === | ||
− | This example will | + | This example will message the player with the current RBG colour of the checkpoint. |
== Example 2. Setting == | == Example 2. Setting == |
Revision as of 15:49, 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 ) { MessagePlayer( "The current RGB colour of this checkpoint is: " + checkpoint.Colour, player ) }
Notes
This example will message the player with the current RBG colour of the checkpoint.
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.