remove vehicle velocity when teleporting

This commit is contained in:
hydrant
2019-06-24 19:26:26 +02:00
parent 1240bd5a8d
commit 392927ccea

View File

@@ -182,7 +182,11 @@ namespace ReallifeGamemode.Server.Commands
return;
}
//TODO: Als Supporter nur, wenn mit dem Ziel ein offenes Ticket besteht. Ansonsten kein Teleport
if (player.IsInVehicle && player.VehicleSeat == -1) player.Vehicle.Position = target.Position;
if (player.IsInVehicle && player.VehicleSeat == -1)
{
player.Vehicle.Position = target.Position;
NAPI.Entity.SetEntityVelocity(player.Vehicle, new Vector3());
}
else player.Position = target.Position;
}
@@ -215,7 +219,11 @@ namespace ReallifeGamemode.Server.Commands
return;
}
//TODO: Als Supporter nur, wenn mit dem Ziel ein offenes Ticket besteht. Ansonsten kein Teleport
if (target.IsInVehicle && target.VehicleSeat == -1) target.Vehicle.Position = player.Position;
if (target.IsInVehicle && target.VehicleSeat == -1)
{
target.Vehicle.Position = player.Position;
NAPI.Entity.SetEntityVelocity(target.Vehicle, new Vector3());
}
else target.Position = player.Position;
ChatService.SendMessage(target, "Du wurdest von " + player.Name + " teleportiert.");
}