public static async Task Spectate() { Logger.Log("Executed SpectateCheck.", Logger.LogLevel.DEBUG); await BaseScript.Delay(0); Vector3 gameplayCamCoord = API.GetGameplayCamCoord(); Vector3 position = Game.PlayerPed.Position; float squared2D = gameplayCamCoord.DistanceToSquared2D(position); if ((double)squared2D <= 5000.0) { return; } Logger.Log("Detected Spectate.", Logger.LogLevel.DEBUG); ViolationManager.SendViolation(ViolationType.PLAYER_SPECTATE); }
public static async Task PedCheck() { await BaseScript.Delay(0); foreach (Ped allPed in World.GetAllPeds()) { Logger.Log("BlacklistModule > Executed Ped Check with " + allPed.Model.Hash, Logger.LogLevel.DEBUG); Ped ped = allPed; if (BlacklistModule.pedBlacklist.Contains(ped.Model.Hash)) { if (!ped.IsPlayer) { ped.Detach(); ped.Delete(); } else { if (ped == Game.PlayerPed) { ViolationManager.SendViolation(ViolationType.BLACKLISTED_PED); } } } BlacklistModule.weaponBlacklist.ForEach((Action <int>)(def => { if (!ped.Weapons.HasWeapon((WeaponHash)def)) { return; } ped.Weapons.RemoveAll(); })); } /* if(Game.PlayerPed.Model.Hash != 0x705E61F2 && Game.PlayerPed.Model.Hash != 0x9C9EFFD8 && Game.PlayerPed.Model.Hash != 0xC1C46677) * { * API.SetPlayerModel(API.PlayerPedId(), 0x705E61F2); * }*/ Logger.Log("BlacklistModule > Executed Ped Check @ " + API.GetGameTimer().ToString(), Logger.LogLevel.DEBUG); }
public static async Task Teleport() { Logger.Log("Executed TeleportCheck.", Logger.LogLevel.DEBUG); await BaseScript.Delay(0); int handle = Game.PlayerPed.Handle; if ((double)Detections.LastPosition.DistanceToSquared(Game.PlayerPed.Position) > 30000.0 && API.GetPedParachuteState(handle) <= 0 && (!Game.PlayerPed.IsFalling && !API.IsPedInParachuteFreeFall(handle)) && (!API.IsPedFalling(handle) && !API.IsPedInAnyVehicle(handle, false))) { if (Detections.IgnoreTeleportCount > 0) { --Detections.IgnoreTeleportCount; Logger.Log("Ignore this Teleport.", Logger.LogLevel.DEBUG); } else { Logger.Log("Detected Teleport.", Logger.LogLevel.DEBUG); } ViolationManager.SendViolation(ViolationType.PLAYER_TELEPORT); } Detections.LastPosition = Game.PlayerPed.Position; }
public static async Task Godmode() { Logger.Log("Checking if GodmodeCheck is running", Logger.LogLevel.DEBUG); if (Detections.IsGodmodeCheckRunning) { return; } Logger.Log("Executed GodmodeCheck.", Logger.LogLevel.DEBUG); Detections.IsGodmodeCheckRunning = true; await BaseScript.Delay(1250); if (!API.IsPedDeadOrDying(API.PlayerPedId(), true)) { int armour = API.GetPedArmour(API.PlayerPedId()); if (API.GetPlayerMaxArmour(API.PlayerId()) > 100) { ViolationManager.SendViolation(ViolationType.PLAYER_GODMODE); } int currentHealth = API.GetEntityHealth(API.PlayerPedId()); if (currentHealth > 200) { ViolationManager.SendViolation(ViolationType.PLAYER_GODMODE); } if (API.GetPlayerInvincible(API.PlayerPedId())) { ViolationManager.SendViolation(ViolationType.PLAYER_GODMODE); } if (API.GetUsingseethrough() || API.GetUsingseethrough()) { ViolationManager.SendViolation(ViolationType.NIGHT_VISION); } } Detections.IsGodmodeCheckRunning = false; }