Squirrel/Server/Functions/Messages/MessagePlayer
From Liberty Unleashed Wiki
(Difference between revisions)
(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:
bool MessagePlayer( string text, int id, int r, int g, int b )
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'
function OnPlayerCommand( id, cmd, text ) { if ( cmd == "testpm" ) { MessagePlayer( "Testing PM...", id, 255, 0, 0 ); } }
Notes
The call OnPlayerCommand was used in in this example. More info about this in the corresponding page.