Squirrel/Server/Functions/Players/Muted

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|Player.Muted}} This function sets/returns whether or not the player is muted. == Syntax == <code>bool player.Muted</code> <code>player.Muted = bool value</code…')
 
Line 13: Line 13:
 
== Example 1. Returning ==
 
== Example 1. Returning ==
  
{{Squirrel/NeedsExample}}
+
This will tell the player if they are muted or not when they type '/muted'.
Explanation for the example
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "muted" )
 +
{
 +
pPlayer.Muted = true;
 +
MessagePlayer( "Muted status - " + pPlayer.Muted, pPlayer );
 +
}
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
== Example 2. Setting ==
 
== Example 2. Setting ==
  
{{Squirrel/NeedsExample}}
+
This will mute the player when they typed '/muted2'.
Explanation for the example
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "muted2" )
 +
{
 +
pPlayer.Muted = true;
 +
}
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- List of used functions and other notes here.
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Players}}
 
{{Squirrel/Server/Functions/Players}}

Revision as of 16:03, 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.

Syntax

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

Arguments

  • value - A boolean saying if the player is muted

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. pPlayer.Muted = true;
  7. MessagePlayer( "Muted status - " + pPlayer.Muted, pPlayer );
  8. }
  9. return 1;
  10. }
  11.  

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.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox