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


C# Entity.SetPerk方法代码示例

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


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

示例1: usedStalker

 public void usedStalker(Entity box, Entity player)
 {
     if (!player.IsAlive) return;
     if (Unitily.GetPlayerTeam(player) == "axis") return;
     else
     {
         if (player.GetField<int>("stalkerDone") == 1)
         {
             player.Call("iprintln", "^1You already have Stalker Soda.");
             return;
         }
         if (player.GetField<int>("lsd_money") >= 500)
         {
             player.SetField("lsd_money", player.GetField<int>("lsd_money") - 500);
             player.SetPerk("specialty_stalker", true, false);
             player.SetPerk("specialty_delaymine", true, false);
             Utilities.RawSayTo(player, "^2Extra ADS speed and delay mine timer.");
             player.Call("playlocalsound", "earn_perk");
             player.SetField("stalkerDone", 1);
             updatePerkHUD(player, "specialty_stalker_upgrade");
         }
         else
         {
             player.Call("iprintln", "^1Stalker Soda need $1000.");
         }
     }
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:27,代码来源:MapEdit.cs

示例2: OnPlayerSpawned

        public void OnPlayerSpawned(Entity player)
        {
            player.SetField("perk1bought", "");
            player.SetField("perk2bought", "");
            player.SetField("perk3bought", "");
            player.SetField("perk4bought", "");
            player.SetField("perk5bought", "");
            player.SetField("perk6bought", "");

            player.SetField("speedcolaDone", 0);
            player.SetField("juggerDone", 0);
            player.SetField("speedyDone", 0);
            player.SetField("stalkerDone", 0);
            player.SetField("mulekickDone", 0);
            player.SetField("doubletapDone", 0);

            if (Unitily.GetPlayerTeam(player) == "axis")
            {
                player.Call("clearperks");
                player.TakeAllWeapons();
                player.GiveWeapon("iw5_usp45_mp_tactical");
                player.SwitchToWeapon("iw5_usp45_mp_tactical");
                player.Call("setWeaponAmmoClip", "iw5_usp45_mp_tactical", "0");
                player.Call("setWeaponAmmoStock", "iw5_usp45_mp_tactical", "0");
                player.SetField("maxhealth", 150);
                player.Health = 150;
                OnInterval(100, () =>
                {
                    player.Call("setmovespeedscale", new Parameter((float)1.1f));
                    if (!player.IsAlive) return false;
                    return true;
                });
                player.SetPerk("specialty_lightweight", true, false);
                player.SetPerk("specialty_longersprint", true, false);
                player.SetPerk("specialty_grenadepulldeath", true, false);
                player.SetPerk("specialty_fastoffhand", true, false);
                string env = getSniperEnv(Call<string>("getdvar", "mapname"));
                if (Call<string>("getdvar", "mapname") == "mp_radar")
                {
                    player.Call("setmodel", "mp_body_russian_military_assault_a_arctic");
                }
                else
                {
                    player.Call("setmodel", "mp_body_ally_ghillie_" + env + "_sniper");
                }
                player.Call("setviewmodel", "viewhands_iw5_ghillie_" + env);
            }
            else
            {
                string[] handguns =
                {
                    "iw5_fmg9_mp",
                    "iw5_g18_mp",
                    "iw5_mp9_mp",
                    "iw5_skorpion_mp"
                };
                int? rng = new Random().Next(handguns.Length);
                int num = rng.Value;

                player.TakeAllWeapons();
                player.Call("clearperks");
                player.GiveWeapon(handguns[num]);
                player.SwitchToWeapon(handguns[num]);
                player.Call("givemaxammo", handguns[num]);

                player.Call("unsetperk", "specialty_delaymine");
                player.SetPerk("specialty_fastmantle", true, false);
                player.SetPerk("specialty_fasterlockon", true, false);
                player.SetPerk("specialty_bulletaccuracy", true, false);
                player.SetPerk("specialty_fastsprintrecovery", true, false);
                player.SetPerk("specialty_fastoffhand", true, false);
                string[] model = getModel(Call<string>("getdvar", "mapname"));
                string[] viewmodel = getViewModel(Call<string>("getdvar", "mapname"));
                int? rng2 = new Random().Next(2);
                player.Call("setmodel", model[rng2.Value]);
                player.Call("setviewmodel", viewmodel[rng2.Value]);
            }
        }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:78,代码来源:LSDZombie_Extreme.cs

示例3: usedSpeedCola

 public void usedSpeedCola(Entity box, Entity player)
 {
     if (!player.IsAlive) return;
     if (Unitily.GetPlayerTeam(player) == "axis") return;
     else
     {
         if (player.GetField<int>("speedcolaDone") == 1)
         {
             player.Call("iprintln", "^1You already have Speed Cola.");
             return;
         }
         if (player.GetField<int>("lsd_money") >= 500)
         {
             player.SetField("lsd_money", player.GetField<int>("lsd_money") - 500);
             player.SetPerk("specialty_fastreload", true, false);
             player.SetPerk("specialty_quickswap", true, false);
             player.SetPerk("specialty_quickdraw", true, false);
             Utilities.RawSayTo(player, "^2Fast reload; quick swap; quick draw.");
             player.Call("playlocalsound", "earn_perk");
             player.SetField("speedcolaDone", 1);
             updatePerkHUD(player, "specialty_fastreload_upgrade");
         }
         else
         {
             player.Call("iprintln", "^1Speed Cola need $500.");
         }
     }
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:28,代码来源:MapEdit.cs

示例4: usedSpeedy

 public void usedSpeedy(Entity box, Entity player)
 {
     if (!player.IsAlive) return;
     if (Unitily.GetPlayerTeam(player) == "axis") return;
     else
     {
         if (player.GetField<int>("speedyDone") == 1)
         {
             player.Call("iprintln", "^1You already have Stamin-Up.");
             return;
         }
         if (player.GetField<int>("lsd_money") >= 600)
         {
             player.SetField("lsd_money", player.GetField<int>("lsd_money") - 600);
             player.SetPerk("specialty_lightweight", true, false);
             player.SetPerk("specialty_longersprint", true, false);
             OnInterval(100, () =>
             {
                 player.Call("setmovespeedscale", new Parameter((float)1.3f));
                 if (!player.IsAlive) return false;
                 return true;
             });
             Utilities.RawSayTo(player, "^2Extra speed.");
             player.Call("playlocalsound", "earn_perk");
             player.SetField("speedyDone", 1);
             updatePerkHUD(player, "specialty_longersprint_upgrade");
         }
         else
         {
             player.Call("iprintln", "^1Stamin-Up need $1500.");
         }
     }
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:33,代码来源:MapEdit.cs

示例5: 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

示例6: usedMuleKick

 public void usedMuleKick(Entity box, Entity player)
 {
     if (!player.IsAlive) return;
     if (Unitily.GetPlayerTeam(player) == "axis") return;
     else
     {
         if (player.GetField<int>("mulekickDone") == 1)
         {
             player.Call("iprintln", "^1You already have Mule Kick.");
             return;
         }
         if (player.GetField<int>("lsd_money") >= 500)
         {
             player.SetField("lsd_money", player.GetField<int>("lsd_money") - 500);
             player.SetPerk("specialty_rof", true, false);
             player.SetPerk("specialty_fastermelee", true, false);
             Utilities.RawSayTo(player, "^2Extra fire speed and knife speed.");
             player.Call("playlocalsound", "earn_perk");
             player.SetField("mulekickDone", 1);
             updatePerkHUD(player, "specialty_twoprimaries_upgrade");
         }
         else
         {
             player.Call("iprintln", "^1Mule Kick need $500.");
         }
     }
 }
开发者ID:China-PubX,项目名称:LSDZombie-Extreme,代码行数:27,代码来源:MapEdit.cs

示例7: DoRandom


//.........这里部分代码省略.........
             player.Health = 1;
             break;
         case 20:
             rollname = "^2One Ammo RSASS";
             string weapon = Utilities.BuildWeaponName("iw5_rsass", "none", "none", 0, 0);
             player.GiveWeapon(weapon);
             player.Call("setweaponammoclip", weapon, 1);
             player.Call("setweaponammostock", weapon, 0);
             AfterDelay(300, () => player.SwitchToWeaponImmediate(weapon));
             break;
         case 21:
             rollname = "^2Juggernaut";
             player.SetField("maxhealth", player.Health * 3);
             player.Health = player.Health * 3;
             player.Call("setmodel", "mp_fullbody_opforce_juggernaut");
             player.Call("setviewmodel", "viewhands_juggernaut_opforce");
             break;
         case 22:
             rollname = "^2SMAW";
             player.TakeWeapon(player.CurrentWeapon);
             player.GiveWeapon("iw5_smaw_mp");
             AfterDelay(300, () => player.SwitchToWeaponImmediate("iw5_smaw_mp"));
             break;
         case 23:
             rollname = "^1Can't Jump";
             player.Call("allowjump", false);
             break;
         case 24:
             rollname = "^3Riotshield Juggernaut";
             player.SetField("maxhealth", player.Health * 3);
             player.Health = player.Health * 3;
             player.Call("setmodel", "mp_fullbody_opforce_juggernaut");
             player.Call("setviewmodel", "viewhands_juggernaut_opforce");
             player.SetPerk("specialty_fastermelee", true, true);
             player.SetPerk("specialty_lightweight", true, true);
             player.TakeWeapon(player.CurrentWeapon);
             player.GiveWeapon("riotshield_mp");
             AfterDelay(300, () => player.SwitchToWeaponImmediate("riotshield_mp"));
             player.AfterDelay(150,
                               entity =>
                               player.Call("attachshieldmodel", "weapon_riot_shield_mp", "tag_shield_back"));
             break;
         case 25:
             rollname = "^2Riotshield";
             player.SetPerk("specialty_fastermelee", true, true);
             player.SetPerk("specialty_lightweight", true, true);
             player.TakeWeapon(player.CurrentWeapon);
             player.GiveWeapon("riotshield_mp");
             AfterDelay(300, () => player.SwitchToWeaponImmediate("riotshield_mp"));
             player.AfterDelay(150,
                               entity =>
                               player.Call("attachshieldmodel", "weapon_riot_shield_mp", "tag_shield_back"));
             break;
         case 26:
             rollname = "^2C4";
             player.GiveWeapon("c4_mp");
             player.Call("givemaxammo", "c4_mp");
             AfterDelay(300, () => player.SwitchToWeaponImmediate("c4_mp"));
             break;
         case 27:
             rollname = "^2Juggernaut";
             player.SetField("maxhealth", player.Health * 3);
             player.Health = player.Health * 3;
             player.Call("setmodel", "mp_fullbody_opforce_juggernaut");
             player.Call("setviewmodel", "viewhands_juggernaut_opforce");
             break;
开发者ID:A2ON,项目名称:CHINA-Magic-Infect,代码行数:67,代码来源:ZombieRollTheDice.cs

示例8: 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

示例9: GiveRandomPerk

        private void GiveRandomPerk(Entity player)
        {
            var pc = player.GetField<int>("shrp_perkc");

            if (pc < 3)
            {
                var usedPerks = player.GetField<string[]>("shrp_perks");

                var validPerk = false;
                SharpshooterPerk perk = null;

                while (!validPerk)
                {
                    perk = _perkList[_rng.Next(0, _perkList.Length)];

                    if (!usedPerks.Contains(perk.perks[0]))
                    {
                        validPerk = true;
                    }
                }

                foreach (var p in perk.perks)
                {
                    player.SetPerk(p, true, false);
                }

                UpdatePerkHUD(player, pc, perk);

                usedPerks[pc] = perk.perks[0];
                player.SetField("shrp_perkc", pc + 1);
            }
        }
开发者ID:bobolo,项目名称:iw5m-scripts,代码行数:32,代码来源:Sharpshooter.cs

示例10: DoRandom

 public void DoRandom(Entity player, int? desiredNumber)
 {
     int? roll = new Random().Next(NumOfRolls);
     if (desiredNumber != null)
         roll = desiredNumber;
     var rollname = "";
     switch (roll)
     {
         case 0:
             rollname = "^2Extra Speed";
             OnInterval(100, () => Speed(player, 1.5));
             break;
         case 1:
             rollname = "^2Unlimited XM25";
             OnInterval(100, () => Stock(player, 99));
             OnInterval(100, () => Weapon(player, "xm25_mp", "", null));
             break;
         case 2:
             rollname = "^2No Recoil";
             OnInterval(100, () => Recoil(player, 0f));
             break;
         case 3:
             rollname = "^1You are a one hit kill";
             player.SetField("maxhealth", 1);
             player.Health = 1;
             break;
         case 4:
             rollname = "^1No ADS";
             player.Call("allowads", false);
             break;
         case 5:
             rollname = "^2Triple HP";
             player.SetField("maxhealth", player.Health*3);
             player.Health = player.Health*3;
             break;
         case 6:
             rollname = "^2All Perks";
             player.SetPerk("specialty_longersprint", true, false);
             player.SetPerk("specialty_fastreload", true, false);
             player.SetPerk("specialty_scavenger", true, false);
             player.SetPerk("specialty_blindeye", true, false);
             player.SetPerk("specialty_paint", true, false);
             player.SetPerk("specialty_hardline", true, false);
             player.SetPerk("specialty_coldblooded", true, false);
             player.SetPerk("specialty_quickdraw", true, false);
             player.SetPerk("specialty_twoprimaries", true, false);
             player.SetPerk("specialty_assists", true, false);
             player.SetPerk("_specialty_blastshield", true, false);
             player.SetPerk("specialty_detectexplosive", true, false);
             player.SetPerk("specialty_autospot", true, false);
             player.SetPerk("specialty_bulletaccuracy", true, false);
             player.SetPerk("specialty_quieter", true, false);
             player.SetPerk("specialty_stalker", true, false);
             break;
         case 7:
             rollname = "^2Unlimited Grenades";
             OnInterval(100, () => Nades(player, 99));
             break;
         case 8:
             rollname = "^2Go Get 'em Makarov";
             OnInterval(100, () => Weapon(player, "iw5_mg36_mp_grip_xmags", "", null));
             OnInterval(100, () => Stock(player, 999));
             break;
         case 9:
             rollname = "^1Darkness";
             OnInterval(100, () => Vision(player, "cheat_chaplinnight", false));
             break;
         case 10:
             rollname = "^2Thermal Vision";
             OnInterval(100, () => Vision(player, "ac130_thermal_mp", true));
             break;
         case 11:
             rollname = "^2Barrett Roll";
             OnInterval(100, () => Recoil(player, 0f));
             OnInterval(100, () => Stock(player, 99));
             OnInterval(100, () => Weapon(player, "iw5_barrett_mp_xmags", "", null));
             break;
         case 12:
             rollname = "^1Negative";
             OnInterval(100, () => Vision(player, "cheat_invert_contrast", false));
             break;
         case 13:
             rollname = "^2Knife Runner";
             player.Call(33395);
             player.SetPerk("specialty_longersprint", true, true);
             player.SetPerk("specialty_lightweight", true, true);
             player.SetPerk("specialty_fastermelee", true, true);
             OnInterval(100, () => Weapon(player, "iw5_44magnum_mp_tactical", "", null));
             OnInterval(100, () => Speed(player, 1.2f));
             OnInterval(100, () => Ammo(player, 0));
             OnInterval(100, () => Stock(player, 0));
             break;
         case 14:
             rollname = "^1Turtle";
             OnInterval(100, () => Speed(player, 0.4f));
             break;
         case 15:
             rollname = "^1Supermodel 1887";
             player.Call(33395);
             player.SetPerk("specialty_bulletaccuracy", true, true);
//.........这里部分代码省略.........
开发者ID:bobolo,项目名称:iw5m-scripts,代码行数:101,代码来源:RollTheDice.cs

示例11: OnPlayerSpawned

 public void OnPlayerSpawned(Entity player)
 {
     if (PlayerStop.Contains(player.GetField<string>("name")))
         PlayerStop.Remove(player.GetField<string>("name"));
     ResetPlayer(player);
     player.Call(33395);
     player.SetPerk("specialty_longersprint", false, true);
     player.SetPerk("specialty_fastreload", false, true);
     player.SetPerk("specialty_falldamage", false, true);
     //player.Call(@"maps\mp\gametypes\_class::setKillstreaks", "none", "none", "none");
     DoRandom(player, null);
 }
开发者ID:bobolo,项目名称:iw5m-scripts,代码行数:12,代码来源:RollTheDice.cs

示例12: OnPlayerSpawned

        public void OnPlayerSpawned(Entity player)
        {
            if (Utility.GetPlayerTeam(player) == "allies")
            {
                player.SetField("firstweapon", Call<string>("getdvar", "scr_inf2_initweapon"));
                player.SetField("secondweapon", "none");
                player.TakeAllWeapons();
                player.GiveWeapon(Call<string>("getdvar", "scr_inf2_initweapon"));
                player.Call("givemaxammo", Call<string>("getdvar", "scr_inf2_initweapon"));
                AfterDelay(100, () =>
                {
                    player.GiveWeapon("trophy_mp");
                    player.GiveWeapon("claymore_mp");
                    player.Call("givemaxammo", "trophy_mp");
                    player.Call("givemaxammo", "claymore_mp");
                });
                AfterDelay(300, () => player.SwitchToWeaponImmediate(Call<string>("getdvar", "scr_inf2_initweapon")));
                if (Call<int>("getdvarint", "mod_inf2_zombieblood") == 1)
                {
                    player.Call("hide");
                }
                player.SetPerk("specialty_holdbreathwhileads", true, false);
                player.SetPerk("specialty_fastermelee", true, false);
                player.SetPerk("specialty_bulletaccuracy", true, false);
                player.SetPerk("specialty_fastoffhand", true, false);
                player.SetPerk("specialty_quickdraw", true, false);
                player.SetPerk("specialty_longerrange", true, false);

                player.Call("setviewmodel", new Parameter[] { "viewmodel_base_viewhands" });

                player.SetClientDvar("g_compassshowenemies", "0");
            }
            else
            {
                SetModel(player);
                player.SetPerk("specialty_falldamage", true, false);
                player.SetPerk("specialty_lightweight", true, false);
                player.SetPerk("specialty_longersprint", true, false);
                //player.SetPerk("specialty_grenadepulldeath", true, false);
                player.SetPerk("specialty_fastoffhand", true, false);
                player.SetPerk("specialty_fastreload", true, false);
                player.SetPerk("specialty_paint", true, false);
                player.SetPerk("specialty_autospot", true, false);
                player.SetPerk("specialty_stalker", true, false);
                player.SetPerk("specialty_marksman", true, false);
                player.SetPerk("specialty_quickswap", true, false);
                player.SetPerk("specialty_quickdraw", true, false);
                player.SetPerk("specialty_fastermelee", true, false);
                player.SetPerk("specialty_selectivehearing", true, false);
                player.SetPerk("specialty_steadyaimpro", true, false);
                player.SetPerk("specialty_sitrep", true, false);
                player.SetPerk("specialty_detectexplosive", true, false);
                player.SetPerk("specialty_fastsprintrecovery", true, false);
                player.SetPerk("specialty_fastmeleerecovery", true, false);
                player.SetPerk("specialty_bulletpenetration", true, false);
                player.SetPerk("specialty_bulletaccuracy", true, false);

                player.SetClientDvar("g_compassshowenemies", "1");

                if (Call<int>("getteamscore", "axis") <= 1)
                {
                    player.Call("givemaxammo", player.CurrentWeapon);
                    player.SetField("maxhealth", 1000);
                    player.Health = 1000;
                }
                else
                {
                    player.SetField("maxhealth", 100);
                    player.Health = 100;
                }
            }
        }
开发者ID:A2ON,项目名称:CHINA-Magic-Infect,代码行数:72,代码来源:INF2.cs

示例13: OnPlayerSpawn

 public void OnPlayerSpawn(Entity entity)
 {
     if (PlayerStop.Contains(entity.GetField<string>("name")))
         PlayerStop.Remove(entity.GetField<string>("name"));
     entity.TakeAllWeapons();
     entity.GiveWeapon(Settings.MainWeapon);
     entity.AfterDelay(10, entity1 =>
                               {
                                   entity.SwitchToWeapon(Settings.MainWeapon);
                                   entity.Call("givemaxammo", Settings.MainWeapon);
                               });
     if (Settings.AntiHardscope)
     {
         entity.OnInterval(50, entity1 =>
                                   {
                                       if (PlayerStop.Contains(entity.GetField<string>("name")))
                                           return false;
                                       if (!PlayerADSCount.ContainsKey(entity.GetField<string>("name")))
                                           PlayerADSCount.Add(entity.GetField<string>("name"), 0);
                                       if (entity.Call<float>("playerads") >= 1)
                                           PlayerADSCount[entity.GetField<string>("name")]++;
                                       if (PlayerADSCount[entity.GetField<string>("name")] >=
                                           Settings.MaxScopeTime/0.15)
                                       {
                                           PlayerADSCount[entity.GetField<string>("name")] = 0;
                                           entity.Call("allowads", false);
                                           OnInterval(50, () =>
                                                              {
                                                                  if (entity.Call<float>("playerads") > 0)
                                                                      return true;
                                                                  entity.Call("allowads", true);
                                                                  return false;
                                                              });
                                       }
                                       return true;
                                   });
     }
     if (Settings.ThrowingKnife)
     {
         entity.Call("SetOffhandPrimaryClass", "throwingknife");
         entity.GiveWeapon("throwingknife_mp");
         entity.Call("setweaponammoclip", "throwingknife_mp", 1);
     }
     if (Settings.RemoveAllPerks)
     {
         entity.Call(33395);
     }
     if (Settings.DefaultSniperPerks)
     {
         entity.SetPerk("specialty_bulletpenetration", true, false);
         entity.SetPerk("specialty_longersprint", true, false);
         entity.SetPerk("specialty_fastreload", true, false);
         entity.SetPerk("specialty_holdbreathwhileads", true, false);
         entity.SetPerk("specialty_lightweight", true, false);
         entity.SetPerk("specialty_moredamage", true, false);
         entity.SetPerk("specialty_quickdraw", true, false);
         entity.SetPerk("specialty_quickswap", true, false);
         entity.SetPerk("specialty_fastmantle", true, false);
     }
     if (!Settings.EnableFallDamage)
         entity.SetPerk("specialty_falldamage", true, false);
     if (Settings.UseSecondary)
     {
         entity.GiveWeapon(Settings.SecondaryWeapon);
         if (!Settings.SecondaryHasAmmo)
         {
             entity.Call("setweaponammoclip", Settings.SecondaryWeapon, 0);
             entity.Call("setweaponammostock", Settings.SecondaryWeapon, 0);
         }
     }
     //entity.SetField("maxhealth", Settings.PlayerMaxHealth);
     //entity.Health = Settings.PlayerMaxHealth;
     //entity.Notify("joined_spectators");
     //entity.SetField("usingRemote", "remote_remote");
     OnInterval(10, () =>
                        {
                            entity.Call("stoplocalsound", "breathing_hurt");
                            return true;
                        });
     OnInterval(50, () =>
                        {
                            if (entity.CurrentWeapon != Settings.MainWeapon)
                                entity.SwitchToWeapon(Settings.MainWeapon);
                            return true;
                        });
 }
开发者ID:bobolo,项目名称:iw5m-scripts,代码行数:86,代码来源:SnipeMod.cs


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