Fix /veh
This commit is contained in:
@@ -54,20 +54,19 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
|
|
||||||
hash = hash.ToUpper();
|
hash = hash.ToUpper();
|
||||||
|
|
||||||
uint.TryParse(hash, out uint vehHash);
|
if (!uint.TryParse(hash, out uint vehHash))
|
||||||
if (vehHash == 0)
|
|
||||||
{
|
{
|
||||||
if (Enum.IsDefined(typeof(VehicleHash), hash))
|
Debug.WriteLine("couldnt parse");
|
||||||
{
|
if (!Enum.TryParse(hash, true, out VehicleHash realHash))
|
||||||
vehHash = (uint)Enum.Parse(typeof(VehicleHash), hash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(vehHash == 0)
|
|
||||||
{
|
{
|
||||||
player.SendChatMessage("~r~[FEHLER]~s~ Dieses Fahrzeug existiert nicht.");
|
player.SendChatMessage("~r~[FEHLER]~s~ Dieses Fahrzeug existiert nicht.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vehHash = (uint)realHash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Vehicle v = NAPI.Vehicle.CreateVehicle(vehHash, player.Position, player.Rotation.Z, color1, color2);
|
Vehicle v = NAPI.Vehicle.CreateVehicle(vehHash, player.Position, player.Rotation.Z, color1, color2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user