anti cheat

This commit is contained in:
hydrant
2021-04-11 02:10:12 +02:00
parent 692b7aa916
commit 2fd484f31d
20 changed files with 336 additions and 49 deletions

View File

@@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Admin;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Server.Types;
@@ -59,6 +60,20 @@ namespace ReallifeGamemode.Server.Extensions
}
}
public static void SafeTeleport(this Player player, Vector3 position, float heading = 0, bool spawn = false)
{
AntiCheat.NoTpAntiCheatForPlayer(player.Name);
if (spawn)
{
NAPI.Player.SpawnPlayer(player, position, heading);
}
else
{
player.Position = position;
player.Heading = heading;
}
}
public static void SetJailTime(this User user, bool killed)
{
if (user == null)