Squirrel/Server/Functions/Messages/MessageAllExcept
From Liberty Unleashed Wiki
(Difference between revisions)
m |
|||
Line 4: | Line 4: | ||
== Syntax == | == Syntax == | ||
− | <code>bool MessageAllExcept( string text, Player plr, int r, int g, int b )</code> | + | <code>bool MessageAllExcept( string text, Player plr, [ int r, int g, int b ] )</code> |
− | <code>bool MessageAllExcept( string text, Player plr, Colour col )</code> | + | <code>bool MessageAllExcept( string text, Player plr, [ Colour col ] )</code> |
== Arguments == | == Arguments == | ||
Line 11: | Line 11: | ||
* '''text''' - This is the message to send to players | * '''text''' - This is the message to send to players | ||
* '''plr''' - This is the player object for the player not to send the message | * '''plr''' - This is the player object for the player not to send the message | ||
− | * '''r''' - The amount of Red to be in the colour | + | * '''r''' - The amount of Red to be in the colour. This argument is optional |
− | * '''g''' - The amount of Green to be in the colour | + | * '''g''' - The amount of Green to be in the colour. This argument is optional |
− | * '''b''' - The amount of Blue to be in the colour | + | * '''b''' - The amount of Blue to be in the colour. This argument is optional |
− | * '''col''' - The colour to use for the message | + | * '''col''' - The colour to use for the message. This argument is optional |
== Example == | == Example == | ||
Line 27: | Line 27: | ||
MessageAllExcept( "Testing message functions...", player, 255, 0, 0 ); | MessageAllExcept( "Testing message functions...", player, 255, 0, 0 ); | ||
} | } | ||
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> |
Latest revision as of 01:59, 16 October 2010
Sends a message to every player in the game except to specified player. It can be customized to your own colour if needed.
[edit] Syntax
bool MessageAllExcept( string text, Player plr, [ int r, int g, int b ] )
bool MessageAllExcept( string text, Player plr, [ Colour col ] )
[edit] 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. This argument is optional
- g - The amount of Green to be in the colour. This argument is optional
- b - The amount of Blue to be in the colour. This argument is optional
- col - The colour to use for the message. This argument is optional
[edit] 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 ); } return 1; }
[edit] Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.
[edit] Related Functions
- BigMessage
- ClearMessages
- Message
- MessageAllExcept
- MessagePlayer
- PagerMessage
- SendPlayerMessage
- SmallMessage