Squirrel/Script Types/Colour

From Liberty Unleashed Wiki
Jump to: navigation, search

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.

Constructor

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

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

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.  

Types

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox