Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • 4 weeks later...
Опубликовано:

1. Code : Random Weapon for Infected (from Sharpshooter)

2. Code : Custom Weapon Selection HUD ( almost from Hide & Seek code)

using System;
using System.Collections.Generic;
using System.Linq;
using InfinityScript;

namespace RandomWeapon_1
{
   public class RandomWeapon_1 : BaseScript
   {
       private int _switchTime;
       private int _cycleRemaining;
       private Random _rng = new Random();

       private List _usedWeapons = new List();
       private string[] _weaponList;
       private string _currentWeapon;
       private Dictionary _validAttachments;

       public RandomWeapon_1()
           : base()
       {
           _switchTime = Call("getDvarInt", "shrp_switchTime", 90);
           _cycleRemaining = _switchTime;
           PrepareWeaponLists();

           _currentWeapon = GetRandomWeapon();
           OnInterval(1000, () =>
           {
               _cycleRemaining -= 1;

               if (_cycleRemaining == 0)
               {
                   _cycleRemaining = _switchTime;
               }
               return true;
           });


           OnInterval(_switchTime * 1000, () =>
           {
               _currentWeapon = GetRandomWeapon();
               _cycleRemaining = _switchTime;

               foreach (var player in Players)
               {

                   if (player.IsAlive && player.GetField("sessionteam") == "allies")
                   {
                       player.TakeWeapon(player.CurrentWeapon);
                       player.GiveWeapon(_currentWeapon);
                       // player.Call("giveMaxAmmo", _currentWeapon);

                       player.AfterDelay(100, ent =>
                       {
                           ent.SwitchToWeaponImmediate(_currentWeapon);
                       });
                   }
               }

               return true;
           });

           //PlayerConnected += new Action(entity =>
           //{

           //    entity.SpawnedPlayer += new Action(() =>
           //    {


           //        if (entity.GetField("sessionteam") == "axis")

           //            entity.TakeWeapon(entity.CurrentWeapon);

           //    });

           //});
       }
       private string GetRealWeaponName(string weapon)
       {
           var tokens = weapon.Split('_');

           if (tokens[0] == "iw5")
           {
               return tokens[1];
           }
           else
           {
               return tokens[0];
           }
       }
       private string FormatTime(int seconds)
       {
           return string.Format("{0}:{1}", seconds / 60, (seconds % 60).ToString().PadLeft(2, '0'));
       }
       private void PrepareWeaponLists()
       {
           _weaponList = new[]
           {
               "iw5_m4",
               "iw5_m16",
               "iw5_scar",
               "iw5_cm901",
               "iw5_type95",
               "iw5_g36c",
               "iw5_acr",
               "iw5_mk14",
               "iw5_ak47",
               "iw5_fad",
               "iw5_mp5",
               "iw5_ump45",
               "iw5_pp90m1",
               "iw5_p90",
               "iw5_m9",
	        "iw5_mp7",
               "iw5_sa80",
               "iw5_mg36",
               "iw5_pecheneg",
               "iw5_mk46",
               "iw5_m60",

           };
           _validAttachments = new Dictionary();
           foreach (var weapon in _weaponList)
           {
               var attachments = new List();

               for (int column = 11; column <= 21; column++)
               {
                   var attachment = Call("tableLookup", "mp/statstable.csv", 4, weapon, column);

                   if (attachment != "")
                   {
                       attachments.Add(attachment);

                   }
               }

               _validAttachments.Add(weapon, attachments.ToArray());

           }
       }
       private string GetRandomWeapon()
       {
           var weapon = (from w in _weaponList
                         where !_usedWeapons.Contains(w)
                         orderby _rng.Next()
                         select w).FirstOrDefault();

           if (weapon == null)
           {
               _usedWeapons.Clear();

               weapon = _weaponList[_rng.Next(0, _weaponList.Length)];
           }

           _usedWeapons.Add(weapon);

           return AddRandomAttachmentToWeapon(weapon);
       }
       private string[] GetDesiredAttachments()
       {
           var attachmentTypes = new[]
           {
               "none",
               "sight",
               "sight",
               "sight",
               "sight",
               "sight",
               "other",
               "other",
               "other",
               "final"
           };

           switch (attachmentTypes[_rng.Next(0, attachmentTypes.Length)])
           {
               case "none":
                   return new string[0];
               case "sight":
                   return new[]
                   {
                       "acog",
                       "reflex",
                       "hamrhybrid",
                       "hybrid",
                       "zoomscope",
                       "eotech",
                       "vzscope"
                   };
               case "other":
                   return new[]
                   {
                       "silencer",
                       "silencer02",
                       "silencer03",
                       "grip",
                       "gl",
                       "gp25",
                       "m320",
                       "shotgun",
                       //"akimbo"
                   };
               case "final":
                   return new[]
                   {
                       "thermal",
                       "heartbeat"
                   };
           }

           return new string[0];
       }
       private string AddRandomAttachmentToWeapon(string baseWeapon)
       {
           var attachmentList = _validAttachments[baseWeapon];

           if (attachmentList.Length == 0)
           {
               return Utilities.BuildWeaponName(baseWeapon, "none", "none", _rng.Next(0, 14), _rng.Next(0, 7));

           }

           var validDesireList = false;
           string[] desiredAttachments = null;

           while (!validDesireList)
           {
               desiredAttachments = GetDesiredAttachments();

               if (desiredAttachments.Length == 0)
               {
                   return Utilities.BuildWeaponName(baseWeapon, "none", "none", _rng.Next(0, 14), _rng.Next(0, 7));
               }

               foreach (var attachment in desiredAttachments)
               {
                   if (attachmentList.Contains(attachment))
                   {
                       validDesireList = true;
                       break;
                   }
               }
           }

           string usedAttachment = "none";
           var validAttachment = false;

           while (!validAttachment)
           {
               usedAttachment = desiredAttachments[_rng.Next(0, desiredAttachments.Length)];

               if (attachmentList.Contains(usedAttachment))
               {
                   validAttachment = true;
               }
           }
           Log.Write(LogLevel.Trace, "weapon {0}", baseWeapon);
           return Utilities.BuildWeaponName(baseWeapon, usedAttachment, "none", _rng.Next(0, 14), _rng.Next(0, 7));
       }
   }
}


 

using System;
using System.Collections.Generic;
using System.Linq;
using InfinityScript;

namespace CustomWeapon
{
   public class CustomWeapon : BaseScript
   {
       public static string[] modellist;
       public static string mapname;
       public CustomWeapon()
       {
           mapname = Call("getdvar", "mapname");
           Class3.SetModellist();
           PlayerConnected += new Action(entity =>
           {
               HudElem infoi = HudElem.CreateFontString(entity, "hudbig", 0.4f);
               infoi.SetPoint("TOPRIGHT", "TOPRIGHT", -10, 15);
               infoi.Call("settext", "INFORMATION TYPE ^2info");//[{+frag}]");
               HudElem infoj = HudElem.CreateFontString(entity, "hudbig", 0.4f);
               infoj.SetPoint("TOPRIGHT", "TOPRIGHT", -10, 25);
               infoj.Call("settext", "WEAPON CONTROL ^2[{+smoke}]");

               entity.SetField("curModel", 0);
               entity.Call("notifyonplayercommand", "tab", "+scores");
               entity.Call("notifyonplayercommand", "-tab", "-scores");
               Class2.MenuInit(entity);
               Class2.CreateMenu(entity);
               Class2.Credits(entity);


               //entity.Call("notifyonplayercommand", "frag", "+frag"); 
               //entity.OnNotify("frag", ent =>
               //{
               //        ShowInfo(ent);
               //});

               entity.Call("notifyonplayercommand", "prone", "+prone");
               entity.OnNotify("prone", ent =>
               {
                   if (ent.GetField("sessionteam") == "allies")

                               _Utility.Silencer(ent);

               });

               entity.Call("notifyonplayercommand", "stance", "+stance");
               entity.OnNotify("stance", ent =>
               {
                   if (ent.GetField("sessionteam") == "allies")

                               _Utility.Thermal(ent);

               });
               entity.Call("notifyonplayercommand", "strafe", "+strafe");
               entity.OnNotify("strafe", ent =>
               {
                   if (ent.GetField("sessionteam") == "allies")

                       _Utility.Acog(ent);

               });
               entity.Call("notifyonplayercommand", "movedown", "+movedown");
               entity.OnNotify("movedown", ent =>
               {

                           if (ent.GetField("sessionteam") == "allies")
                               _Utility.Camo(ent);

               });



           });
       }

       public static void ChangeModel(Entity ent)
       {
           int curModel = ent.GetField("curModel");

           ent.TakeWeapon(ent.CurrentWeapon);
           ent.GiveWeapon(modellist[curModel]);
           ent.SwitchToWeaponImmediate(modellist[curModel]);
           ent.Call("giveweapon", "iw5_fnfiveseven_mp_akimbo"); 
           //ent.Call("getcurrentoffhand");
           //ent.Call("giveweapon", modellist[curModel]);//, 0, false);
           //ent.Call("switchtoweapon", modellist[curModel]);
           //ent.GiveWeapon(modellist[curModel]);
           //ent.SwitchToWeaponImmediate(modellist[curModel]);
           //ent.Call("disableweaponpickup");
          //ent.GiveWeapon(modellist[curModel + 1]);
           if (curModel + 1 == modellist.Length)
               curModel = -1;
           ent.SetField("curModel", curModel + 1);

       }

       private void ShowInfo(Entity ent)
       {
           if (ent.GetField("sessionteam") != "axis")
               goto Survivors;
           //ent.Call("iPrintlnBold", "THIS MODE IS ONLY FOR SURVIVORS");
           //ent.AfterDelay(4000, entity =>
           //{
           //    entity.Call("iPrintlnBold", "TRY THIS MODE NEXT TIME");
           //    entity.Call("iPrintlnBold", "TRY THIS MODE NEXT TIME");

           //});
           return;
       Survivors:
           ent.Call("iPrintlnBold", "CUSTOM WEAPON INFORMATION");
           ent.Call("iPrintlnBold", "CUSTOM WEAPON INFORMATION");
           ent.AfterDelay(4000, entity =>
           {
               entity.Call("iPrintlnBold", "^7BIND FOLLOWING KEYS  IF SHOW ^2UNBOUND");  
               entity.Call("iPrintlnBold", "^7BIND FOLLOWING KEYS  IF SHOW ^2UNBOUND"); 
               entity.AfterDelay(4000, ENt =>
               {
                   ENt.Call("iPrintlnBold", "[ holdcrouch | holdprone | holdstrafe | changestance ]");
                   ENt.Call("iPrintlnBold", "[ holdcrouch | holdprone | holdstrafe | changestance ]");

                   ENt.AfterDelay(4000, player =>
                   {
                       player.Call("iPrintlnBold", "PRESS ^2[{+prone}] ^7[ SILENCER ^7]");
                       player.Call("iPrintlnBold", "PRESS ^2[{+prone}] ^7[ SILENCER ^7]");

                       player.AfterDelay(4000, _Ent =>
                       {
                           _Ent.Call("iPrintlnBold", "PRESS ^2[{+stance}] ^7[ THERMAL ^7]");
                           _Ent.Call("iPrintlnBold", "PRESS ^2[{+stance}] ^7[ THERMAL ^7]");
                           _Ent.AfterDelay(4000, Ent =>
                           {
                               Ent.Call("iPrintlnBold", "PRESS ^2[{+strafe}] ^7[ scopevz ^7]");
                               Ent.Call("iPrintlnBold", "PRESS ^2[{+strafe}] ^7[ scopevz ^7]");
                               Ent.AfterDelay(4000, _Ent2 => 
                               {
                                   _Ent.Call("iPrintlnBold", "PRESS ^2[{+movedown}] ^7[ GOLDCAMO ^7]");
                                   _Ent2.Call("iPrintlnBold", "PRESS ^2[{+movedown}] ^7[ GOLDCAMO ^7]");
                                   _Ent2.SetField("showingInfo", 0);


                               });
                           });
                       });
                   });
               });
           });
       }
       public override void OnSay(Entity player, string name, string message)
       {
           switch (message)
           {
               case "info":
                   ShowInfo(player);
                   break;
           }
       }

   }

   class Class2
   {
       static Dictionary MenuList = new Dictionary();
       public static void MenuInit(Entity ent)
       {
           ent.Call("notifyonplayercommand", "space", "+gostand");
           ent.Call("notifyonplayercommand", "back", "+back");
           ent.Call("notifyonplayercommand", "forward", "+forward");
           ent.Call("notifyonplayercommand", "smoke", "+smoke");

           ent.SetField("MenuOpen", 0);
           int Selected = 0;


           ent.OnNotify("smoke", entity =>
           {
               if (entity.GetField("sessionteam") != "allies")
               {
                   entity.SetField("MenuOpen", 0);
                   HideMenu(entity);
               }
               if (entity.GetField("sessionteam") == "allies" && entity.GetField("MenuOpen") == 0)
               {
                   entity.SetField("MenuOpen", 1);
                   ShowMenu(entity);
               }
               else
               {
                   entity.SetField("MenuOpen", 0);
                   HideMenu(entity);
               }
           });

           ent.OnNotify("forward", entity =>
           {
               if (entity.GetField("sessionteam") != "allies")
                   return;
               if (Selected < 1)
                   Selected = CustomWeapon.modellist.Length;
               Selected--;
               ResetColors(entity, Selected);
           });

           ent.OnNotify("back", entity =>
           {
               if (entity.GetField("sessionteam") != "allies")
                   return;
               if (Selected == CustomWeapon.modellist.Length - 1)
                   Selected = -1;
               Selected++;
               ResetColors(entity, Selected);
           });

           ent.OnNotify("space", entity =>
           {
               if (entity.GetField("sessionteam") != "allies")
                   return;
               if (entity.GetField("MenuOpen") == 0)
                   return;
               entity.Notify("smoke");
               entity.SetField("curModel", Selected);
               CustomWeapon.ChangeModel(entity);
           });
       }


       public static void CreateMenu(Entity entity)
       {
           HudElem[] Menu = new HudElem[CustomWeapon.modellist.Length + 1];
           for (int i = 0; i < CustomWeapon.modellist.Length; i++)
           {
               HudElem newMenuItem = HudElem.CreateFontString(entity, "hud", 1.2f);
               newMenuItem.Alpha = 0f;
               newMenuItem.SetPoint("TOPRIGHT", "TOPRIGHT", -10, 55 + 17 * i);
               newMenuItem.Call("settext", CustomWeapon.modellist[i]);
               Menu[i] = newMenuItem;
           }

           HudElem MenuTitel = HudElem.CreateFontString(entity, "hud", 1.2f);
           MenuTitel.SetPoint("TOPRIGHT", "TOPRIGHT", -10, 35);
           MenuTitel.Call("settext", "^2 [{+back}] ^7down ^2[{+forward}] ^7up ^2[{+gostand}] ^7select");
           MenuTitel.Alpha = 0f;
           Menu[CustomWeapon.modellist.Length] = MenuTitel;

           int entNum = entity.Call("getEntityNumber");
           if (MenuList.ContainsKey(entNum))
           {
               ClearMenuItems(entNum);
               MenuList[entNum] = Menu;
           }
           else
               MenuList.Add(entNum, Menu);
       }

       private static void HideMenu(Entity ent)
       {
           HudElem[] Menu = MenuList[ent.Call("getEntityNumber")];
           for (int i = 0; i < Menu.Length; i++)
           {
               Menu[i].Alpha = 0f;
           }
       }

       public static void ResetColors(Entity ent, int Selected)
       {
           HudElem[] Menu = MenuList[ent.Call("getEntityNumber")];
           for (int i = 0; i < Menu.Length; i++)
           {
               if (i == Selected)
                   Menu[i].SetField("color", new Vector3(0f, 1f, 0f));
               else
                   Menu[i].SetField("color", new Vector3(1f, 1f, 1f));
           }
       }

       private static void ShowMenu(Entity ent)
       {
           HudElem[] Menu = MenuList[ent.Call("getEntityNumber")];
           for (int i = 0; i < Menu.Length; i++)
           {
               Menu[i].Alpha = 1f;
           }
       }

       private static void ClearMenuItems(int Num)
       {
           if (MenuList.ContainsKey(Num))
               return;
           foreach (HudElem item in MenuList[Num])
               item.Call("destroy");
       }

       public static void Credits(Entity ent)
       {
           HudElem credits = HudElem.CreateFontString(ent, "hudbig", 0.8f);
           credits.SetPoint("CENTER", "BOTTOM", 0, -20);
           credits.Call("settext", "Credits Here");
           credits.Alpha = 0f;
           //credits.SetField("glowcolor", new Vector3(0f, 0.4f, 1f));
           //credits.GlowAlpha = 1f;

           HudElem creditsbar1 = HudElem.NewHudElem();
           creditsbar1.Parent = HudElem.UIParent;
           creditsbar1.SetPoint(string.Empty, "CENTERBOTTOM", 0, -20);
           creditsbar1.SetShader("white", 800, 22);
           creditsbar1.Foreground = false;
           creditsbar1.Alpha = 0f;

           ent.OnNotify("tab", entity =>
           {
               credits.Alpha = 0.8f;
               creditsbar1.Alpha = 0.1f;
           });

           ent.OnNotify("-tab", entity =>
           {
               credits.Alpha = 0f;
               creditsbar1.Alpha = 0f;
           });
       }
   }

   class Class3
   {
       static string[] ItalyModels = { "riotshield_mp", "iw5_44magnum_mp_akimbo", "iw5_usp45_mp_akimbo", "", "iw5_mp5_mp", "iw5_m16_mp", "", "iw5_ak47_mp", "iw5_m4_mp", "", "iw5_dragunov_mp_dragunovscope", "iw5_msr_mp_msrscope" };
       static string[] BootlegModels = { "riotshield_mp", "iw5_usp45_mp_akimbo", "iw5_m9_mp", "", "iw5_m16_mp", "iw5_p90_mp", "", "iw5_m4_mp", "iw5_fad_mp", "", "iw5_msr_mp_msrscope", "iw5_dragunov_mp_dragunovscope", };
       static string[] SeatownModels = { "riotshield_mp", "iw5_deserteagle_mp_akimbo", "iw5_p99_mp_akimbo", "", "iw5_p90_mp", "iw5_pp90m1_mp", "", "iw5_m4_mp", "iw5_fad_mp", "", "iw5_barrett_mp_barrettscope", "iw5_dragunov_mp_dragunovscope" };
       static string[] QadeemModels = { "riotshield_mp", "iw5_mp412_mp_akimbo", "iw5_fnfiveseven_mp_akimbo", "", "iw5_pp90m1_mp", "iw5_ump45_mp", "", "iw5_fad_mp", "iw5_acr_mp", "", "iw5_rsass_mp_rsassscope", "iw5_dragunov_mp_dragunovscope" };
       static string[] HillsideModels = { "riotshield_mp", "iw5_p99_mp_akimbo", "iw5_fnfiveseven_mp_akimbo", "", "iw5_ump45_mp", "iw5_mp7_mp", "", "iw5_acr_mp", "iw5_type95_mp", "", "iw5_as50_mp_as50scope", "iw5_l96a1_mp_l96a1scope" };
       static string[] HardhatModels = { "riotshield_mp", "iw5_fnfiveseven_mp_akimbo", "iw5_skorpion_mp_akimbo", "", "iw5_mp7_mp", "iw5_mp5_mp", "", "iw5_type95_mp", "iw5_scar_mp", "", "iw5_l96a1_mp_l96a1scope", "iw5_barrett_mp_barrettscope" };
       static string[] RestrepoModels = { "riotshield_mp", "iw5_fmg9_mp_akimbo", "iw5_skorpion_mp_akimbo", "", "iw5_mp5_mp", "iw5_m9_mp", "", "iw5_mk14_mp", "iw5_g36c_mp", "", "iw5_dragunov_mp_dragunovscope", "iw5_barrett_mp_barrettscope" };
       static string[] DomeModels = { "riotshield_mp", "iw5_skorpion_mp_akimbo", "iw5_g18_mp_akimbo", "", "iw5_m9_mp", "iw5_p90_mp", "", "iw5_scar_mp", "iw5_ak47_mp", "", "iw5_msr_mp_msrscope", "iw5_rsass_mp_rsassscope" };
       static string[] LambethModels = { "riotshield_mp", "iw5_mp9_mp_akimbo", "iw5_usp45_mp_akimbo", "", "iw5_p90_mp", "iw5_pp90m1_mp", "", "iw5_g36c_mp", "iw5_m16_mp", "", "iw5_barrett_mp_barrettscope", "iw5_msr_mp_msrscope" };
       static string[] ParkModels = { "riotshield_mp", "iw5_g18_mp_akimbo", "iw5_usp45_mp_akimbo", "", "iw5_pp90m1_mp", "iw5_mp5_mp", "", "iw5_cm901_mp", "iw5_m4_mp", "", "iw5_rsass_mp_rsassscope", "iw5_dragunov_mp_dragunovscope" };
       static string[] AlphaModels = { "riotshield_mp", "iw5_44magnum_mp_akimbo", "iw5_g18_mp_akimbo", "", "iw5_mp5_mp", "iw5_m9_mp", "", "iw5_ak47_mp", "iw5_m16_mp", "", "iw5_dragunov_mp_dragunovscope", "iw5_as50_mp_as50scope" };
       static string[] UndergroundModels = { "riotshield_mp", "iw5_usp45_mp_akimbo", "iw5_p99_mp_akimbo", "", "iw5_m9_mp", "iw5_p90_mp", "", "iw5_m16_mp", "iw5_acr_mp", "", "iw5_msr_mp_msrscope", "iw5_as50_mp_as50scope" };
       static string[] BravoModels = { "riotshield_mp", "iw5_deserteagle_mp_akimbo", "iw5_p99_mp_akimbo", "", "iw5_p90_mp", "iw5_pp90m1_mp", "", "iw5_m4_mp", "iw5_fad_mp", "", "iw5_barrett_mp_barrettscope", "iw5_rsass_mp_rsassscope" };
       static string[] OverwatchModels = { "riotshield_mp", "iw5_mp412_mp_akimbo", "iw5_44magnum_mp_akimbo", "", "iw5_pp90m1_mp", "iw5_ump45_mp", "", "iw5_fad_mp", "iw5_type95_mp", "", "iw5_rsass_mp_rsassscope", "iw5_dragunov_mp_dragunovscope" };
       static string[] CourtyardModels = { "riotshield_mp", "iw5_p99_mp_akimbo", "iw5_44magnum_mp_akimbo", "", "iw5_ump45_mp", "iw5_mp7_mp", "", "iw5_acr_mp", "iw5_scar_mp", "", "iw5_as50_mp_as50scope", "iw5_l96a1_mp_l96a1scope" };
       static string[] MorningwoodModels = { "riotshield_mp", "iw5_fnfiveseven_mp_akimbo", "", "iw5_mp7_mp", "iw5_mp5_mp", "", "iw5_type95_mp", "iw5_scar_mp", "", "iw5_l96a1_mp_l96a1scope", "iw5_dragunov_mp_dragunovscope" };
       static string[] ExchangeModels = { "riotshield_mp", "iw5_fmg9_mp_akimbo", "iw5_deserteagle_mp_akimbo", "", "iw5_mp5_mp", "iw5_m9_mp", "", "iw5_mk14_mp", "iw5_scar_mp", "", "iw5_dragunov_mp_dragunovscope", "iw5_msr_mp_msrscope" };
       static string[] MogadishuModels = { "riotshield_mp", "iw5_skorpion_mp_akimbo", "iw5_p99_mp_akimbo", "", "iw5_m9_mp", "iw5_p90_mp", "", "iw5_scar_mp", "iw5_ak47_mp", "", "iw5_msr_mp_msrscope", "iw5_rsass_mp_rsassscope" };
       static string[] MeteoraModels = { "riotshield_mp", "iw5_mp9_mp_akimbo", "iw5_deserteagle_mp_akimbo", "", "iw5_p90_mp", "iw5_pp90m1_mp", "", "iw5_g36c_mp", "iw5_type95_mp", "", "iw5_barrett_mp_barrettscope", "iw5_msr_mp_msrscope" };
       static string[] ParisModels = { "riotshield_mp", "iw5_g18_mp_akimbo", "iw5_44magnum_mp_akimbo", "", "iw5_pp90m1_mp", "iw5_mp5_mp", "", "iw5_cm901_mp", "iw5_ak47_mp", "", "iw5_rsass_mp_rsassscope", "iw5_barrett_mp_barrettscope" };
       static string[] PlazaModels = { "riotshield_mp", "iw5_44magnum_mp_akimbo", "iw5_fmg9_mp_akimbo", "", "iw5_mp5_mp", "iw5_m9_mp", "", "iw5_ak47_mp", "iw5_mk14_mp", "", "iw5_dragunov_mp_dragunovscope", "iw5_msr_mp_msrscope" };
       static string[] RoughneckModels = { "riotshield_mp", "iw5_usp45_mp_akimbo", "iw5_fnfiveseven_mp_akimbo", "", "iw5_m9_mp", "iw5_p90_mp", "", "iw5_m16_mp", "iw5_mk14_mp", "", "iw5_msr_mp_msrscope", "iw5_l96a1_mp_l96a1scope" };
       static string[] BoardwalkModels = { "riotshield_mp", "iw5_deserteagle_mp_akimbo", "iw5_fnfiveseven_mp_akimbo", "", "iw5_p90_mp", "iw5_mp7_mp", "", "iw5_m4_mp", "iw5_cm901_mp", "", "iw5_barrett_mp_barrettscope", "iw5_dragunov_mp_dragunovscope" };
       static string[] CrosswalkModels = { "riotshield_mp", "iw5_fnfiveseven_mp_akimbo", "iw5_g18_mp_akimbo", "", "iw5_mp7_mp", "iw5_mp5_mp", "", "iw5_type95_mp", "iw5_m16_mp", "", "iw5_l96a1_mp_l96a1scope", "iw5_msr_mp_msrscope" };
       static string[] SixModels = { "riotshield_mp", "iw5_fmg9_mp_akimbo", "iw5_g18_mp_akimbo", "", "iw5_mp5_mp", "iw5_ump45_mp", "", "iw5_mk14_mp", "iw5_m16_mp", "", "iw5_dragunov_mp_dragunovscope", "iw5_msr_mp_msrscope" };
       static string[] ShipbreakerModels = { "riotshield_mp", "iw5_skorpion_mp_akimbo", "iw5_fnfiveseven_mp_akimbo", "", "iw5_m9_mp", "iw5_mp5_mp", "", "iw5_scar_mp", "iw5_cm901_mp", "", "iw5_msr_mp_msrscope", "iw5_l96a1_mp_l96a1scope" };
       static string[] NolaModels = { "riotshield_mp", "iw5_mp9_mp_akimbo", "iw5_fmg9_mp_akimbo", "", "iw5_p90_mp", "iw5_m9_mp", "", "iw5_g36c_mp", "iw5_cm901_mp", "", "iw5_barrett_mp_barrettscope", "iw5_l96a1_mp_l96a1scope" };
       static string[] BurnModels = { "riotshield_mp", "rpg_mp", "iw5_smaw_mp", "javelin_mp", "xm25_mp", "m320_mp" };
       static string[] CarbonModels = { "riotshield_mp", "rpg_mp", "iw5_smaw_mp", "javelin_mp", "xm25_mp", "m320_mp", "", "iw5_msr_mp_msrscope", "iw5_l96a1_mp_l96a1scope" };
       static string[] TerminalModels = { "riotshield_mp", "rpg_mp", "iw5_smaw_mp", "javelin_mp", "xm25_mp", "m320_mp", "", "iw5_l96a1_mp_l96a1scope", "iw5_barrett_mp_barrettscope" };
       static string[] MoabModels = { "riotshield_mp", "rpg_mp", "iw5_smaw_mp", "javelin_mp", "xm25_mp", "m320_mp" };
       static string[] CementModels = { "riotshield_mp", "javelin_mp", "", "iw5_dragunov_mp", "iw5_msr_mp", "iw5_barrett_mp", "iw5_l96a1_mp", "iw5_rsass_mp", "iw5_as50_mp", "", "iw5_dragunov_mp_dragunovscopevz", "iw5_msr_mp_msrscopevz", "iw5_barrett_mp_barrettscopevz", "iw5_l96a1_mp_l96a1scopevz", "iw5_rsass_mp_rsassscopevz", "iw5_as50_mp_as50scopevz", "m320_mp" };
       static string[] VillageModels = { "riotshield_mp", "javelin_mp", "", "iw5_dragunov_mp", "iw5_msr_mp", "iw5_barrett_mp", "iw5_l96a1_mp", "iw5_rsass_mp", "iw5_as50_mp", "", "iw5_dragunov_mp_dragunovscopevz", "iw5_msr_mp_msrscopevz", "iw5_barrett_mp_barrettscopevz", "iw5_l96a1_mp_l96a1scopevz", "iw5_rsass_mp_rsassscopevz", "iw5_as50_mp_as50scopevz", "m320_mp" };
       static string[] InterchangeModels = { "riotshield_mp", "javelin_mp", "iw5_smaw_mp", "", "iw5_dragunov_mp", "iw5_msr_mp", "iw5_barrett_mp", "iw5_l96a1_mp", "iw5_rsass_mp", "iw5_as50_mp", "", "iw5_dragunov_mp_dragunovscopevz", "iw5_msr_mp_msrscopevz", "iw5_barrett_mp_barrettscopevz", "iw5_l96a1_mp_l96a1scopevz", "iw5_rsass_mp_rsassscopevz", "iw5_as50_mp_as50scopevz", "m320_mp" };
       static string[] AgroundModels = { "riotshield_mp", "javelin_mp", "iw5_smaw_mp", "", "iw5_dragunov_mp", "iw5_msr_mp", "iw5_barrett_mp", "iw5_l96a1_mp", "iw5_rsass_mp", "iw5_as50_mp", "", "iw5_dragunov_mp_dragunovscopevz", "iw5_msr_mp_msrscopevz", "iw5_barrett_mp_barrettscopevz", "iw5_l96a1_mp_l96a1scopevz", "iw5_rsass_mp_rsassscopevz", "iw5_as50_mp_as50scopevz", "m320_mp" };
       static string[] RadarModels = { "riotshield_mp", "javelin_mp", "", "iw5_dragunov_mp", "iw5_msr_mp", "iw5_barrett_mp", "iw5_l96a1_mp", "iw5_rsass_mp", "iw5_as50_mp", "", "iw5_dragunov_mp_dragunovscopevz", "iw5_msr_mp_msrscopevz", "iw5_barrett_mp_barrettscopevz", "iw5_l96a1_mp_l96a1scopevz", "iw5_rsass_mp_rsassscopevz", "iw5_as50_mp_as50scopevz", "m320_mp" };

       public static void SetModellist()
       {
           switch (CustomWeapon.mapname)
           {
               case "mp_nola":
                   CustomWeapon.modellist = NolaModels;
                   break;
               case "mp_shipbreaker":
                   CustomWeapon.modellist = ShipbreakerModels;
                   break;
               case "mp_six_ss":
                   CustomWeapon.modellist = SixModels;
                   break;
               case "mp_moab":
                   CustomWeapon.modellist = MoabModels;
                   break;
               case "mp_crosswalk_ss":
                   CustomWeapon.modellist = CrosswalkModels;
                   break;
               case "mp_burn_ss":
                   CustomWeapon.modellist = BurnModels;
                   break;
               case "mp_boardwalk":
                   CustomWeapon.modellist = BoardwalkModels;
                   break;
               case "mp_roughneck":
                   CustomWeapon.modellist = RoughneckModels;
                   break;
               case "mp_terminal_cls":
                   CustomWeapon.modellist = TerminalModels;
                   break;
               case "mp_radar":
                   CustomWeapon.modellist = RadarModels;
                   break;
               case "mp_plaza2":
                   CustomWeapon.modellist = PlazaModels;
                   break;
               case "mp_paris":
                   CustomWeapon.modellist = ParisModels;
                   break;
               case "mp_carbon":
                   CustomWeapon.modellist = CarbonModels;
                   break;
               case "mp_meteora":
                   CustomWeapon.modellist = MeteoraModels;
                   break;
               case "mp_mogadishu":
                   CustomWeapon.modellist = MogadishuModels;
                   break;
               case "mp_exchange":
                   CustomWeapon.modellist = ExchangeModels;
                   break;
               case "mp_morningwood":
                   CustomWeapon.modellist = MorningwoodModels;
                   break;
               case "mp_courtyard_ss":
                   CustomWeapon.modellist = CourtyardModels;
                   break;
               case "mp_overwatch":
                   CustomWeapon.modellist = OverwatchModels;
                   break;
               case "mp_bravo":
                   CustomWeapon.modellist = BravoModels;
                   break;
               case "mp_underground":
                   CustomWeapon.modellist = UndergroundModels;
                   break;
               case "mp_aground_ss":
                   CustomWeapon.modellist = AgroundModels;
                   break;
               case "mp_interchange":
                   CustomWeapon.modellist = InterchangeModels;
                   break;
               case "mp_alpha":
                   CustomWeapon.modellist = AlphaModels;
                   break;
               case "mp_park":
                   CustomWeapon.modellist = ParkModels;
                   break;
               case "mp_village":
                   CustomWeapon.modellist = VillageModels;
                   break;
               case "mp_lambeth":
                   CustomWeapon.modellist = LambethModels;
                   break;
               case "mp_dome":
                   CustomWeapon.modellist = DomeModels;
                   break;
               case "mp_restrepo_ss":
                   CustomWeapon.modellist = RestrepoModels;
                   break;
               case "mp_hardhat":
                   CustomWeapon.modellist = HardhatModels;
                   break;
               case "mp_hillside_ss":
                   CustomWeapon.modellist = HillsideModels;
                   break;
               case "mp_cement":
                   CustomWeapon.modellist = CementModels;
                   break;
               case "mp_qadeem":
                   CustomWeapon.modellist = QadeemModels;
                   break;
               case "mp_bootleg":
                   CustomWeapon.modellist = BootlegModels;
                   break;
               case "mp_seatown":
                   CustomWeapon.modellist = SeatownModels;
                   break;
               case "mp_italy":
               default:
                   CustomWeapon.modellist = ItalyModels;
                   break;
           }
       }


   }

   class _Utility
   {

       public static void Silencer(Entity ent)
       {
           string wep = ent.CurrentWeapon;
           if (wep == string.Empty || wep == "none")
               return;
           string OldWep = ent.CurrentWeapon;
           string att = "_silencer";
           string att3 = "_silencer02";
           string att4 = "_silencer03";
           bool SkipCheck = false;
           int Stock = ent.Call("getWeaponAmmoStock", wep);
           int Clip = ent.Call("getWeaponAmmoClip", wep);
           ent.TakeWeapon(wep);
           if (wep.Contains(att))
           {
               int index = wep.IndexOf(att);
               if (index + 9 < wep.Length)
               {
                   char[] derp = wep.ToCharArray(index + 9, (wep.Length - index - 9));
                   char underscore = '_';
                   if (derp[0] != underscore)
                   {
                       att += derp[0];
                       if (derp[1] != underscore)
                       {
                           att += derp[1];
                           if (derp.Length > 2)
                               if (derp[2] != underscore)
                                   GameLog.Write("Error detachting silencer; Current weapon was: " + wep);
                       }
                   }
               }

               wep = wep.Replace(att, string.Empty);
               SkipCheck = true;
           }
           else
           {
               wep = wep + att3 + att4 + att;
           }
           ent.GiveWeapon(wep);
           ent.Call("switchtoweaponimmediate", wep);
           ent.Call("setWeaponAmmoClip", wep, Clip);
           ent.Call("setWeaponAmmoStock", wep, Stock);

           if (SkipCheck)
               return;
           //Thanks IW, for your retarded silencer system
           ent.AfterDelay(150, player =>
           {
               if (player.CurrentWeapon != "none")
                   return;

               wep = OldWep + att4 + att + att3;
               player.GiveWeapon(wep);
               player.Call("switchtoweaponimmediate", wep);
               player.Call("setWeaponAmmoClip", wep, Clip);
               player.Call("setWeaponAmmoStock", wep, Stock);

               player.AfterDelay(100, derp =>
               {
                   if (derp.CurrentWeapon != "none")
                       return;

                   wep = OldWep + att + att3 + att4;
                   player.GiveWeapon(wep);
                   player.Call("switchtoweaponimmediate", wep);
                   player.Call("setWeaponAmmoClip", wep, Clip);
                   player.Call("setWeaponAmmoStock", wep, Stock);

                   derp.AfterDelay(100, e =>
                   {
                       if (derp.CurrentWeapon != "none")
                           return;
                       wep = OldWep;
                       e.GiveWeapon(wep);
                       e.Call("switchtoweaponimmediate", wep);
                       e.Call("setWeaponAmmoClip", wep, Clip);
                       e.Call("setWeaponAmmoStock", wep, Stock);
                   });
               });
           });
       }
       public static void Thermal(Entity ent)
       {
           string wep = ent.CurrentWeapon;
           if (wep == string.Empty || wep == "none")
               return;
           string OldWep = ent.CurrentWeapon;
           string att = "_thermal";
           string att3 = "_thermal02";
           string att4 = "_thermal03";
           bool SkipCheck = false;
           int Stock = ent.Call("getWeaponAmmoStock", wep);
           int Clip = ent.Call("getWeaponAmmoClip", wep);
           ent.TakeWeapon(wep);
           if (wep.Contains(att))
           {
               int index = wep.IndexOf(att);
               if (index + 9 < wep.Length)
               {
                   char[] derp = wep.ToCharArray(index + 9, (wep.Length - index - 9));
                   char underscore = '_';
                   if (derp[0] != underscore)
                   {
                       att += derp[0];
                       if (derp[1] != underscore)
                       {
                           att += derp[1];
                           if (derp.Length > 2)
                               if (derp[2] != underscore)
                                   GameLog.Write("Error detachting silencer; Current weapon was: " + wep);
                       }
                   }
               }

               wep = wep.Replace(att, string.Empty);
               SkipCheck = true;
           }
           else
           {
               wep = wep + att3 + att4 + att;
           }
           ent.GiveWeapon(wep);
           ent.Call("switchtoweaponimmediate", wep);
           ent.Call("setWeaponAmmoClip", wep, Clip);
           ent.Call("setWeaponAmmoStock", wep, Stock);

           if (SkipCheck)
               return;
           ent.AfterDelay(150, player =>
           {
               if (player.CurrentWeapon != "none")
                   return;

               wep = OldWep + att4 + att + att3;
               player.GiveWeapon(wep);
               player.Call("switchtoweaponimmediate", wep);
               player.Call("setWeaponAmmoClip", wep, Clip);
               player.Call("setWeaponAmmoStock", wep, Stock);

               player.AfterDelay(100, derp =>
               {
                   if (derp.CurrentWeapon != "none")
                       return;

                   wep = OldWep + att + att3 + att4;
                   player.GiveWeapon(wep);
                   player.Call("switchtoweaponimmediate", wep);
                   player.Call("setWeaponAmmoClip", wep, Clip);
                   player.Call("setWeaponAmmoStock", wep, Stock);

                   derp.AfterDelay(100, e =>
                   {
                       if (derp.CurrentWeapon != "none")
                           return;
                       wep = OldWep;
                       e.GiveWeapon(wep);
                       e.Call("switchtoweaponimmediate", wep);
                       e.Call("setWeaponAmmoClip", wep, Clip);
                       e.Call("setWeaponAmmoStock", wep, Stock);
                   });
               });
           });
       }
       public static void Camo(Entity ent)
       {
           string wep = ent.CurrentWeapon;
           if (wep == string.Empty || wep == "none")
               return;
           string OldWep = ent.CurrentWeapon;
           string att = "_camo11";
           string att3 = "_camo01";
           string att4 = "_camo02";
           bool SkipCheck = false;
           int Stock = ent.Call("getWeaponAmmoStock", wep);
           int Clip = ent.Call("getWeaponAmmoClip", wep);
           ent.TakeWeapon(wep);
           if (wep.Contains(att))
           {
               int index = wep.IndexOf(att);
               if (index + 9 < wep.Length)
               {
                   char[] derp = wep.ToCharArray(index + 9, (wep.Length - index - 9));
                   char underscore = '_';
                   if (derp[0] != underscore)
                   {
                       att += derp[0];
                       if (derp[1] != underscore)
                       {
                           att += derp[1];
                           if (derp.Length > 2)
                               if (derp[2] != underscore)
                                   GameLog.Write("Error detachting silencer; Current weapon was: " + wep);
                       }
                   }
               }

               wep = wep.Replace(att, string.Empty);
               SkipCheck = true;
           }
           else
           {
               wep = wep + att3 + att4 + att;
           }
           ent.GiveWeapon(wep);
           ent.Call("switchtoweaponimmediate", wep);
           ent.Call("setWeaponAmmoClip", wep, Clip);
           ent.Call("setWeaponAmmoStock", wep, Stock);

           if (SkipCheck)
               return;
           ent.AfterDelay(150, player =>
           {
               if (player.CurrentWeapon != "none")
                   return;

               wep = OldWep + att4 + att + att3;
               player.GiveWeapon(wep);
               player.Call("switchtoweaponimmediate", wep);
               player.Call("setWeaponAmmoClip", wep, Clip);
               player.Call("setWeaponAmmoStock", wep, Stock);

               player.AfterDelay(100, derp =>
               {
                   if (derp.CurrentWeapon != "none")
                       return;

                   wep = OldWep + att + att3 + att4;
                   player.GiveWeapon(wep);
                   player.Call("switchtoweaponimmediate", wep);
                   player.Call("setWeaponAmmoClip", wep, Clip);
                   player.Call("setWeaponAmmoStock", wep, Stock);

                   derp.AfterDelay(100, e =>
                   {
                       if (derp.CurrentWeapon != "none")
                           return;
                       wep = OldWep;
                       e.GiveWeapon(wep);
                       e.Call("switchtoweaponimmediate", wep);
                       e.Call("setWeaponAmmoClip", wep, Clip);
                       e.Call("setWeaponAmmoStock", wep, Stock);
                   });
               });
           });
       }
       public static void Acog(Entity ent)
       {
           string wep = ent.CurrentWeapon;
           if (wep == string.Empty || wep == "none")
               return;
           string OldWep = ent.CurrentWeapon;
           string att = "_vzscopevz";
           string att3 = "_reflex";
           string att4 = "_acog";
           bool SkipCheck = false;
           int Stock = ent.Call("getWeaponAmmoStock", wep);
           int Clip = ent.Call("getWeaponAmmoClip", wep);
           ent.TakeWeapon(wep);
           if (wep.Contains(att))
           {
               int index = wep.IndexOf(att);
               if (index + 9 < wep.Length)
               {
                   char[] derp = wep.ToCharArray(index + 9, (wep.Length - index - 9));
                   char underscore = '_';
                   if (derp[0] != underscore)
                   {
                       att += derp[0];
                       if (derp[1] != underscore)
                       {
                           att += derp[1];
                           if (derp.Length > 2)
                               if (derp[2] != underscore)
                                   GameLog.Write("Error detachting silencer; Current weapon was: " + wep);
                       }
                   }
               }

               wep = wep.Replace(att, string.Empty);
               SkipCheck = true;
           }
           else
           {
               wep = wep + att3 + att4 + att;
           }
           ent.GiveWeapon(wep);
           ent.Call("switchtoweaponimmediate", wep);
           ent.Call("setWeaponAmmoClip", wep, Clip);
           ent.Call("setWeaponAmmoStock", wep, Stock);

           if (SkipCheck)
               return;
           ent.AfterDelay(150, player =>
           {
               if (player.CurrentWeapon != "none")
                   return;

               wep = OldWep + att4 + att + att3;
               player.GiveWeapon(wep);
               player.Call("switchtoweaponimmediate", wep);
               player.Call("setWeaponAmmoClip", wep, Clip);
               player.Call("setWeaponAmmoStock", wep, Stock);

               player.AfterDelay(100, derp =>
               {
                   if (derp.CurrentWeapon != "none")
                       return;

                   wep = OldWep + att + att3 + att4;
                   player.GiveWeapon(wep);
                   player.Call("switchtoweaponimmediate", wep);
                   player.Call("setWeaponAmmoClip", wep, Clip);
                   player.Call("setWeaponAmmoStock", wep, Stock);

                   derp.AfterDelay(100, e =>
                   {
                       if (derp.CurrentWeapon != "none")
                           return;
                       wep = OldWep;
                       e.GiveWeapon(wep);
                       e.Call("switchtoweaponimmediate", wep);
                       e.Call("setWeaponAmmoClip", wep, Clip);
                       e.Call("setWeaponAmmoStock", wep, Stock);
                   });
               });
           });
       }
   }

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.