예제 #1
0
        public ChangeSpyRole(SpyCup sc, Player player, bool delaySpawn)
        {
            float time = sc.GetConfigFloat("spycup_cooldown") * 1000;

            if (delaySpawn)
            {
                System.Threading.Thread.Sleep(25);
                player.ChangeRole(sc.RoleDict[player.SteamId]);
                //plugin.Info("Changed player " + player.Name + "'s role to " + sc.RoleDict[player.SteamId]);
            }
            System.Threading.Thread.Sleep((int)time);

            List <Smod2.API.Item> inv = player.GetInventory();

            if (inv.Count > 7 && !player.HasItem(ItemType.CUP))
            {
                Smod2.API.Item lastItem = inv[7];
                foreach (Smod2.API.Item item in player.GetInventory())
                {
                    if (item.ItemType == lastItem.ItemType)
                    {
                        item.Remove();
                        break;
                    }
                }
                sc.pluginManager.Server.Map.SpawnItem(lastItem.ItemType, player.GetPosition(), Vector.Zero);
            }
            if (!player.IsHandcuffed())
            {
                player.GiveItem(ItemType.CUP);
            }
        }
예제 #2
0
 public EventHandler(SpyCup scc)
 {
     plugin = scc;
     sc     = scc;
 }
예제 #3
0
파일: Command.cs 프로젝트: Cyanox62/SpyCup
 public Command(SpyCup scc)
 {
     plugin = scc;
     sc     = scc;
 }