Advertisement
QuantumWarpCode

Script_Mute

Dec 31st, 2014
596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.93 KB | None | 0 0
  1. //-----------------------------------------------------------------------------
  2. // Script_Mute
  3. // Made by Elopus A.K.A. QuantumWarpCode
  4. // For use in Blockland
  5. //-----------------------------------------------------------------------------
  6.  
  7. package mute
  8. {
  9.     function serverCmdmute(%client, %target, %time)
  10.     {
  11.         if(%client.isAdmin || %client.isSuperAdmin)
  12.         {
  13.             %target = findClientByName(%target);
  14.             if(%target != 0)
  15.             {
  16.                 if(%target.isMuted)
  17.                 {
  18.                     messageClient(%client,'',"This person has already been muted.");
  19.                 }
  20.                 else
  21.                 {
  22.                     %target.isMuted = true;
  23.                     messageClient(%target, '', '\c3You have been muted by \c6%1\c3 for \c6%2\c3 seconds.', %client.name, %time);
  24.                     %time *= 1000;
  25.                     %target.muteSchedule = schedule(%time, 0, muteTimeUp, %target);
  26.                 }
  27.             }
  28.             else
  29.             {
  30.                 messageClient(%client,'',"Player not found.");
  31.             }
  32.         }
  33.         else
  34.         {
  35.             messageClient(%client,'',"You are not an admin.");
  36.         }
  37.     }
  38.     function serverCmdunMute(%client, %target)
  39.     {
  40.         if(%client.isAdmin || %client.isSuperAdmin)
  41.         {
  42.             %target = findClientByName(%target);
  43.             if(%target != 0)
  44.             {
  45.                 if(!%target.isMuted)
  46.                 {
  47.                     messageClient(%client,'',"This person is not muted.");
  48.                 }
  49.                 else
  50.                 {
  51.                     %target.isMuted = false;
  52.                     messageClient(%target, '', '\c3You have been unmuted by \c6%1\c3.', %client.name);
  53.                     cancel(%target.muteSchedule);
  54.                 }
  55.             }
  56.             else
  57.             {
  58.                 messageClient(%client,'',"Player not found.");
  59.             }
  60.         }
  61.         else
  62.         {
  63.             messageClient(%client,'',"You are not an admin.");
  64.         }
  65.     }
  66.     function muteTimeUp(%client)
  67.     {
  68.         %client.isMuted = false;
  69.         messageClient(%client, '', '\c3Your mute time is up. You can now talk.');
  70.     }
  71.     function serverCmdmessageSent(%client, %text)
  72.     {
  73.         if(%client.isMuted)
  74.         {
  75.             messageClient(%client,'',"You have been muted. You cannot talk.");
  76.         }
  77.         else
  78.         {
  79.             parent::serverCmdmessageSent(%client, %text);
  80.         }
  81.     }
  82. };
  83.  
  84. activatePackage(mute);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement