Squirrel/Server/Functions/Messages/Message

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search

Revision as of 11:18, 9 September 2009

This function sends a message to all the players in the game. It can be customised to your own colour if needed. Defaults to Green

Syntax

Message can take 2 differant lists of parameters. These are:

  1. bool Message( string text, int r = 50, int g = 205, b = 50 )
  1. bool Message( string text, Colour col )

Arguments

  • text - This is the message to send to the player
  • r - The ammount of Red to be in the colour
  • g - The ammount of Green to be in the colour
  • b - The ammount of Blue to be in the colour
  • col - A colour class. Good for defining your own colours at script start.

Example

This will send a message saying 'Testing... Red! Green! Blue!' when somebody types '/test'

  1.  
  2. Col_Blue <- Colour( 0, 0, 255 );
  3.  
  4. function OnPlayerCommand( id, cmd, text )
  5. {
  6. if ( cmd == "test" )
  7. {
  8. Message( "Testing..." );
  9. Message( "Red!", 255, 0, 0 );
  10. Message( "Green!", 0, 255, 0 );
  11. Message( "Blue!", Col_Blue );
  12. }
  13. }
  14.  

Notes

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

Related Functions

Template:Squirrel/Functions/Misc

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox