Example #1
0
 public void OnStart(WarheadStartEvent ev)
 {
     if (Dump.PlayerLock.Contains(ev.Player.UserId))
     {
         ev.Allow = false;
     }
 }
Example #2
0
 public void OnWarheadStart(WarheadStartEvent ev)
 {
     if (!IsAutoWarheadStart)
     {
         Expansions.Broadcast(Configs.BroadcastTime, Configs.WarheadStart);
     }
 }
Example #3
0
 public void OnStartCountdown(WarheadStartEvent ev)
 {
     if (plugin.Active)
     {
         ev.OpenDoorsAfter = false;
     }
 }
Example #4
0
        public void OnStartCountdown(WarheadStartEvent ev)
        {
            if (cm.GetBoolValue("rank_enabled", true))
            {
                DBConnection db = new DBConnection(main);

                switch (ev.Activator.TeamRole.Team)
                {
                case Smod2.API.Team.CLASSD:
                    db.AddPoint(ev.Activator.SteamId, main.GetConfigInt("rank_point_nuke_start_classd"));
                    break;

                case Smod2.API.Team.CHAOS_INSURGENCY:
                    db.AddPoint(ev.Activator.SteamId, main.GetConfigInt("rank_point_nuke_start_ci"));
                    break;

                case Smod2.API.Team.NINETAILFOX:
                    db.AddPoint(ev.Activator.SteamId, main.GetConfigInt("rank_point_nuke_start_ntf"));
                    break;

                case Smod2.API.Team.SCIENTIST:
                    db.AddPoint(ev.Activator.SteamId, main.GetConfigInt("rank_point_nuke_start_scient"));
                    break;

                case Smod2.API.Team.SCP:
                    db.AddPoint(ev.Activator.SteamId, main.GetConfigInt("rank_point_nuke_start_scp"));
                    break;
                }
            }
        }
Example #5
0
        public void OnStartCountdown(WarheadStartEvent ev)
        {
            /// <summary>
            ///  This is the event handler for when the warhead starts counting down, isResumed is false if its the initial count down. Note: activator can be null
            /// </summary>
            Dictionary <string, string> variables = new Dictionary <string, string>
            {
                { "isresumed", ev.IsResumed.ToString() },
                { "timeleft", ev.TimeLeft.ToString() },
                { "ipaddress", ev.Activator.IpAddress },
                { "name", ev.Activator.Name },
                { "playerid", ev.Activator.PlayerId.ToString() },
                { "steamid", ev.Activator.SteamId },
                { "class", ev.Activator.TeamRole.Role.ToString() },
                { "team", ev.Activator.TeamRole.Team.ToString() }
            };

            if (ev.IsResumed)
            {
                plugin.SendMessageToBot(plugin.GetConfigString("discord_channel_onstartcountdown"), "environment.onstartcountdown.countdownresumed", variables);
            }
            else
            {
                plugin.SendMessageToBot(plugin.GetConfigString("discord_channel_onstartcountdown"), "environment.onstartcountdown", variables);
            }
        }
 public void OnStartCountdown(WarheadStartEvent ev)
 {
     /// <summary>
     ///  This is the event handler for when the warhead starts counting down, isResumed is false if its the initial count down. Note: activator can be null
     /// </summary>
     plugin.SendMessageAsync(plugin.GetConfigString("discord_channel_onstartcountdown"), plugin.MultiLanguage(44));
 }
Example #7
0
 void IEventHandlerWarheadStartCountdown.OnStartCountdown(WarheadStartEvent ev)
 {
     send(ev, new IdMapping()
          .appendId(Lib.EVENT_ACTIVATOR_ID, ev.Activator)
          .appendId(Lib.EVENT_ACTIVATOR_SCPDATA_ID, ev.Activator.Scp079Data)
          .appendId(Lib.EVENT_ACTIVATOR_TEAMROLE_ID, ev.Activator.TeamRole)
          );
 }
Example #8
0
 public void OnStartCountdown(WarheadStartEvent ev)
 {
     if (ConfigManager.Manager.Config.GetBoolValue("admintoolbox_custom_nuke_cards", false))
     {
         int[] allowedCards = ConfigManager.Manager.Config.GetIntListValue("admintoolbox_nuke_card_list", new int[] { 6, 9, 11 }, false);
         ev.Cancel = !allowedCards.Contains((int)ev.Activator.GetCurrentItem().ItemType);
     }
 }
Example #9
0
 public void OnStartCountdown(WarheadStartEvent ev)
 {
     if (GamemodeManager.GamemodeManager.GetCurrentMode().Equals(plugin))
     {
         if (NE_Config.NE_NukeShouldMessage)
         {
             plugin.Server.Map.Broadcast(20, NE_Config.NE_NukeMessage, true);
         }
     }
 }
Example #10
0
 public void OnStart(WarheadStartEvent ev)
 {
     if (!Sitrep.Events.Contains("warheadstartevent"))
     {
         return;
     }
     if (!Sitrep.CustomChannelIds.TryGetValue("warheadstartevent", out ulong channel))
     {
         channel = Sitrep.EventsId;
     }
     Send($":biohazard: [{ev.Player.Role.AsString()}] {ev.Player.Nick.DiscordSanitize()} ({ev.Player.ParsedUserId}) spustil detonaci Alpha Warhead.", channel);
 }
 public void OnStartCountdown(WarheadStartEvent ev)
 {
     if (ev.Activator == null)
     {
         string[] message = File.ReadAllLines(CustomAnnouncements.WarheadAutoStartFilePath);
         if (message.Length > 0)
         {
             plugin.pluginManager.Server.Map.AnnounceCustomMessage(CustomAnnouncements.ReplaceVariables(CustomAnnouncements.SpacePeriods(CustomAnnouncements.StringArrayToString(message, 0))));
             plugin.Info("Running auto warhead announcement...");
         }
     }
 }
Example #12
0
        public static void InvokeWarheadStart(GameObject player, ref bool allow)
        {
            if (WarheadStartEvent == null)
            {
                return;
            }

            WarheadStartEvent ev = new WarheadStartEvent
            {
                Player = player == null ? null : player.GetPlayer(),
                Allow  = allow
            };

            WarheadStartEvent.Invoke(ev);

            allow = ev.Allow;
        }
Example #13
0
 /// <summary>
 /// Checks config to see if 343 should interact with the nuke or not. This is really buggy is set to false.
 /// </summary>
 public void OnStartCountdown(WarheadStartEvent ev)
 {
     if (ev.Activator != null)
     {
         if (Is343(ev.Activator))
         {
             if (_343Config.Nuke_Interact)
             {
                 ev.Cancel = false;
             }
             else
             {
                 ev.Cancel = true;
             }
         }
     }
 }
        public void OnStartCountdown(WarheadStartEvent ev)
        {
            /// <summary>
            ///  This is the event handler for when the warhead starts counting down, isResumed is false if its the initial count down. Note: activator can be null
            /// </summary>

            if (ev.Activator == null)
            {
                Dictionary <string, string> vars = new Dictionary <string, string>
                {
                    { "isresumed", ev.IsResumed.ToString() },
                    { "timeleft", ev.TimeLeft.ToString() },
                    { "opendoorsafter", ev.OpenDoorsAfter.ToString() }
                };
                plugin.SendMessage(Config.GetArray("channels.onstartcountdown.noplayer"), "environment.onstartcountdown.noplayer", vars);
                return;
            }

            Dictionary <string, string> variables = new Dictionary <string, string>
            {
                { "isresumed", ev.IsResumed.ToString() },
                { "timeleft", ev.TimeLeft.ToString() },
                { "opendoorsafter", ev.OpenDoorsAfter.ToString() },
                { "ipaddress", ev.Activator.IpAddress },
                { "name", ev.Activator.Name },
                { "playerid", ev.Activator.PlayerId.ToString() },
                { "steamid", ev.Activator.SteamId },
                { "class", ev.Activator.TeamRole.Role.ToString() },
                { "team", ev.Activator.TeamRole.Team.ToString() }
            };

            if (ev.IsResumed)
            {
                plugin.SendMessage(Config.GetArray("channels.onstartcountdown.resumed"), "environment.onstartcountdown.resumed", variables);
            }
            else
            {
                plugin.SendMessage(Config.GetArray("channels.onstartcountdown.initiated"), "environment.onstartcountdown.initiated", variables);
            }
        }
        /// <summary>
        ///  This is the event handler for when the warhead starts counting down, isResumed is false if its the initial count down. Note: activator can be null
        /// </summary>
        public void OnStartCountdown(WarheadStartEvent ev)
        {
            if (ev.Activator == null)
            {
                Dictionary <string, string> vars = new Dictionary <string, string>
                {
                    { "isresumed", ev.IsResumed.ToString() },
                    { "timeleft", ev.TimeLeft.ToString() },
                    { "opendoorsafter", ev.OpenDoorsAfter.ToString() }
                };
                this.plugin.SendMessage(Config.GetArray("channels.onstartcountdown.noplayer"), "environment.onstartcountdown.noplayer", vars);
                return;
            }

            Dictionary <string, string> variables = new Dictionary <string, string>
            {
                { "isresumed", ev.IsResumed.ToString() },
                { "timeleft", ev.TimeLeft.ToString() },
                { "opendoorsafter", ev.OpenDoorsAfter.ToString() },
                { "ipaddress", ev.Activator.IpAddress },
                { "name", ev.Activator.Name },
                { "playerid", ev.Activator.PlayerId.ToString() },
                { "steamid", ev.Activator.GetParsedUserID() },
                { "class", ev.Activator.TeamRole.Role.ToString() },
                { "team", ev.Activator.TeamRole.Team.ToString() }
            };

            if (ev.IsResumed)
            {
                this.plugin.SendMessage(Config.GetArray("channels.onstartcountdown.resumed"), "environment.onstartcountdown.resumed", variables);
            }
            else
            {
                this.plugin.SendMessage(Config.GetArray("channels.onstartcountdown.initiated"), "environment.onstartcountdown.initiated", variables);
            }
        }
Example #16
0
 public void OnStartCountdown(WarheadStartEvent ev)
 {
     plugin.luaHookCall.Function.Call("OnStartCountdown", ev.Activator, ev.Cancel, ev.IsResumed, ev.OpenDoorsAfter, ev.TimeLeft);
 }
 //Now the warhead starts automatically after 10 minutes, and LCZ after 6. -Nico
 public void OnStartCountDown(WarheadStartEvent WEV)
 {
     WEV.TimeLeft = 600f;
 }
Example #18
0
 public void OnWarheadStart(WarheadStartEvent ev)
 => DiscordLab.bot.NewMessage(ev.InitialStart ? $"**Alpha warhead detonation sequence engaged! The underground section of the facility will be detonated in T-minus {ev.TimeToDetonation} seconds!**" : $"**Alpha warhead detonation sequence resumed! {ev.TimeToDetonation} seconds to detonation!**");
 public void OnStartCountdown(WarheadStartEvent ev)
 {
     InitTimer(2);
 }