Squirrel/Server/Functions/Messages/MessageAllExcept
From Liberty Unleashed Wiki
(Difference between revisions)
m (Squirrel/Functions/Misc/MessageAllExcept moved to Squirrel/Server/Functions/Messages/MessageAllExcept: Moved to Messages group) |
m (Updated the page) |
||
Line 4: | Line 4: | ||
== Syntax == | == Syntax == | ||
− | <code>bool MessageAllExcept( string text, | + | <code>bool MessageAllExcept( string text, Player plr, int r, int g, int b )</code> |
− | <code>bool MessageAllExcept( string text, | + | <code>bool MessageAllExcept( string text, Player plr, Colour col )</code> |
== Arguments == | == Arguments == | ||
− | * '''text''' - This is the message to send to | + | * '''text''' - This is the message to send to players |
− | * '''plr''' - This is the | + | * '''plr''' - This is the player object for the player not to send the message |
− | * '''r''' - The | + | * '''r''' - The amount of Red to be in the colour |
− | * '''g''' - The | + | * '''g''' - The amount of Green to be in the colour |
− | * '''b''' - The | + | * '''b''' - The amount of Blue to be in the colour |
* '''col''' - The colour to use for the message | * '''col''' - The colour to use for the message | ||
Line 21: | Line 21: | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function | + | function onPlayerCommand( player, cmd, text ) |
{ | { | ||
if ( cmd == "message" ) | if ( cmd == "message" ) | ||
Line 32: | Line 32: | ||
=== Notes === | === Notes === | ||
− | The call [[Squirrel/Events/Player/ | + | The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in in this example. More info about this in the corresponding page. |
== Related Functions == | == Related Functions == | ||
− | {{Squirrel/Functions/ | + | {{Squirrel/Server/Functions/Messages}} |
Revision as of 11:31, 9 September 2009
Sends a message to every player in the game except to specified player. It can be customized to your own colour if needed.
Syntax
bool MessageAllExcept( string text, Player plr, int r, int g, int b )
bool MessageAllExcept( string text, Player plr, Colour col )
Arguments
- text - This is the message to send to players
- plr - This is the player object for the player not to send the message
- r - The amount of Red to be in the colour
- g - The amount of Green to be in the colour
- b - The amount of Blue to be in the colour
- col - The colour to use for the message
Example
This will send a message saying 'Testing message functions...' to all players except the one who uses the command '/message'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "message" ) { MessageAllExcept( "Testing message functions...", player, 255, 0, 0 ); } }
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.
Related Functions
- BigMessage
- ClearMessages
- Message
- MessageAllExcept
- MessagePlayer
- PagerMessage
- SendPlayerMessage
- SmallMessage