Improved postbuild events, added freecam (F5), add check if vehicle hash is valid, improved deathscreen
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user