using System;
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Services;

namespace ReallifeGamemode.Server.Events
{
  internal class PlayerEvent : Script
  {
    [ServerEvent(Event.PlayerDamage)]
    public void OnPlayerDamage(Player player, float healthLoss, float armorLoss){
    }

    [RemoteEvent("CLIENT:SET_InFrontOfPos")]
    public void SetFrontOfPos(Player player, Vector3 pos)
    {
      player.SafeTeleport(pos);
    }

    [RemoteEvent("CLIENT:SetAfkStatus")]
    public void SetPlayerAfkStatus(Player player, bool status)
    {
      player.SetSharedData("isAfk", status);
      if(status)
      {
        player.SendNotification("Du wurdest ~b~AFK~s~ gesetzt", true);
      }
    }

    [RemoteEvent("CLIENT:Handsup_TogglePlayerHup")]
    public void PlayerToggleHandsupEvent(Player player)
    {
      player.ToggleSurrender();
    }
  }
}
