Squirrel/Server/Functions/Messages/MessagePlayer

From Liberty Unleashed Wiki
Revision as of 20:32, 31 March 2009 by VRocker (Talk | contribs)

Jump to: navigation, search

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

Syntax

MessagePlayer can take 2 differant parameter lists. These are:

  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 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 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

Template:Squirrel/Functions/Misc

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox