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

Revision as of 15:25, 17 October 2008

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, int id, int r, int g, int b )

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

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