Squirrel/Server/Functions/Spheres/ID
From Liberty Unleashed Wiki
(Difference between revisions)
Line 12: | Line 12: | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function | + | function onPlayerEnterSphere( player, sphere ) |
{ | { | ||
− | + | MessagePlayer( "The current id of this sphere is: " + sphere.ID, player ); | |
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> | ||
Line 22: | Line 24: | ||
=== Notes === | === Notes === | ||
− | The call [[Squirrel/Server/Events/ | + | The call [[Squirrel/Server/Events/Sphere/onPlayerEnterSphere|onPlayerEnterSphere]] was used in this example. More info about this can be found in the corresponding page. |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Spheres}} | {{Squirrel/Server/Functions/Spheres}} |
Revision as of 00:32, 13 March 2011
This Sphere class member returns the ID of the sphere.
Syntax
int Sphere.ID
Arguments
- none
Example
function onPlayerEnterSphere( player, sphere ) { MessagePlayer( "The current id of this sphere is: " + sphere.ID, player ); return 1; }
This example will message the player with the current ID of the sphere when they collect it.
Notes
The call onPlayerEnterSphere was used in this example. More info about this can be found in the corresponding page.