ItsMods

Full Version: Yurio Ban Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
CSHARP Code
  1. using System.Collections.Generic;
  2. using System.IO;
  3. using Addon;
  4.  
  5. namespace YuBan
  6. {
  7. public class PPack : CPlugin
  8. {
  9. List<string> banned = new List<string>();
  10.  
  11. public override void OnServerLoad()
  12. {
  13. ServerPrint("Yurio Ban Plugin v1.0 loaded");
  14. }
  15.  
  16. public override void OnMapChange()
  17. {
  18. banned.Clear();
  19. foreach(string str in File.ReadAllLines(@"main\permanent.ban"))
  20. if (str.Length > 15) { banned.Add(str.Substring(0, 16)); }
  21. }
  22.  
  23. public override void OnPlayerConnect(ServerClient Client)
  24. {
  25. if (banned.Contains(Client.XUID))
  26. {
  27. ServerCommand("dropclient " + Client.ClientNum);
  28. ServerPrint("Illegal access attempt: " + Client.Name + " with " + Client.XUID);
  29. }
  30. }
  31. }
  32. }
hi there just wondering if this is to be used with an already made cmd as in !banc or !ban or is there another trigger
or is it a plugin that reads the permanent.ban and actually bans?
sorry if it's a newbie question thanks
This plugin does not demand configuring and does not use any commands. He struggles with the Big Ban Bug.

[Image: banqm.jpg]
Nice work, +rep

Psst:
CSHARP Code
  1. public override string OnCheckBan(string xuid)
  2. {
  3. if (banned.Contains(xuid))
  4. return "banned string...";
  5.  
  6. return null;
  7. }


So instead of letting them connect & load everything, deny connection before that.

thanks for the quick reply yurio
great!
+ rep
+rep
when i try this the permission plugin doesn't work?
@hillbilly
Cannot be. These plugins do not interact among themselves, they generally are not connected in any way.



(03-04-2012, 20:34)Nukem Wrote: [ -> ]So instead of letting them connect & load everything, deny connection before that.

Thanks @Nukem Wink
I allow them to be connected. But then they are waited by my small surprise Troll
Again good work m8 +rep well deserved keep it up man Rolleyes
Pages: 1 2