Squirrel/Server/Functions/Spheres/Colour

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This ''Sphere'' class member returns or sets the colour ID of the sphere. == Syntax == You can either return or set a new value using this member: <code>int Sphere.Colour</code>...)
 
(Example 1. Returning)
Line 13: Line 13:
 
== Example 1. Returning ==
 
== Example 1. Returning ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerFootSphereHit( player, sphere )
 +
{
 +
MessagePlayer( "This sphere currently has the colour: " + sphere.Colour, player );
 +
}
 
</code>
 
</code>
 +
 +
This will message the player with the spheres colour when they hit it.
  
 
=== Notes ===
 
=== Notes ===
  
-- Example notes/used functions here
+
The call [[Squirrel/Server/Events/Player/onPlayerFootSphereHit|onPlayerFootSphereHit]] was used in in this example. More info about this in the corresponding page.
  
 
== Example 2. Setting ==
 
== Example 2. Setting ==

Revision as of 03:54, 8 March 2010

This Sphere class member returns or sets the colour ID of the sphere.

Syntax

You can either return or set a new value using this member:

  1. int Sphere.Colour
  1. Sphere.Colour = int newcol

Arguments

  • newcol - This is the new colour for the sphere as an integer

Example 1. Returning

  1.  
  2. function onPlayerFootSphereHit( player, sphere )
  3. {
  4. MessagePlayer( "This sphere currently has the colour: " + sphere.Colour, player );
  5. }
  6.  

This will message the player with the spheres colour when they hit it.

Notes

The call onPlayerFootSphereHit was used in in this example. More info about this in the corresponding page.

Example 2. Setting

This function needs an example. You can help us complete the wiki by writing one, or maybe even more :o
  1.  
  2. -- todo
  3.  

Notes

-- Example notes/used functions here

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox