Squirrel/Server/Events/Player/onPlayerChat

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This is called when a player sends a message in the main chat. This event is also called even if the player is muted. == Syntax == <code>function onPlayerChat( player, message ...)

Revision as of 07:09, 9 January 2010

This is called when a player sends a message in the main chat. This event is also called even if the player is muted.

Syntax

  1. function onPlayerChat( player, message )

Parameters

  • player - The player pointer
  • message - The message the player sent

Example

This example checks if the player has been muted, and if they are, sends a message to them stating they have been muted.

  1.  
  2. function onPlayerChat( player, text )
  3. {
  4. if ( player.Muted )
  5. {
  6. MessagePlayer( "You are currently muted", player );
  7. }
  8. }
  9.  

Notes

The functions MessagePlayer and player.Muted were used in in this example. More info about them in the corresponding pages.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox