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

@@ -800,23 +800,15 @@ namespace reallife_gamemode.Server.Commands
return;
}
hash = hash.ToUpper();
uint uHash = NAPI.Util.GetHashKey(hash);
if (!uint.TryParse(hash, out uint vehHash))
if(!VehicleManager.IsValidHash(uHash))
{
if (!Enum.TryParse(hash, true, out VehicleHash realHash))
{
player.SendChatMessage("~r~[FEHLER]~s~ Dieses Fahrzeug existiert nicht.");
return;
}
else
{
vehHash = (uint)realHash;
}
player.SendChatMessage("~r~[FEHLER]~s~ Dieses Fahrzeug existiert nicht.");
return;
}
Vehicle v = NAPI.Vehicle.CreateVehicle(vehHash, player.Position, player.Rotation.Z, color1, color2);
Vehicle v = NAPI.Vehicle.CreateVehicle(uHash, player.Position, player.Rotation.Z, color1, color2);
player.SetIntoVehicle(v.Handle, -1);
}