Squirrel/Server/Functions/Spheres/CreateSphere
From Liberty Unleashed Wiki
(Difference between revisions)
(→Syntax) |
(→Arguments) |
||
Line 11: | Line 11: | ||
* '''pos''' - The location the sphere will spawn at | * '''pos''' - The location the sphere will spawn at | ||
* '''radius''' - The radius of the sphere | * '''radius''' - The radius of the sphere | ||
− | * '''col''' - The | + | * '''col''' - The colour of the sphere as a Colour object. If no colour is used the sphere will default to blue |
+ | * '''red, green, blue''' - The colour of the sphere as separate RGB values | ||
== Example == | == Example == |
Revision as of 23:47, 8 November 2010
This function adds a new sphere to the game.
Syntax
sphere CreateSphere( Vector pos, float radius, [ Colour col ] )
sphere CreateSphere( Vector pos, float radius, [ int red, int green, int blue ] )
Arguments
- pos - The location the sphere will spawn at
- radius - The radius of the sphere
- col - The colour of the sphere as a Colour object. If no colour is used the sphere will default to blue
- red, green, blue - The colour of the sphere as separate RGB values
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.