Squirrel/Server/Functions/Spheres/CreateSphere
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example) |
(→Example) |
||
Line 32: | Line 32: | ||
=== Notes === | === Notes === | ||
− | The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in this example. More info about this in the corresponding page. | + | The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in this example. More info about this in the corresponding page.:D |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Spheres}} | {{Squirrel/Server/Functions/Spheres}} |
Latest revision as of 06:59, 21 June 2015
This function adds a new sphere to the game.
[edit] Syntax
sphere CreateSphere( Vector pos, float radius, [ Colour col ] )
sphere CreateSphere( Vector pos, float radius, [ int red, int green, int blue ] )
[edit] 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
[edit] 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, Colour( 0, 0, 255 ) ); } return 1; }
[edit] Notes
The event onPlayerCommand was used in this example. More info about this in the corresponding page.:D