Only send taxi enter message when veh driver is not contract driver

This commit is contained in:
hydrant
2019-06-23 19:50:32 +02:00
parent 777eb6fc01
commit d728252008
2 changed files with 11 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ReallifeGamemode.Server.Extensions
@@ -14,5 +15,10 @@ namespace ReallifeGamemode.Server.Extensions
{
return VehicleManager.GetServerVehicleFromVehicle(veh, context);
}
public static Client GetDriver(this Vehicle veh)
{
return NAPI.Pools.GetAllPlayers().Where(p => p.Vehicle.Handle == veh.Handle && p.VehicleSeat == -1).FirstOrDefault();
}
}
}