Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Collections;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using InfinityScript;
- using System.Timers;
- using System.IO;
- using System.Net;
- namespace RuleAndSite
- {
- public class RuleAndSite : BaseScript
- {
- int delay = 1200;
- public RuleAndSite()
- {
- if (System.IO.File.Exists(@"scripts\\sa.txt"))
- return;
- else
- File.Create(@"scripts\\sa.txt");
- Log.Info("The Sa.txt file has been created for you into scripts folder, add into it the GUID of admins you want allow to use commands!");
- if (System.IO.File.Exists(@"scripts\\RAS.txt"))
- return;
- else
- File.Create(@"scripts\\RAS.txt");
- Log.Info("The RAS.txt file has been created for you into scripts folder, add into it the Rules you want to be displayed!");
- }
- string r1;
- string r2;
- string r3;
- string r4;
- string r5;
- string r6;
- string r7;
- string r8;
- string r9;
- string r10;
- string[] lines = System.IO.File.ReadAllLines(@"scripts\\RAS.txt");
- public override void OnSay(Entity player, string Name, string MessageTyped)
- {
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!website"))
- {
- Utilities.RawSayAll("^5[^3WE^5]: ^7Visit Our Website ^5www.worldelite.info");
- }
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!sr1"))
- {
- foreach (string str2 in lines)
- {
- if (str2.StartsWith("<rule1>"))
- r1 = str2.Split('=')[1];
- Utilities.RawSayAll(r1);
- }
- }
- }
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!sr2"))
- {
- foreach (string str2 in lines)
- {
- if (str2.StartsWith("<rule2>"))
- r2 = str2.Split('=')[1];
- Utilities.RawSayAll(r2);
- }
- }
- }
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!sr3"))
- {
- foreach (string str2 in lines)
- {
- if (str2.StartsWith("<rule3>"))
- r3 = str2.Split('=')[1];
- Utilities.RawSayAll(r3);
- }
- }
- }
- }
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!sr4"))
- {
- foreach (string str2 in lines)
- {
- if (str2.StartsWith("<rule4>"))
- r4 = str2.Split('=')[1];
- Utilities.RawSayAll(r4);
- }
- }
- }
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!sr5"))
- {
- foreach (string str2 in lines)
- {
- if (str2.StartsWith("<rule5>"))
- r5 = str2.Split('=')[1];
- Utilities.RawSayAll(r5);
- }
- }
- }
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!sr6"))
- {
- foreach (string str2 in lines)
- {
- if (str2.StartsWith("<rule6>"))
- r6 = str2.Split('=')[1];
- Utilities.RawSayAll(r6);
- }
- }
- }
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!sr7"))
- {
- foreach (string str2 in lines)
- {
- if (str2.StartsWith("<rule7>"))
- r7 = str2.Split('=')[1];
- Utilities.RawSayAll(r7);
- }
- }
- }
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!sr8"))
- {
- foreach (string str2 in lines)
- {
- if (str2.StartsWith("<rule8>"))
- r8 = str2.Split('=')[1];
- Utilities.RawSayAll(r8);
- }
- }
- }
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!sr9"))
- {
- foreach (string str2 in lines)
- {
- if (str2.StartsWith("<rule9>"))
- r9 = str2.Split('=')[1];
- Utilities.RawSayAll(r9);
- }
- }
- }
- if (File.ReadAllText("scripts\\sa.txt").Contains(player.GUID.ToString()))
- {
- if (MessageTyped == ("!server"))
- {
- Utilities.RawSayAll(GetServerName());
- }
- }
- if (MessageTyped.ToLower().Contains("lunge"))
- if (Countenemies() < 2)
- {
- AfterDelay(100, () =>
- {
- Utilities.RawSayAll("^5[^3WE^5]: ^5Rule #7: ^31st Zombie must kill someone before lunge!");
- });
- }
- if (MessageTyped.Contains("Lunge"))
- if (Countenemies() < 2)
- {
- AfterDelay(100, () =>
- {
- Utilities.RawSayAll("^5[^3WE^5]: ^5Rule #7: ^31st Zombie must kill someone before lunge!");
- });
- if (MessageTyped.Contains("LUNGE"))
- if (Countenemies() < 2)
- {
- AfterDelay(100, () =>
- {
- Utilities.RawSayAll("^5[^3WE^5]: ^5Rule #7: ^31st Zombie must kill someone before lunge!");
- });
- }
- PlayerConnected += new Action<Entity>(pHK =>
- {
- int num = pHK.Call<int>("getentitynumber", new Parameter[0]);
- if (num > 17)
- {
- Utilities.ExecuteCommand("dropclient " + player.Call<int>("getentitynumber") + " NVEN!");
- }
- });
- }
- PlayerConnecting += new Action<Entity>(pHK =>
- {
- int num = pHK.Call<int>("getentitynumber", new Parameter[0]);
- if (num > 17)
- {
- Utilities.ExecuteCommand("dropclient " + player.Call<int>("getentitynumber") + " NVEN!");
- }
- });
- }
- string GetServerName()
- {
- string serverName = "^5[^3WE^5]: ^1";
- string sv = Call<string>("getdvar", "sv_hostname");
- serverName += sv;
- return serverName;
- }
- int Countenemies()
- {
- int enemies = 0;
- foreach (Entity Player in Players)
- {
- if (Player.GetField<string>("sessionteam") == "axis")
- enemies++;
- }
- return enemies;
- }
- public void WESay(Entity player, string name, string MessageTyped)
- {
- Utilities.RawSayAll("^5[^3WE^5]: ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement