Squirrel/Server/Functions/Spheres/CreateSphere
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|CreateSphere}} This function adds a new sphere to the game. == Syntax == <code>sphere CreateSphere( Vector pos, float radius, [int col] )</code> == Arguments …') |
|||
Line 14: | Line 14: | ||
== Example == | == Example == | ||
− | + | This will create a sphere for everyone aroud the player when they type '/globalsphere' | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( pPlayer, szCommand, szText ) | |
+ | { | ||
+ | if ( szCommand == "globalsphere" ) | ||
+ | { | ||
+ | CreateSphere( pPlayer.Pos, 5.00, 0 ); | ||
+ | } | ||
+ | |||
+ | return 1; | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in this example. More info about this in the corresponding page. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Spheres}} | {{Squirrel/Server/Functions/Spheres}} |
Revision as of 17:16, 25 October 2010
This function adds a new sphere to the game.
Syntax
sphere CreateSphere( Vector pos, float radius, [int col] )
Arguments
- pos - The location the sphere will spawn at
- radius - The radius of the sphere
- col - The spheres colour
Example
This will create a sphere for everyone aroud the player when they type '/globalsphere'
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "globalsphere" ) { CreateSphere( pPlayer.Pos, 5.00, 0 ); } return 1; }
Notes
The event onPlayerCommand was used in this example. More info about this in the corresponding page.