using GTANetworkAPI;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Managers;

namespace ReallifeGamemode.Server.Events
{
  public class UpdateCharacterElevator : Script
  {
    [RemoteEvent("sendPlayerToStage")]
    public void SendPlayerToStageRemoteEvent(Player client, string stage)
    {
      ElevatorPoint elevator = PositionManager.ElevatorPoints.Find(e => e.Stage == stage);
      if (elevator != null)
      {
        client.SafeTeleport(elevator.Position);
      }
    }
  }
}
