Neki_play

Untitled

Nov 21st, 2020
713
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //MCCScript 1.0
  2.  
  3. MCC.LoadBot(new Whitelist());
  4.  
  5. //MCCScript Extensions
  6.  
  7. public class Whitelist: ChatBot
  8. {  
  9.     public List<string> whitelistplayers = new List<string>();
  10.    
  11.     public override void Initialize()
  12.     {
  13.         LogToConsole("Bot enabled");
  14.         whitelistplayers.Add("Player name");
  15.     }
  16.     public override void OnPlayerJoin(Guid uuid, string name)
  17.     {
  18.         bool allow = false;
  19.         foreach (string playername in whitelistplayers)
  20.         {
  21.             if (playername == name)
  22.             {
  23.                 allow = true;
  24.                 break;
  25.             }
  26.         }
  27.         if (!allow)
  28.             SendText("/kick " + name + " you not whitelisted");
  29.     }
  30. }
RAW Paste Data