Squirrel/Server/Functions/Checkpoints/Colour

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example 1. Returning)
(Example 2. Setting)
Line 27: Line 27:
 
== Example 2. Setting ==
 
== Example 2. Setting ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerFootCheckpointHit( player, checkpoint )
 +
{
 +
local COL_RED = Colour( 255, 0, 0 );
 +
checkpoint.Colour = COL_RED
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- Example notes/used functions here
+
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:

  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. 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.

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