Squirrel/Server/Functions/Spheres/Type
From Liberty Unleashed Wiki
(Difference between revisions)
Line 1: | Line 1: | ||
− | + | {{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
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:
int Sphere.Type
Sphere.Type = int type
[edit] Arguments
- type - This is the ID of the new type
[edit] Example 1. Returning
function onPlayerFootSphereHit( player, sphere ) { MessagePlayer( "The current type for this sphere is: " + sphere.Type, player ); }
This example will message the player with the type ID for that sphere.
[edit] Example 2. Setting
function onPlayerFootSphereHit( player, sphere ) { sphere.Type = 2; }
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.