当前位置: 首页>>代码示例>>C#>>正文


C# Player.GlobalDie方法代码示例

本文整理汇总了C#中MCForge.Entity.Player.GlobalDie方法的典型用法代码示例。如果您正苦于以下问题:C# Player.GlobalDie方法的具体用法?C# Player.GlobalDie怎么用?C# Player.GlobalDie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MCForge.Entity.Player的用法示例。


在下文中一共展示了Player.GlobalDie方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Use

 public void Use(Player p, string[] args)
 {
     Level tempLevel = Level.FindLevel(args[0]);
     if (tempLevel != null)
     {
         if (tempLevel.visit != null && tempLevel.visit.Permission < p.Group.Permission) {
             p.SendMessage("You dont have permission to go to this level");
             return;
         }
         #region Send and Spawn
         p.GlobalDie();
         p.IsLoading = true;
         p.Level = tempLevel;
         short x = (short)((0.5 + tempLevel.CWMap.SpawnPos.x) * 32);
         short y = (short)((1 + tempLevel.CWMap.SpawnPos.y) * 32);
         short z = (short)((0.5 + tempLevel.CWMap.SpawnPos.z) * 32);
         p.Pos = new Vector3S(x, z, y);
         p.Rot = tempLevel.CWMap.SpawnRotation;
         p.oldPos = p.Pos;
         p.oldRot = p.Rot;
         p.SendSpawn(p);
         p.IsLoading = false;
         p.SpawnOtherPlayersForThisPlayer();
         p.SpawnThisPlayerToOtherPlayers();
         p.SpawnBotsForThisPlayer();
         #endregion
         Player.UniversalChat(p.Username + " went to " + args[0] + "!");
     }
     else
     {
         p.SendMessage("This level does not exist!");
     }
 }
开发者ID:headdetect,项目名称:MCForge6-Vanilla,代码行数:33,代码来源:CmdGoto.cs

示例2: Use

        public void Use(Player p, string[] args)
        {
            ExtraPlayerData temp = ZombiePlugin.ZombiePlugin.FindPlayer(p);
            temp.Referee = !temp.Referee;
            if (temp.Referee)
                temp.DateTimeAtStartOfRef = DateTime.Now.Ticks;
            p.SendMessage("Referee mode is now " + temp.Referee.ToString().Replace("True", "on!").Replace("False", "off!"));
            if (!p.IsHidden)
                p.GlobalDie();

            p.IsHidden = !p.IsHidden;

            if (!p.IsHidden)
                p.SpawnThisPlayerToOtherPlayers();
            ZombieHelper.SendUserType(temp);
        }
开发者ID:headdetect,项目名称:MCForge6-Vanilla,代码行数:16,代码来源:CmdReferee.cs

示例3: Use

        public void Use(Player p, string[] args)
        {
            if (!ZombiePlugin.ZombiePlugin.ZombieRoundEnabled)
            {
                p.SendMessage("You cannot use this right now!");
                return;
            }
            ExtraPlayerData P = ZombiePlugin.ZombiePlugin.FindPlayer(p);
            p.SendMessage(Colors.red + "-----------------" + Server.DefaultColor + "Zombie Store" + Colors.red + "---------------");
            if (args.Length < 1)
            {
                Help(p);
                p.SendMessage(Colors.red + "-----------------" + Server.DefaultColor + "Zombie Store" + Colors.red + "---------------");
                return;
            }

            if (args[0] == "1")
            {
                if ((ZombiePlugin.ZombiePlugin.ZombieRoundEnabled || ZombiePlugin.ZombiePlugin.AmountInfected() > 1 || ZombiePlugin.ZombiePlugin.AmountOfMinutesElapsed - 1 > 8) && P.Infected)
                {
                    if (p.Money >= 25)
                    {
                        ZombieHelper.TakeMoney(p, 25);
                        ZombieHelper.DisinfectPlayer(P);
                    }
                    else
                    {
                        p.SendMessage("You do not have enough money for this!");
                    }
                }
                else
                {
                    p.SendMessage("You can not use this right now!");
                }
            }
            else if (args[0] == "2")
            {
                int message12 = 5;
                try
                {
                    message12 = int.Parse(args[1]);
                }
                catch {}
                if (p.Money >= (Math.Round(0.2 * message12)))
                {
                    if (message12 < 5)
                        message12 = 5;
                    P.AmountOfBlocksLeft += message12;
                    p.Money = p.Money - (Convert.ToInt32(Math.Round(0.2 * message12)));
                    p.SendMessage("You now have " + Colors.maroon + P.AmountOfBlocksLeft + Server.DefaultColor + " blocks!");
                }
                else
                {
                    p.SendMessage("You do not have enough " + Server.Moneys);
                }
            }
            else if (args[0] == "3")
            {
                if(P.Infected)
                {
                    p.SendMessage("&9Zombies may not use this item..");
                    return;
                }
                p.IsHidden = true;
                p.GlobalDie();
                Player.UniversalChat(p.Color + p.Username + "&ahas &0vanished!");
                Thread.Sleep(10000);
                Player.UniversalChat(p.Color + p.Username + "&ahas &0appeared");
                p.IsHidden = false;
                p.SpawnThisPlayerToOtherPlayers();
            }
            else if (args[0] == "4")
            {
                if (args.Length >= 2)
                {
                    if (args[1] == "del")
                    {
                        p.ExtraData.ChangeOrCreate("InfectMessage", "");
                        p.ExtraData.Save(p, "InfectMessage");
                        p.SendMessage("Cleared infect message!");
                    }
                    else if (p.Money >= 400)
                    {
                        var strs = new List<string>(args);
                        strs.RemoveAt(0);
                        ZombieHelper.TakeMoney(p, 400);
                        p.ExtraData.ChangeOrCreate("InfectMessage", String.Join(" ", strs.ToArray()));
                        p.ExtraData.Save(p, "InfectMessage");
                        p.SendMessage("Changed infect message to " + String.Join(" ", strs.ToArray()) + "!");
                    }
                    else
                    {
                        p.SendMessage("You do not have enough money for this!");
                    }
                }
                else
                {
                    Help(p);
                }
            }
//.........这里部分代码省略.........
开发者ID:headdetect,项目名称:MCForge6-Vanilla,代码行数:101,代码来源:CmdStore.cs


注:本文中的MCForge.Entity.Player.GlobalDie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。