Fix /veh
This commit is contained in:
@@ -54,19 +54,18 @@ namespace reallife_gamemode.Server.Commands
|
||||
|
||||
hash = hash.ToUpper();
|
||||
|
||||
uint.TryParse(hash, out uint vehHash);
|
||||
if (vehHash == 0)
|
||||
if (!uint.TryParse(hash, out uint vehHash))
|
||||
{
|
||||
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);
|
||||
player.SendChatMessage("~r~[FEHLER]~s~ Dieses Fahrzeug existiert nicht.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
vehHash = (uint)realHash;
|
||||
}
|
||||
}
|
||||
|
||||
if(vehHash == 0)
|
||||
{
|
||||
player.SendChatMessage("~r~[FEHLER]~s~ Dieses Fahrzeug existiert nicht.");
|
||||
return;
|
||||
}
|
||||
|
||||
Vehicle v = NAPI.Vehicle.CreateVehicle(vehHash, player.Position, player.Rotation.Z, color1, color2);
|
||||
|
||||
Reference in New Issue
Block a user