Squirrel/Server/Functions/Spheres/CreateSphere

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Syntax)
Line 4: Line 4:
 
== Syntax ==
 
== Syntax ==
  
<code>sphere CreateSphere( Vector pos, float radius, [int col] )</code>
+
<code>sphere CreateSphere( Vector pos, float radius, [ Colour col ] )</code>
 +
<code>sphere CreateSphere( Vector pos, float radius, [ int red, int green, int blue ] )</code>
  
 
== Arguments ==
 
== Arguments ==

Revision as of 23:46, 8 November 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function adds a new sphere to the game.

Syntax

  1. sphere CreateSphere( Vector pos, float radius, [ Colour col ] )
  1. 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 spheres colour

Example

This will create a sphere for everyone aroud the player when they type '/globalsphere'

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "globalsphere" )
  5. {
  6. CreateSphere( pPlayer.Pos, 5.00, 0 );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The event onPlayerCommand was used in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox