Message

From Liberty Unleashed Wiki
Revision as of 03:50, 24 September 2011 by Stormeus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function sends a chatbox message to the player running the client script only. It can be customised to your own colour if needed. Defaults to Green. This is similar to server-side MessagePlayer.

Syntax

Message can take different lists of parameters. These are:

  1. bool Message( string text, [ int r, int g, int b ] )
  1. bool Message( string text, [ Colour col ] )

Arguments

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

Example

This will send messages saying 'Testing... Red! Green! Blue!' when a client script is loaded.

  1.  
  2. Col_Blue <- Colour( 0, 0, 255 );
  3.  
  4. function onScriptLoad( )
  5. {
  6. Message( "Testing..." );
  7. Message( "Red!", 255, 0, 0 );
  8. Message( "Green!", 0, 255, 0 );
  9. Message( "Blue!", Col_Blue );
  10.  
  11. return 1;
  12. }
  13.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox