Improved postbuild events, added freecam (F5), add check if vehicle hash is valid, improved deathscreen

This commit is contained in:
hydrant
2018-12-08 14:37:50 +01:00
parent 54b647c38e
commit a5269637c3
6 changed files with 163 additions and 15 deletions

View File

@@ -9,6 +9,11 @@ namespace reallife_gamemode.Server.Managers
{
public class VehicleManager
{
private static readonly List<string> _enabledMods = new List<string>()
{
};
private static Dictionary<int, NetHandle> _serverVehicles = new Dictionary<int, NetHandle>();
public static void AddVehicle(ServerVehicle serverVehicle, Vehicle vehicle)
@@ -71,5 +76,20 @@ namespace reallife_gamemode.Server.Managers
return null;
}
public static bool IsValidHash(uint hash)
{
foreach(VehicleHash vh in Enum.GetValues(typeof(VehicleHash)))
{
if ((uint)vh == hash) return true;
}
foreach(string mod in _enabledMods)
{
if (NAPI.Util.GetHashKey(mod) == hash) return true;
}
return false;
}
}
}