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