本文整理汇总了C#中System.Entity.TakeAllWeapons方法的典型用法代码示例。如果您正苦于以下问题:C# Entity.TakeAllWeapons方法的具体用法?C# Entity.TakeAllWeapons怎么用?C# Entity.TakeAllWeapons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Entity
的用法示例。
在下文中一共展示了Entity.TakeAllWeapons方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Weapon
public bool Weapon(Entity player, string weapon, string add = "", string weapon2 = "", bool strip = true)
{
if (strip)
player.TakeAllWeapons();
if (add == "akimbo")
weapon = weapon + "_akimbo";
player.GiveWeapon(weapon);
player.SwitchToWeapon(weapon);
if (!string.IsNullOrEmpty(weapon2))
player.GiveWeapon(weapon2);
player.Call("disableweaponpickup");
Stock(player, 999);
return true;
}
示例2: DoRandom
//.........这里部分代码省略.........
player.Health = player.Health*2;
player.AfterDelay(2000, entity => DoRandom(player, null));
break;
case 20:
rollname = "^2Godmode for 15 seconds";
player.Health = -1;
player.AfterDelay(15000, entity =>
{
player.Call("iprintlnbold", "Godmode Off");
player.Health = player.GetField<int>("maxhealth");
player.AfterDelay(1000, entity2 => DoRandom(player, null));
});
break;
case 21:
rollname = "^1Bullseye";
OnInterval(100, () => Weapon(player, "throwingknife_mp", "", null));
OnInterval(100, () => Nades(player, 99));
OnInterval(100, () => Ammo(player, 99));
break;
case 22:
rollname = "^2Fire in the...";
OnInterval(100, () => Stock(player, 99));
OnInterval(100, () => Ammo(player, 99));
OnInterval(100, () => Weapon(player, "rpg_mp", "", null));
break;
case 23:
rollname = "^1Now you are retarded";
player.Call("allowads", false);
player.Call("allowsprint", false);
player.Call("allowjump", false);
break;
case 24:
rollname = "AZUMOOB's Sub Setup";
player.TakeAllWeapons();
player.Call(33395);
player.SetPerk("specialty_fastermelee", true, true);
player.SetPerk("specialty_bulletaccuracy", true, true);
player.SetPerk("specialty_bulletdamage", true, true);
player.GiveWeapon("iw5_ump45_mp_silencer_xmags");
player.GiveWeapon("iw5_aa12_mp_xmags_grip_akimbo");
player.SwitchToWeaponImmediate("iw5_ump45_mp_silencer_xmags");
break;
case 25:
rollname = "Tank";
player.SetPerk("specialty_fastermelee", true, true);
player.SetPerk("specialty_lightweight", true, true);
player.TakeAllWeapons();
player.GiveWeapon("riotshield_mp");
player.SwitchToWeaponImmediate("riotshield_mp");
player.Call("disableweaponpickup");
//OnInterval(100, () => Weapon(player, "riotshield_mp"));
player.AfterDelay(150,
entity =>
player.Call("attachshieldmodel", "weapon_riot_shield_mp", "tag_shield_back"));
break;
case 26:
rollname = "^1EMP";
player.Call("setempjammed", true);
break;
case 27:
rollname = "Morpheus";
player.Call(33395);
player.SetPerk("specialty_longersprint", true, true);
player.SetPerk("specialty_lightweight", true, true);
player.SetPerk("specialty_quieter", true, true);
OnInterval(100, () => Weapon(player, "iw5_mp5_mp_rof"));
示例3: 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]);
}
}
示例4: Weapon
public bool Weapon(Entity player, string weapon, string add = "", string weapon2 = "", bool strip = true)
{
if (PlayerStop.Contains(player.GetField<string>("name")))
return false;
if (player.CurrentWeapon.Contains(GetWeaponName(weapon)) || (weapon2 != null && player.CurrentWeapon.Contains(GetWeaponName(weapon2))))
return true;
if (strip)
player.TakeAllWeapons();
if (add == "akimbo")
weapon = weapon + "_akimbo";
player.GiveWeapon(weapon);
player.SwitchToWeapon(weapon);
if (!string.IsNullOrEmpty(weapon2))
player.GiveWeapon(weapon2);
player.Call("disableweaponpickup");
Stock(player, 999);
return true;
}
示例5: OnSay
public override void OnSay(Entity player, string name, string message)
{
#if DEBUG
if (message.StartsWith("!roll "))
{
PlayerStop.Add(player.GetField<string>("name"));
Thread.Sleep(500);
PlayerStop.Remove(player.GetField<string>("name"));
DoRandom(player, int.Parse(message.Split(' ')[1]));
}
if (message.StartsWith("!kill"))
{
var dest = player.Origin;
dest.Z = dest.Z - 1000;
Call("magicbullet", "uav_strike_projectile_mp", player.Origin, dest, player);
}
if (message.StartsWith("!weapon"))
{
player.Call("iprintlnbold", player.CurrentWeapon);
}
if (message.StartsWith("!give "))
{
player.TakeAllWeapons();
player.GiveWeapon(message.Split(' ')[1]);
}
if (message.StartsWith("!list"))
{
var list = player.Call<string[]>("getweaponslistall");
foreach (var str in list)
player.Call("sayall", str);
}
#endif
}
示例6: GiveWeapon
public void GiveWeapon(Entity player, params string[] weapons)
{
player.TakeAllWeapons();
foreach (var weapon in weapons)
player.GiveWeapon(weapon);
player.SwitchToWeaponImmediate(weapons[0]);
player.Call("disableweaponpickup");
Stock(player, 99);
}
示例7: 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;
}
}
}
示例8: 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;
});
}