Squirrel/Server/Functions/Spheres/CreateClientSphere

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
(Arguments)
 
Line 13: Line 13:
 
* '''radius''' - The radius of the sphere
 
* '''radius''' - The radius of the sphere
 
* '''plr''' - The player to spawn the sphere for
 
* '''plr''' - The player to spawn the sphere for
* '''col''' - The spheres colour
+
* '''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 ==

Latest revision as of 23:45, 8 November 2010

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

This function adds a new sphere to the game for the player specified.

[edit] Syntax

  1. sphere CreateClientSphere( Vector pos, float radius, player plr )
  1. sphere CreateClientSphere( Vector pos, float radius, Colour col, player plr )
  1. sphere CreateClientSphere( Vector pos, float radius, int red, int green, int blue, player plr )

[edit] Arguments

  • pos - The location the sphere will spawn at
  • radius - The radius of the sphere
  • plr - The player to spawn the sphere for
  • 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 client sphere around the player when they type '/sphere'.

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

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox