Scripting/Squirrel/Functions/FindSphere

From Vice City Multiplayer
Revision as of 20:41, 14 March 2016 by ProsuWANTED (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

Retrieve a sphere object from sphere's ID.

Syntax

FindSphere( id )

Arguments

  • int id - The sphere's ID.

Example

function onPlayerCommand( player, cmd, text )
{
    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.

Related Functions