Squirrel/Server/Functions/Checkpoints/Colour

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example 2. Setting)
(Example 1. Returning)
Line 16: Line 16:
 
function onPlayerFootCheckpointHit( player, checkpoint )
 
function onPlayerFootCheckpointHit( player, checkpoint )
 
{
 
{
local COL_RED = Colour( 255, 0, 0 );
+
MessagePlayer( "The current RGB colour of this checkpoint is: " + checkpoint.Colour, player )
checkpoint.Colour = COL_RED
+
 
}
 
}
 
</code>
 
</code>
Line 23: Line 22:
 
=== Notes ===
 
=== Notes ===
  
This example will turn the checkpoint red when a player enters it whilst on foot.
+
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:

  1. Colour Checkpoint.Colour
  1. Checkpoint.Colour = Colour col

Arguments

  • col - This is the pointer to a pre-defined colour object.

Example 1. Returning

  1.  
  2. function onPlayerFootCheckpointHit( player, checkpoint )
  3. {
  4. MessagePlayer( "The current RGB colour of this checkpoint is: " + checkpoint.Colour, player )
  5. }
  6.  

Notes

This example will message the player with the current RBG colour of the checkpoint.

Example 2. Setting

  1.  
  2. function onPlayerFootCheckpointHit( player, checkpoint )
  3. {
  4. local COL_RED = Colour( 255, 0, 0 );
  5. checkpoint.Colour = COL_RED
  6. }
  7.  

Notes

This example will turn the checkpoint red when a player enters it whilst on foot.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox