fix tuning weg bei /respawnvehicle

This commit is contained in:
hydrant
2020-08-02 21:16:35 +02:00
parent d7e679a81c
commit 746998a9d5
3 changed files with 12 additions and 5 deletions

View File

@@ -1171,8 +1171,8 @@ namespace ReallifeGamemode.Server.Commands
}
}
[Command("respawnvehicle")]
public void CmdAdminRespawnVehicle(Player player, int? id = null)
[Command("respawnvehicle", "~m~Benutzung: ~s~/respawnvehicle (Db ID)", Alias = "rveh")]
public void CmdAdminRespawnVehicle(Player player, int id = -1)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
{
@@ -1182,14 +1182,14 @@ namespace ReallifeGamemode.Server.Commands
Vehicle veh = null;
if (id == null)
if (id == -1)
{
var nearestVeh = NAPI.Pools.GetAllVehicles().Where(v => v.Position.DistanceTo(player.Position) <= 5).FirstOrDefault();
veh = nearestVeh;
}
else
{
veh = VehicleManager.GetVehicleFromId(id.Value);
veh = VehicleManager.GetVehicleFromId(id);
}
if (veh == null)