Scripting/Squirrel/Functions/Sphere.Remove: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
Decent 946 (talk | contribs) (Created page with "allows you to Remove a Sphere. == Syntax == <pre>Sphere.Remove()</pre> == Example == <source lang=D> function onPlayerCommand( player, cmd, text ) { if ( cmd == "removes...") |
Decent 946 (talk | contribs) No edit summary |
||
Line 30: | Line 30: | ||
</source> | </source> | ||
=== Notes === | === Notes === | ||
[[http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Events/Player/onPlayerCommand|''onPlayerCommand'']] was used in this example.. | [[http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Events/Player/onPlayerCommand|''onPlayerCommand'']], [[http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/FindSphere|''FindSphere'']] was used in this example.. |
Revision as of 14:36, 14 March 2016
allows you to Remove a Sphere.
Syntax
Sphere.Remove()
Example
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "removesphere" )
{
if ( !text ) MessagePlayer( "SYNTAX: /"+cmd+" [Sphere ID]", player );
else
{
local Sphere = FindSphere( text.tointeger() );
if ( !IsNum ) MessagePlayer( "Sphere ID must be in numbers", player );
else if ( !Sphere ) MessagePlayer( "Sphere "+text+" is not created yet.", player );
else
{
Sphere.Remove();
MessagePlayer( "you removed the sphere ID: "+ Sphere.ID, player );
}
}
}
}
Notes
[onPlayerCommand], [FindSphere] was used in this example..