Squirrel/Server/Functions/Messages/MessagePlayer
From Liberty Unleashed Wiki
(Difference between revisions)
m |
m |
||
Line 7: | Line 7: | ||
<code>bool MessagePlayer( string text, player plr, int r, int g, int b )</code> | <code>bool MessagePlayer( string text, player plr, int r, int g, int b )</code> | ||
− | <code>bool | + | <code>bool MessagePlayer( string text, player plr, Colour col )</code> |
== Arguments == | == Arguments == |
Revision as of 20:32, 31 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, player plr, int r, int g, int b )
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'
function OnPlayerCommand( player, cmd, text ) { if ( cmd == "testpm" ) { MessagePlayer( "Testing PM...", player, 255, 0, 0 ); } }
Notes
The call OnPlayerCommand was used in in this example. More info about this in the corresponding page.