예제 #1
0
 private void OnPickup(Synapse.Api.Events.SynapseEventArguments.PlayerPickUpItemEventArgs ev)
 {
     if (ev.Item.ID == PluginClass.TranquilizerID)
     {
         ev.Player.SendBroadcast(7, PluginClass.GetTranslation("pickuptranq"));
     }
 }
예제 #2
0
 private void Player_PlayerPickUpItemEvent(Synapse.Api.Events.SynapseEventArguments.PlayerPickUpItemEventArgs ev)
 {
     if (ev.Player.RoleID == 343)
     {
         ev.Allow = false;
     }
 }
예제 #3
0
        private void Pickup(Synapse.Api.Events.SynapseEventArguments.PlayerPickUpItemEventArgs ev)
        {
            if (IsScp035Item(ev.Item))
            {
                if (!SynapseExtensions.CanHarmScp(ev.Player) || ev.Player.RoleID == (int)RoleType.Tutorial)
                {
                    ev.Player.SendBroadcast(8, PluginClass.Translation.ActiveTranslation.ScpPickup035);
                }
                else
                {
                    ev.Allow = false;

                    var players = Server.Get.GetPlayers(x => x.RoleID == (int)RoleType.Spectator && !x.OverWatch);

                    if (players.Count == 0)
                    {
                        ev.Player.SendBroadcast(8, PluginClass.Translation.ActiveTranslation.Survived035);
                        RemoveScp035Items(true);
                        return;
                    }

                    players = players.OrderBy(x => x.DeathTime).ToList();

                    Player player;

                    if (PluginClass.Config.DeathTime)
                    {
                        player = players.FirstOrDefault();
                    }
                    else
                    {
                        player = players.ElementAt(UnityEngine.Random.Range(0, players.Count));
                    }

                    player.CustomRole = new Scp035PlayerScript(ev.Player);
                    RemoveScp035Items(true);
                }
            }
        }