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,16 +121,22 @@ 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";
foreach (string w in _modWeapons)
{ {
if(NAPI.Util.GetHashKey(w) == hash) if ((uint)vh == hash)
{ {
return w; foreach (string w in _modWeapons)
{
if (NAPI.Util.GetHashKey(w) == hash)
{
return w;
}
}
} }
} }
return "unbekannt"; return "unbekannt";
} }
} }