Squirrel/Server/Functions/Messages/MessageAllExcept

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m (Updated the page)
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 ==
  
* '''text''' - This is the message to send to the player
+
* '''text''' - This is the message to send to players
* '''plr''' - This is the ID of the player
+
* '''plr''' - This is the player object for the player not to send the message
* '''r''' - The ammount of Red to be in the colour
+
* '''r''' - The amount of Red to be in the colour
* '''g''' - The ammount of Green to be in the colour
+
* '''g''' - The amount of Green to be in the colour
* '''b''' - The ammount of Blue to be in the colour
+
* '''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 OnPlayerCommand( player, cmd, text )
+
function onPlayerCommand( player, cmd, text )
 
{
 
{
 
     if ( cmd == "message" )
 
     if ( cmd == "message" )
Line 32: Line 32:
 
=== Notes ===
 
=== Notes ===
  
The call [[Squirrel/Events/Player/OnPlayerCommand|OnPlayerCommand]] was used in in this example. More info about this in the corresponding page.
+
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/Misc}}
+
{{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

  1. bool MessageAllExcept( string text, Player plr, int r, int g, int b )
  1. 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'.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "message" )
  5. {
  6. MessageAllExcept( "Testing message functions...", player, 255, 0, 0 );
  7. }
  8. }
  9.  

Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox