Hello, I'm working on a plugin and I need to teleport all players to a certain area when I run a command. I'm able to do this to players on foot, but players who are in vehicles aren't being teleported.
I know how to check if they are in a vehicle, but I'm not sure how to force them out.
Anyone have any suggestions?Code:if (pl.session.WorldPlayerEntity.GetComponent<PlayerStatManager>().Motor.InsideVehicle != null) { }
[DOUBLEPOST=1458522422][/DOUBLEPOST]For now I'm just killing the player and then I'm able to send them where I want them to go, but it's not the best solution.
Code:if (pl.Value.WorldPlayerEntity.GetComponent<PlayerStatManager>().Motor.InsideVehicle != null) { EntityStats stats = pl.Value.WorldPlayerEntity.GetComponent<EntityStats>(); stats.GetFluidEffect(EEntityFluidEffectType.Health).SetValue(0F); }
Force Players out of Vehicles
Discussion in 'Hurtworld Development' started by Fraccas, Mar 21, 2016.