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


C# BasePlayer.Die方法代码示例

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


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

示例1: OnPlayerDisconnected

 /////////////////////////////////////////
 // OnPlayerDisconnected(BasePlayer player)
 // Called when a user disconnects
 /////////////////////////////////////////
 void OnPlayerDisconnected(BasePlayer player)
 {
     if (hasTag(player, "killsleepers")) player.Die();
 }
开发者ID:bloodyblaze,项目名称:rep-Mods,代码行数:8,代码来源:ZoneManager.cs

示例2: OnPlayerDisconnected

 /////////////////////////////////////////
 // OnPlayerDisconnected(BasePlayer player)
 // Called when a user disconnects
 /////////////////////////////////////////
 private void OnPlayerDisconnected(BasePlayer player)
 {
     if (HasPlayerFlag(player, ZoneFlags.KillSleepers) && !isAdmin(player)) player.Die();
 }
开发者ID:mpendel,项目名称:RUSTBOYS,代码行数:8,代码来源:ZoneManager.cs

示例3: classCmd

        void classCmd(BasePlayer player, string cmd, string[] args)
        {
            if (args.Length == 0)
            {
                SendReply(player, RAPrefix + @"Availible classes:
                      - Assault
                      - Sniper
                      - Support
                      - RocketMan
                      Do /class info {class} for more info.
                      Do /class {class} to change class." + RASuffix);
            }
            else if (args.Length >= 1)
            {
                switch (args[0].ToLower())
                {
                    case "assault":
                        player.Die();
                        SetClass(player, "assault");
                        GiveClass(player);
                        break;
                    case "sniper":
                        player.Die();
                        SetClass(player, "sniper");
                        GiveClass(player);
                        break;
                    case "support":
                        player.Die();
                        SetClass(player, "support");
                        GiveClass(player);
                        break;
                    case "rocketman":
                        player.Die();
                        SetClass(player, "rocketman");
                        GiveClass(player);
                        break;
                    case "info":
                        if (args.Length >= 2)
                        {
                            switch (args[1].ToLower())
                            {
                                case "assault":
                                    SendReply(player, RAPrefix + @"With assault class, you get:
        - Assault Rifle (Holosight)
        - Bandages (x5)
        - Medical Synringes (x5)
        - 5.56 Rifle Ammo (x50)
        - Metal Facemask and Chestplate
        - Green Shirt, Pants, Boots
        - Roadsign Kilt" + RASuffix);
                                    break;

                                case "sniper":
                                    SendReply(player, RAPrefix + @"With sniper class, you get:
        - Bolt Action Rifle (Holosight)
        - Semi-Automatic Pistol (Holosight&Silencer)
        - Bandages (x5)
        - Medical Synringes (x5)
        - HV 5.56 Rifle Ammo (x50)
        - HV Pistol Ammo (x50)
        - Metal Facemask
        - Black Shirt, White Pants" + RASuffix);
                                    break;

                                case "support":
                                    SendReply(player, RAPrefix + @"With support class, you get:
        - SMG (Holosight)
        - Semi-Automatic Pistol (Holosight)
        - Bandages (x20)
        - Medical Synringes (x20)
        - HV Pistol Ammo (x50)
        - Metal Facemask and Chestplate
        - Green Shirt, Pants, Boots
        - Roadsign Kilt" + RASuffix);
                                    break;

                                case "rocketman":
                                    SendReply(player, RAPrefix + @"With rocket man class, you get:
        - Rocket Launcher (Infinite Rockets)
        - Bandages (x5)
        - Medical Synringes (x5)
        - Metal Facemask and Chestplate
        - Green Shirt, Pants, Boots
        - Roadsign Kilt" + RASuffix);
                                    break;
                            }
                        }
                        else
                        {
                            SendReply(player, RAPrefix + "Incorrect syntax. Use /class info {class}.\nDo /class to see classes." + RASuffix);
                        }
                        break;
                    default:
                        SendReply(player, RAPrefix + "Unrecognized command! Use /class {class/info}" + RASuffix);
                        break;
                }
            }
        }
开发者ID:PsychoTea,项目名称:RustArena,代码行数:98,代码来源:RustArena.cs

示例4: OnPlayerDisconnected

 /////////////////////////////////////////
 // OnPlayerDisconnected(BasePlayer player)
 // Called when a user disconnects
 /////////////////////////////////////////
 private void OnPlayerDisconnected(BasePlayer player)
 {
     if (HasPlayerFlag(player, ZoneFlags.KillSleepers) && !isAdmin(player)) player.Die();
     else if (HasPlayerFlag(player, ZoneFlags.EjectSleepers))
     {
         HashSet<Zone> zones;
         if (!playerZones.TryGetValue(player, out zones) || zones.Count == 0) return;
         foreach (var zone in zones)
         {
             if (HasZoneFlag(zone, ZoneFlags.EjectSleepers))
             {
                 EjectPlayer(zone, player);
                 break;
             }
         }
     }
 }
开发者ID:Arkoudaphobia,项目名称:ArkoudaphobiaConfig,代码行数:21,代码来源:ZoneManager.cs

示例5: RespawnChatCommand

 private void RespawnChatCommand(BasePlayer player, string command, string[] args) => player.Die();
开发者ID:PsychoTea,项目名称:RustArena,代码行数:1,代码来源:RustArena.cs


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