This commit is contained in:
Lukas Moungos
2019-12-13 19:32:26 +01:00
parent efdf94dd8a
commit aa31a9280e
2 changed files with 13 additions and 7 deletions

View File

@@ -58,7 +58,7 @@ namespace ReallifeGamemode.Server.Events
{ {
Autowanted.Check_AutoWanted(killer, player); Autowanted.Check_AutoWanted(killer, player);
string message = "~y~[HINWEIS]: " + killer.Name + " hat " + player.Name + " getötet (" + Managers.WeaponManager.GetWeaponNameByHash((uint)NAPI.Player.GetPlayerCurrentWeapon(killer)) + ")"; string message = "~y~[HINWEIS]: " + killer.Name + " hat " + player.Name + " getötet (" + Managers.WeaponManager.GetWeaponNameByHash(NAPI.Player.GetPlayerCurrentWeapon(killer)) + ")";
ChatService.BroadcastAdmin(message, AdminLevel.ADMIN); ChatService.BroadcastAdmin(message, AdminLevel.ADMIN);
} }
} }

View File

@@ -121,9 +121,10 @@ namespace ReallifeGamemode.Server.Managers
public static String GetWeaponNameByHash(uint hash) public static String GetWeaponNameByHash(uint hash)
{ {
if (!IsValidHash(hash)) foreach (WeaponHash vh in Enum.GetValues(typeof(WeaponHash)))
return "unbekannt"; {
if ((uint)vh == hash)
{
foreach (string w in _modWeapons) foreach (string w in _modWeapons)
{ {
if (NAPI.Util.GetHashKey(w) == hash) if (NAPI.Util.GetHashKey(w) == hash)
@@ -131,6 +132,11 @@ namespace ReallifeGamemode.Server.Managers
return w; return w;
} }
} }
}
}
return "unbekannt"; return "unbekannt";
} }
} }