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

@@ -26,7 +26,7 @@ namespace ReallifeGamemode.Server.Events
player.TriggerEvent("CLIENT:StopSound");
//player.SetSharedData("vehicleAdminSpeed2", 1.0);
player.SetData("isLoggedIn", false);
player.Position = new Vector3(-1883.736, -781.4911, -10);
player.SafeTeleport(new Vector3(-1883.736, -781.4911, -10));
bool registered = false;

View File

@@ -238,7 +238,7 @@ namespace ReallifeGamemode.Server.Events
Player medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName);
Medic.RemoveTaskFromList(task);
NAPI.Player.SpawnPlayer(player, new Vector3(-495.45, -336.33, 34.5), -98.36f);
player.SafeTeleport(new Vector3(-495.45, -336.33, 34.5), 0, true);
}
}
}

View File

@@ -51,7 +51,7 @@ namespace ReallifeGamemode.Server.Events
client.WarpOutOfVehicle();
ServerVehicle sVeh = VehicleManager.GetServerVehicleFromVehicle(vehicle);
ServerVehicleExtensions.Spawn(sVeh, vehicle);
client.Position = sVeh.Position;
client.SafeTeleport(sVeh.Position);
CheckPointHandle.DeleteCheckpoints(client);
}
}

View File

@@ -113,7 +113,7 @@ namespace ReallifeGamemode.Server.Events
currentPlayerCreatorDimension++;
NAPI.Data.SetWorldData("playerCreatorDimension", currentPlayerCreatorDimension);
player.Dimension = NAPI.Data.GetWorldData("playerCreatorDimension");
player.Position = new Vector3(402.8664, -996.4108, -99.00027);
player.SafeTeleport(new Vector3(402.8664, -996.4108, -99.00027));
player.Rotation = new Vector3(0, 0, 180);
player.TriggerEvent("toggleCreator");
}
@@ -123,7 +123,7 @@ namespace ReallifeGamemode.Server.Events
UpdateCharacterCloth.LoadCharacterDefaults(player);
if (user.JailTime <= 0)
{
NAPI.Player.SpawnPlayer(player, new Vector3(user.PositionX, user.PositionY, user.PositionZ), 0);
player.SafeTeleport(new Vector3(user.PositionX, user.PositionY, user.PositionZ), 0, true);
}
else
{
@@ -151,7 +151,7 @@ namespace ReallifeGamemode.Server.Events
{
player.SetData("isDead", false);
}
}, delayTime: 1000);
}, delayTime: 1000);
}
}
}

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;
using ReallifeGamemode.Server.Extensions;
namespace ReallifeGamemode.Server.Events
{
@@ -10,7 +11,7 @@ namespace ReallifeGamemode.Server.Events
[RemoteEvent("CLIENT:SET_InFrontOfPos")]
public void SetFrontOfPos(Player player, Vector3 pos)
{
player.Position = pos;
player.SafeTeleport(pos);
}
}
}

View File

@@ -3,6 +3,7 @@ using GTANetworkAPI;
using ReallifeGamemode.Database.Entities;
using Newtonsoft.Json;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions;
/**
* @overview Life of German Reallife - Event Register (Register.cs)
@@ -63,7 +64,7 @@ namespace ReallifeGamemode.Server.Events
NAPI.Data.SetWorldData("playerCreatorDimension", currentPlayerCreatorDimension);
player.Dimension = NAPI.Data.GetWorldData("playerCreatorDimension");
player.TriggerEvent("toggleCreator");
player.Position = new Vector3(402.8664, -996.4108, -99.00027);
player.SafeTeleport(new Vector3(402.8664, -996.4108, -99.00027));
//player.Position = new Vector3(user.PositionX, user.PositionY, user.PositionZ);
}
else

View File

@@ -1,4 +1,5 @@
using GTANetworkAPI;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Managers;
namespace ReallifeGamemode.Server.Events
@@ -11,7 +12,7 @@ namespace ReallifeGamemode.Server.Events
ElevatorPoint elevator = PositionManager.ElevatorPoints.Find(e => e.Stage == stage);
if (elevator != null)
{
client.Position = elevator.Position;
client.SafeTeleport(elevator.Position);
}
}
}