Squirrel/Server/Functions/Checkpoints/Radius

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example 1. Returning)
(Example 2. Setting)
Line 26: Line 26:
 
== Example 2. Setting ==
 
== Example 2. Setting ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerFootCheckpointHit( player, checkpoint )
 +
{
 +
checkpoint.Radius = checkpoint.Radius ++;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- Example notes/used functions here
+
This example will increase the radius of the checkpoint by 1 every time a player enters it.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Checkpoints}}
 
{{Squirrel/Server/Functions/Checkpoints}}

Revision as of 15:53, 7 January 2010

This Checkpoint class member returns or sets the radius of the given checkpoint.

Syntax

You can either return or set a new value for this member:

  1. float Checkpoint.Radius
  1. Checkpoint.Radius = float fRadius

Arguments

  • fRadius - This is the new radius of the checkpoint.

Example 1. Returning

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

Notes

This example will message the player with the current radius of the checkpoint.

Example 2. Setting

  1.  
  2. function onPlayerFootCheckpointHit( player, checkpoint )
  3. {
  4. checkpoint.Radius = checkpoint.Radius ++;
  5. }
  6.  

Notes

This example will increase the radius of the checkpoint by 1 every time a player enters it.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox