nur bestimmte waffen für unter 1337

This commit is contained in:
hydrant
2021-05-09 22:51:35 +02:00
parent d55ceb53c4
commit 4708d346f8
2 changed files with 40 additions and 4 deletions

View File

@@ -105,6 +105,26 @@ namespace ReallifeGamemode.Server.Managers
"militaryrifle"
};
private static readonly List<string> _restrictedWeapons = new List<string>()
{
"bat",
"flashlight",
"knuckle",
"nightstick",
"pistol",
"pistol_mk2",
"combatpistol",
"stungun",
"pistol50",
"smg",
"assaultsmg",
"combatpdw",
"pumpshotgun",
"assaultrifle",
"carbinerifle",
"sniperrifle"
};
private static readonly Dictionary<uint, string> causeOfDeath = new Dictionary<uint, string>()
{
{ 2460120199, "Antique Cavalry Dagger"},
@@ -341,6 +361,8 @@ namespace ReallifeGamemode.Server.Managers
{ 1470379660 ,"Perico Pistol" },
};
public static bool IsAllowedWeapon(string name) => _restrictedWeapons.Contains(name.ToLower());
public static bool IsValidHash(uint hash)
{
foreach (WeaponHash vh in Enum.GetValues(typeof(WeaponHash)))