Scripting/Squirrel/Functions/FindSphere: Difference between revisions
Jump to navigation
Jump to search

This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "Retrieve a sphere object from sphere's ID. == Syntax == <pre>FindSphere( id )</pre> == Arguments == * ''integer'' '''id''' - The sphere's ID. == Example == <source lang=s...") |
(No difference)
|
Revision as of 12:43, 5 June 2015
Retrieve a sphere object from sphere's ID.
Syntax
FindSphere( id )
Arguments
- integer id - The sphere's ID.
Example
if ( cmd == "sphere" )
{
local sphere = FindSphere( text );
if ( !sphere ) MessagePlayer( "[#ffffff]Can't find sphere " + text + ".", player );
else player.Pos = sphere.Pos;
MessagePlayer( "[#ffffff] Teleport to sphere " + text + ".", player );
}
Notes
Call onPlayerCommand were used in this example. More info about them in the corresponding pages.