Squirrel/Server/Functions/Spheres/Radius

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|Sphere.Radius}}
 
This ''Sphere'' class member returns or sets the radius of the given sphere.
 
This ''Sphere'' class member returns or sets the radius of the given sphere.
  

Latest revision as of 10:36, 11 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Sphere class member returns or sets the radius of the given sphere.

[edit] Syntax

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

  1. float Sphere.Radius
  1. Sphere.Radius = float fRadius

[edit] Arguments

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

[edit] Example 1. Returning

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

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

[edit] Example 2. Setting

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

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

[edit] Notes

The call onPlayerFootSphereHit was used in in this example. More info about this in the corresponding page.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox