Squirrel/Server/Functions/Messages/MessagePlayer

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This function sends a personal message to a player in the game. It can be customized to your own colour if needed. == Syntax == <code>bool MessagePlayer( string text, int id, i...)
 
Line 3: Line 3:
  
 
== Syntax ==
 
== Syntax ==
 +
 +
''MessagePlayer'' can take 2 differant parameter lists. These are:
  
 
<code>bool MessagePlayer( string text, int id, int r, int g, int b )</code>
 
<code>bool MessagePlayer( string text, int id, int r, int g, int b )</code>
 +
<code>bool Message( string text, Colour col )</code>
  
 
== Arguments ==
 
== Arguments ==
Line 13: Line 16:
 
* '''g''' - The ammount of Green 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
 
* '''b''' - The ammount of Blue to be in the colour
 +
* '''col''' - A colour class. Good for defining your own colours at script start
  
 
== Example ==
 
== Example ==

Revision as of 14:05, 8 March 2009

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, int id, int r, int g, int b )
  1. bool Message( string text, Colour col )

Arguments

  • text - This is the message to send to the player
  • id - This is the ID 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( id, cmd, text )
  3. {
  4. if ( cmd == "testpm" )
  5. {
  6. MessagePlayer( "Testing PM...", id, 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