MessagePlayer

From Liberty Unleashed Wiki
Revision as of 01:57, 16 October 2010 by Juppi (Talk | contribs)

Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function sends a personal message to a player in the game. It can be customized to your own colour if needed.

Syntax

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

Arguments

  • text - This is the message to send to the player
  • plr - This is the pointer of 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 a personal message saying 'Testing PM...' when a player types '/testpm'

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "testpm" )
  5. {
  6. MessagePlayer( "Testing PM...", player, 255, 0, 0 );
  7. }
  8. }
  9.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox