Sphere.Type

From Liberty Unleashed Wiki
Revision as of 10:37, 11 October 2010 by VRocker (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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.

Syntax

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

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

Arguments

  • type - This is the ID of the new type

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.

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.

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox