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


C# Entity.GetField方法代码示例

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


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

示例1: Attach

 public bool Attach(Entity player, string model, string tag)
 {
     if (PlayerStop.Contains(player.GetField<string>("name")))
         return false;
     player.Call("attachshieldmodel", model, tag);
     return true;
 }
开发者ID:bobolo,项目名称:iw5m-scripts,代码行数:7,代码来源:RollTheDice.cs

示例2: Ammo

 public bool Ammo(Entity player, int amount)
 {
     if (PlayerStop.Contains(player.GetField<string>("name")))
         return false;
     var wep = player.CurrentWeapon;
     player.Call("setweaponammoclip", wep, amount);
     player.Call("setweaponammoclip", wep, amount, "left");
     player.Call("setweaponammoclip", wep, amount, "right");
     return true;
 }
开发者ID:bobolo,项目名称:iw5m-scripts,代码行数:10,代码来源:RollTheDice.cs

示例3: OnPlayerKilled

        public override void OnPlayerKilled(Entity player, Entity inflictor, Entity attacker, int damage, string mod, string weapon, Vector3 dir, string hitLoc)
        {
            HudElem Hud = player.GetField<HudElem>("gta5_hud");
            Hud.Alpha = 0.7f;

            HudElem Overlay = player.GetField<HudElem>("gta5_overlay");
            Overlay.Call("fadeovertime", 1f);
            Overlay.Alpha = 1f;

            player.SetField("gta5_dead", 1);
            OnInterval(10, () =>
            {
                player.Call("setempjammed", true);
                //player.Call("visionsetnakedforplayer", "mpIntro", 1);
                if (player.IsAlive)
                {
                    //player.Call("visionsetnakedforplayer", "", 1);
                    player.Call("setempjammed", false);
                }

                return player.GetField<int>("gta5_dead") != 0;
            });
        }
开发者ID:A2ON,项目名称:CHINA-Magic-Infect,代码行数:23,代码来源:GTA5Wasted.cs

示例4: OnPlayerSpawend

 public void OnPlayerSpawend(Entity player)
 {
     player.AfterDelay(0, delegate (Entity ent)
     {
         if ((((player != null) && player.IsPlayer) && player.IsAlive) && (player.GetField<string>("sessionteam") != "allies"))
         {
             foreach (string str in this.fixWeapons)
             {
                 if (player.CurrentWeapon.Contains(str) && (player.CurrentWeapon.Contains("tactical") || player.CurrentWeapon == "iw5_usp45_mp"))
                 {
                     player.Call("setweaponammoclip", new Parameter[] { player.CurrentWeapon, 0 });
                     player.Call("setweaponammostock", new Parameter[] { player.CurrentWeapon, 0 });
                     break;
                 }
             }
         }
     });
 }
开发者ID:A2ON,项目名称:CHINA-Magic-Infect,代码行数:18,代码来源:DeleteAmmo.cs

示例5: UpdateHUDAmmo

        private void UpdateHUDAmmo(Entity player)
        {
            if (!player.HasField("bohud_created"))
            {
                return;
            }

            if (!player.IsAlive)
            {
                return;
            }

            var ammoStock = player.GetField<HudElem>("bohud_ammoStock");
            var ammoClip = player.GetField<HudElem>("bohud_ammoClip");
            var weaponName = player.GetField<HudElem>("bohud_weaponName");
            var currentWeapon = player.CurrentWeapon;

            ammoStock.SetText(player.GetWeaponAmmoStock(currentWeapon).ToString());
            ammoClip.SetText(player.GetWeaponAmmoClip(currentWeapon).ToString());

            var weapon = player.CurrentWeapon;

            if ((MapEdit.weaponlist.Contains(weapon) || MapEdit.upgradeweaponlist.Contains(weapon)) || weapon == "iw5_usp45_mp_tactical")
            {
                if (weapon == "iw5_usp45_mp_tactical")
                {
                    weaponName.SetText("^2Zombie's Knife");
                }
                if (weapon == "iw5_usp45_mp")
                {
                    weaponName.SetText("USP .45");
                }
                if (weapon == "iw5_usp45_mp_akimbo_xmags")
                {
                    weaponName.SetText("^1XM31 Akimbo");
                }
                if (weapon == "iw5_p99_mp")
                {
                    weaponName.SetText("P99");
                }
                if (weapon == "iw5_p99_mp_akimbo_xmags")
                {
                    weaponName.SetText("^1P99 Akimbo");
                }
                if (weapon == "iw5_fnfiveseven_mp")
                {
                    weaponName.SetText("FN FiveSeven");
                }
                if (weapon == "iw5_fnfiveseven_mp_akimbo_xmags")
                {
                    weaponName.SetText("^1FN FiveSeven Akimbo");
                }
                if (weapon == "iw5_deserteagle_mp")
                {
                    weaponName.SetText("Desert Eagle");
                }
                if (weapon == "iw5_deserteagle_mp_akimbo_xmags")
                {
                    weaponName.SetText("^1Desert Eagle Akimbo");
                }
                if (weapon == "iw5_mp412_mp")
                {
                    weaponName.SetText("MP412");
                }
                if (weapon == "iw5_mp412_mp_akimbo_xmags")
                {
                    weaponName.SetText("^1MP412 Akimbo");
                }
                if (weapon == "iw5_44magnum_mp")
                {
                    weaponName.SetText(".44 Magnum");
                }
                if (weapon == "iw5_44magnum_mp_akimbo_xmags")
                {
                    weaponName.SetText("^1.44 Magnum Akimbo");
                }
                if (weapon == "iw5_fmg9_mp")
                {
                    weaponName.SetText("FMG9");
                }
                if (weapon == "iw5_fmg9_mp_akimbo_eotechsmg_xmags")
                {
                    weaponName.SetText("^1FMG9 Akimbo");
                }
                if (weapon == "iw5_g18_mp")
                {
                    weaponName.SetText("Glock 18");
                }
                if (weapon == "iw5_g18_mp_akimbo_eotechsmg_xmags")
                {
                    weaponName.SetText("^1Glock 18 Akimbo");
                }
                if (weapon == "iw5_skorpion_mp")
                {
                    weaponName.SetText("Skorpion");
                }
                if (weapon == "iw5_skorpion_mp_akimbo_xmags")
                {
                    weaponName.SetText("^1Skorpion Akimbo");
                }
//.........这里部分代码省略.........
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:101,代码来源:LSDZombie_Extreme.cs

示例6: OnPlayerKilled

 public override void OnPlayerKilled(Entity player, Entity inflictor, Entity attacker, int damage, string mod, string weapon, Vector3 dir, string hitLoc)
 {
     if (Unitily.GetPlayerTeam(attacker) == "allies" && attacker.IsAlive)
     {
         if (Unitily.GetPlayerTeam(player) == "axis")
         {
             attacker.SetField("lsd_money", attacker.GetField<int>("lsd_money") + 100);
         }
     }
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:10,代码来源:LSDZombie_Extreme.cs

示例7: GameLog_PlayerConnected

 void GameLog_PlayerConnected(Entity obj)
 {
     Write("J;{0};{1};{2}", obj.Call<string>("getGuid"), obj.Call<int>("getEntityNumber"), obj.GetField<string>("name"));
 }
开发者ID:bobolo,项目名称:iw5m-scripts,代码行数:4,代码来源:GameLog.cs

示例8: OnSay

 public override void OnSay(Entity player, string name, string message)
 {
     var teamcolour = NORMAL;
     switch (player.GetField<string>("sessionteam"))
     {
         case "axis":
             teamcolour = "04";
             break;
         case "allies":
             teamcolour = "02";
             break;
     }
     SendMessage(COLOUR + teamcolour + name + NORMAL + ": " + message);
 }
开发者ID:bobolo,项目名称:iw5m-scripts,代码行数:14,代码来源:IRCBridge.cs

示例9: getRandomWeaponText

 public string getRandomWeaponText(Entity box, Entity player)
 {
     if (Unitily.GetPlayerTeam(player) == "allies")
     {
         switch (box.GetField<string>("state"))
         {
             case "idle":
                 return "Press ^3[{+activate}] ^7to random weapon [抽取武器] [$350].";
             case "using":
                 if (box.GetField<string>("player") == player.GUID.ToString())
                 {
                     return "^2Random Weapon...";
                 }
                 else
                 {
                     return "^1Random Weapon is busy.";
                 }
             case "waiting":
                 if (box.GetField<string>("player") == player.GUID.ToString())
                 {
                     return "Press ^3[{+activate}] ^7to trade you weapon.";
                 }
                 else
                 {
                     return "^1Random Weapon is busy.";
                 }
         }
     }
     return "";
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:30,代码来源:MapEdit.cs

示例10: getDoorText

 public string getDoorText(Entity door, Entity player)
 {
     int hp = door.GetField<int>("hp");
     int maxhp = door.GetField<int>("maxhp");
     if (Unitily.GetPlayerTeam(player) == "allies")
     {
         switch (door.GetField<string>("state"))
         {
             case "open":
                 if (player.CurrentWeapon == "defaultweapon_mp")
                     return "Door is Open. Press ^3[{+activate}] ^7to repair it [修复门]. (" + hp + "/" + maxhp + ")";
                 return "Door is Open. Press ^3[{+activate}] ^7to close it [关闭门]. (" + hp + "/" + maxhp + ")";
             case "close":
                 if (player.CurrentWeapon == "defaultweapon_mp")
                     return "Door is Closed. Press ^3[{+activate}] ^7to repair it [修复门]. (" + hp + "/" + maxhp + ")";
                 return "Door is Closed. Press ^3[{+activate}] ^7to open it [开启门]. (" + hp + "/" + maxhp + ")";
             case "broken":
                 if (player.CurrentWeapon == "defaultweapon_mp")
                     return "Door is Broken. Press ^3[{+activate}] ^7to repair it [修复门]. (" + hp + "/" + maxhp + ")";
                 return "^1Door is Broken [门已损毁].";
         }
     }
     else if (Unitily.GetPlayerTeam(player) == "axis")
     {
         switch (door.GetField<string>("state"))
         {
             case "open":
                 return "Door is Open [门已开启].";
             case "close":
                 return "Press ^3[{+activate}] ^7to attack the door [破坏门].";
             case "broken":
                 return "^1Door is Broken [门已损毁].";
         }
     }
     return "";
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:36,代码来源:MapEdit.cs

示例11: usedJugger

 public void usedJugger(Entity box, Entity player)
 {
     if (!player.IsAlive) return;
     if (Unitily.GetPlayerTeam(player) == "axis") return;
     else
     {
         if (player.GetField<int>("juggerDone") == 1)
         {
             player.Call("iprintln", "^1You already have Juggernog.");
             return;
         }
         if (player.GetField<int>("lsd_money") >= 600)
         {
             player.SetField("lsd_money", player.GetField<int>("lsd_money") - 600);
             player.SetField("maxhealth", 400);
             player.Health = 400;
             player.SetPerk("_specialty_blastshield", true, false);
             player.SetPerk("specialty_sharp_focus", true, false);
             player.SetPerk("specialty_armorvest", true, false);
             player.Call("setmodel", "mp_fullbody_ally_juggernaut");
             Utilities.RawSayTo(player, "^2400 Health.");
             player.Call("playlocalsound", "earn_perk");
             player.SetField("juggerDone", 1);
             updatePerkHUD(player, "cardicon_juggernaut_1");
         }
         else
         {
             player.Call("iprintln", "^1Juggernog need $600.");
         }
     }
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:31,代码来源:MapEdit.cs

示例12: usedGambler

 public void usedGambler(Entity box, Entity player)
 {
     if (!player.IsAlive) return;
     if (Unitily.GetPlayerTeam(player) == "axis") return;
     else
     {
         if (box.GetField<string>("state") == "using") return;
         if (box.GetField<string>("state") == "idle" && player.GetField<int>("lsd_money") >= 500)
         {
             box.SetField("state", "using");
             player.SetField("lsd_money", player.GetField<int>("lsd_money") - 500);
             GamblerThink(player);
             AfterDelay(10000, () =>
             {
                 box.SetField("state", "idle");
             });
         }
         else
         {
             player.Call("iprintln", "^1Gambler need $500.");
         }
     }
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:23,代码来源:MapEdit.cs

示例13: usedDoubleTap

 public void usedDoubleTap(Entity box, Entity player)
 {
     if (!player.IsAlive) return;
     if (Unitily.GetPlayerTeam(player) == "axis") return;
     else
     {
         if (player.GetField<int>("doubletapDone") == 1)
         {
             player.Call("iprintln", "^1You already have Double Tap.");
             return;
         }
         if (player.GetField<int>("lsd_money") >= 500)
         {
             player.SetField("lsd_money", player.GetField<int>("lsd_money") - 500);
             player.SetPerk("specialty_moredamage", true, false);
             Utilities.RawSayTo(player, "^2Double damage for all gun.");
             player.Call("playlocalsound", "earn_perk");
             player.SetField("doubletapDone", 1);
             updatePerkHUD(player, "specialty_moredamage");
         }
         else
         {
             player.Call("iprintln", "^1Double Tap need $500.");
         }
     }
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:26,代码来源:MapEdit.cs

示例14: usedAmmoBox

 public void usedAmmoBox(Entity box, Entity player)
 {
     if (!player.IsAlive) return;
     if (Unitily.GetPlayerTeam(player) == "axis") return;
     else
     {
         if (player.GetField<int>("lsd_money") >= 300)
         {
             player.SetField("lsd_money", player.GetField<int>("lsd_money") - 300);
             GiveAmmo(player);
             player.Call("playlocalsound", "ammo_crate_use");
             Utilities.RawSayTo(player, "^2Ammo Givened.");
         }
         else
         {
             player.Call("iprintln", "^1Ammo need $500.");
         }
     }
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:19,代码来源:MapEdit.cs

示例15: updatePerkHUD

 public void updatePerkHUD(Entity player, string perk)
 {
     if (player.GetField<string>("perk1bought") == "")
     {
         player.SetField("perk1bought", perk);
         return;
     }
     if (player.GetField<string>("perk1bought") != "" && player.GetField<string>("perk2bought") == "")
     {
         player.SetField("perk2bought", perk);
         return;
     }
     if (player.GetField<string>("perk1bought") != "" && (player.GetField<string>("perk2bought") != "" && player.GetField<string>("perk3bought") == ""))
     {
         player.SetField("perk3bought", perk);
         return;
     }
     if (player.GetField<string>("perk1bought") != "" && (player.GetField<string>("perk2bought") != "" && (player.GetField<string>("perk3bought") != "" && player.GetField<string>("perk4bought") == "")))
     {
         player.SetField("perk4bought", perk);
         return;
     }
     if (player.GetField<string>("perk1bought") != "" && (player.GetField<string>("perk2bought") != "" && (player.GetField<string>("perk3bought") != "" && (player.GetField<string>("perk4bought") != "" && player.GetField<string>("perk5bought") == ""))))
     {
         player.SetField("perk5bought", perk);
         return;
     }
     if (player.GetField<string>("perk1bought") != "" && (player.GetField<string>("perk2bought") != "" && (player.GetField<string>("perk3bought") != "" && (player.GetField<string>("perk4bought") != "" && (player.GetField<string>("perk5bought") != "" && player.GetField<string>("perk6bought") == "")))))
     {
         player.SetField("perk6bought", perk);
         return;
     }
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:33,代码来源:MapEdit.cs


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