Squirrel/Server/Functions/Players/Muted

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example 1. Returning)
 
Line 20: Line 20:
 
if ( szCommand == "muted" )
 
if ( szCommand == "muted" )
 
{
 
{
pPlayer.Muted = true;
 
 
MessagePlayer( "Muted status - " + pPlayer.Muted, pPlayer );
 
MessagePlayer( "Muted status - " + pPlayer.Muted, pPlayer );
 
}
 
}

Latest revision as of 16:07, 25 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function sets/returns whether or not the player is muted.

[edit] Syntax

  1. bool player.Muted
  1. player.Muted = bool value

[edit] Arguments

  • value - A boolean saying if the player is muted

[edit] Example 1. Returning

This will tell the player if they are muted or not when they type '/muted'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "muted" )
  5. {
  6. MessagePlayer( "Muted status - " + pPlayer.Muted, pPlayer );
  7. }
  8. return 1;
  9. }
  10.  

[edit] Example 2. Setting

This will mute the player when they typed '/muted2'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "muted2" )
  5. {
  6. pPlayer.Muted = true;
  7. }
  8. return 1;
  9. }
  10.  

[edit] Notes

The function MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox