Squirrel/Server/Functions/Spheres/Type

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|Sphere.Type}}
 
This ''Sphere'' class member returns or sets the type of the sphere. [[Squirrel/Server/Constants#Marker_Types|Sphere type]] means how it can be hit (on foot, using a vehicle...). Defaults to MARKER_TYPE_BOTH.
 
This ''Sphere'' class member returns or sets the type of the sphere. [[Squirrel/Server/Constants#Marker_Types|Sphere type]] means how it can be hit (on foot, using a vehicle...). Defaults to MARKER_TYPE_BOTH.
  

Latest revision as of 10:37, 11 October 2010

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

This Sphere class member returns or sets the type of the sphere. Sphere type means how it can be hit (on foot, using a vehicle...). Defaults to MARKER_TYPE_BOTH.

[edit] Syntax

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

  1. int Sphere.Type
  1. Sphere.Type = int type

[edit] Arguments

  • type - This is the ID of the new type

[edit] Example 1. Returning

  1.  
  2. function onPlayerFootSphereHit( player, sphere )
  3. {
  4. MessagePlayer( "The current type for this sphere is: " + sphere.Type, player );
  5. }
  6.  

This example will message the player with the type ID for that sphere.

[edit] Example 2. Setting

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

This will change the spheres type to 2 when a player hits 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