Squirrel/Script Types/Colour
From Liberty Unleashed Wiki
(Difference between revisions)
(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" ) | ||
{ | { | ||
− | + | 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
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'
Col_Blue <- Colour( 0, 0, 255 ); function onPlayerCommand( player, cmd, text ) { if ( cmd == "blue" ) { MessagePlayer( "Testing!", player, Col_Blue ); } }