Files
2021-06-15 10:46:11 +02:00

50 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Server.Util;
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)
{
if (player.HasData("inGangWar"))
{
return;
}
if (Rentcar.mapPlayerRentcarBill.ContainsKey(player.Name))
{
Rentcar.cancelRent(player, RentCancelReason.byAfk);
}
player.SendNotification("Du wurdest ~b~AFK~s~ gesetzt", true);
}
}
[RemoteEvent("CLIENT:Handsup_TogglePlayerHup")]
public void PlayerToggleHandsupEvent(Player player)
{
player.ToggleSurrender();
}
}
}