/flip auch außerhalb
This commit is contained in:
@@ -686,23 +686,33 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
else player.SafeTeleport(player.GetData<Vector3>("mark"));
|
else player.SafeTeleport(player.GetData<Vector3>("mark"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("flip", "")]
|
[Command("flip", "~m~Benutzung:~s~ /flip")]
|
||||||
public void CmdAdminFlip(Player player)
|
public void CmdAdminFlip(Player player)
|
||||||
{
|
{
|
||||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||||
{
|
{
|
||||||
ChatService.NotAuthorized(player);
|
ChatService.NotAuthorized(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vehicle vehToFlip = null;
|
||||||
|
|
||||||
if (player.IsInVehicle)
|
if (player.IsInVehicle)
|
||||||
{
|
{
|
||||||
player.Vehicle.Rotation = new Vector3(0.0, 0.0, player.Vehicle.Rotation.Z);
|
vehToFlip = player.Vehicle;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.SendChatMessage("~r~Du befindest dich in keinem Fahrzeug!");
|
vehToFlip = NAPI.Pools.GetAllVehicles().Where(v => v.Position.DistanceTo(player.Position) <= 5).OrderBy(v => v.Position.DistanceTo(player.Position)).FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vehToFlip == null)
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(player, "Es wurde kein Fahrzeug zum Flippen gefunden");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
vehToFlip.Rotation = new Vector3(0, 0, vehToFlip.Rotation.Z);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("up", "~m~Benutzung: ~s~/up [Wert]")]
|
[Command("up", "~m~Benutzung: ~s~/up [Wert]")]
|
||||||
|
|||||||
Reference in New Issue
Block a user