Squirrel/Script Types/Colour

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ The Colour type can be used to pre-define certain colour values for e.g. messages and vehicles. Note that most functions only use the r, g and b values of the Colour. == Constru...)
 
m (Message -> MessagePlayer)
 
Line 24: Line 24:
 
     if ( cmd == "blue" )
 
     if ( cmd == "blue" )
 
     {
 
     {
           Message( "Testing!", player, Col_Blue );
+
           MessagePlayer( "Testing!", player, Col_Blue );
 
     }
 
     }
 
}
 
}

Latest revision as of 18:32, 21 August 2009

The Colour type can be used to pre-define certain colour values for e.g. messages and vehicles. Note that most functions only use the r, g and b values of the Colour.

[edit] Constructor

  1. Colour( int r, int g, int b )

[edit] Values

  • r - The amount of Red to be in the colour
  • g - The amount of Green to be in the colour
  • b - The amount of Blue to be in the colour
  • a - The amount of Alpha to be in the colour

[edit] Example

This will send a blue-coloured message saying 'Testing!' when somebody types '/blue'

  1.  
  2. Col_Blue <- Colour( 0, 0, 255 );
  3.  
  4. function onPlayerCommand( player, cmd, text )
  5. {
  6. if ( cmd == "blue" )
  7. {
  8. MessagePlayer( "Testing!", player, Col_Blue );
  9. }
  10. }
  11.  

[edit] Types

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox