Exemplo n.º 1
0
 public void OnElevatorUse(PlayerElevatorUseEvent ev)
 {
     if (plugin.Active && (ev.Elevator.ElevatorType == ElevatorType.LiftA || ev.Elevator.ElevatorType == ElevatorType.LiftB))
     {
         ev.AllowUse = false;
     }
 }
Exemplo n.º 2
0
 public void OnElevatorUse(PlayerElevatorUseEvent ev)
 {
     if (waitingForPlayers)
     {
         ev.AllowUse = false;
     }
 }
Exemplo n.º 3
0
 public void OnElevatorUse(PlayerElevatorUseEvent ev)
 {
     if (blockElevators && ev.Player.IsHandcuffed())
     {
         ev.AllowUse = false;
     }
 }
Exemplo n.º 4
0
 void IEventHandlerElevatorUse.OnElevatorUse(PlayerElevatorUseEvent ev)
 {
     send(ev, new IdMapping()
          .appendId(Lib.PLAYER_ID, ev.Player)
          .appendId(Lib.PLAYER_EVENT_SCPDATA_ID, ev.Player.Scp079Data)
          .appendId(Lib.PLAYER_EVENT_TEAM_ROLE_ID, ev.Player.TeamRole)
          .appendId(Lib.EVENT_ELEVATOR_ID, ev.Elevator)
          );
 }
Exemplo n.º 5
0
 public void OnElevatorUse(PlayerElevatorUseEvent ev)
 {
     if (elevatoss)
     {
         if (ev.Player.TeamRole.Team != Smod2.API.Team.SCP)
         {
             ev.AllowUse = false;
         }
     }
 }
Exemplo n.º 6
0
        public void OnElevatorUse(PlayerElevatorUseEvent ev)
        {
            if ((ev.Elevator.ElevatorType == ElevatorType.LiftA ||
                 ev.Elevator.ElevatorType == ElevatorType.LiftB) && isEnabled)
            {
                ev.AllowUse = false;

                if (ev.Player.TeamRole.Team == Smod2.API.Team.CLASSD)
                {
                    CheckEscape(ev.Player, Smod2.API.Team.CLASSD);
                }
                else if (ev.Player.TeamRole.Team == Smod2.API.Team.SCIENTIST)
                {
                    CheckEscape(ev.Player, Smod2.API.Team.SCIENTIST);
                }
            }
        }
Exemplo n.º 7
0
        public void OnElevatorUse(PlayerElevatorUseEvent ev)
        {
            /// <summary>
            /// Called when a player uses an elevator
            /// <summary>
            Dictionary <string, string> variables = new Dictionary <string, string>
            {
                { "ipaddress", ev.Player.IpAddress },
                { "name", ev.Player.Name },
                { "playerid", ev.Player.PlayerId.ToString() },
                { "steamid", ev.Player.SteamId },
                { "class", ev.Player.TeamRole.Role.ToString() },
                { "team", ev.Player.TeamRole.Team.ToString() }
            };

            plugin.SendMessageToBot(plugin.GetConfigString("discord_channel_onelevatoruse"), "player.onelevatoruse", variables);
        }
        public void OnElevatorUse(PlayerElevatorUseEvent ev)
        {
            if (!(ev.Elevator.GetComponent() as Lift).operative)
            {
                return;
            }

            float newSpeed = (float)plugin.WeightedRandomizer.GetValue();

            ev.Elevator.MovingSpeed = newSpeed;

            // if announcing is on and it's above the ejaoasidasiojd blah blah
            if ((Math.Abs(plugin.BroadcastValue) < 1) || newSpeed < plugin.BroadcastValue)
            {
                return;
            }

            // get all players close to him...
            List <Player> allPlayers = plugin.Server.GetPlayers();

            string message = plugin.BroadcastMessage.Replace("$seconds$", $"{Math.Floor(newSpeed)}");

            uint time = Math.Min(plugin.BroadCastTime, (uint)Math.Floor(newSpeed));

            Vector playerPos = ev.Player.GetPosition();

            foreach (Player player in allPlayers)
            {
                if (player.GetHealth() == 0)
                {
                    continue;
                }

                if (GetMagnitude(player.GetPosition(), playerPos) < MIN_DISTANCE)
                {
                    player.PersonalBroadcast(time, message, false);
                }
            }
        }
Exemplo n.º 9
0
 public void OnElevatorUse(PlayerElevatorUseEvent ev)
 {
     ev.AllowUse = false;
 }