I have one plugin for my server doing this things:
1: If one cheater using cheat for flyhack like ladder one, he gets kicked instantly (working good)
what the """error""", """bug"""?
If one player place a Mining Quarry and climb the ladder up the player is instantly kicked...
If anyone can help me fix it, I'll be eternally grateful Thanks you
Code:
using System;
using System.Collections.Generic;
using System.Linq;
namespace Oxide.Plugins
{
[Info("LadderFlyKick", "Sergioklv", "1.0.0")]
class LadderFlyKick : RustPlugin
{
private static List<ulong> LastDetect = new List<ulong>();
private void OnServerInitialized() => RunCheckLadder();
private void RunCheckLadder()
{
var affectPlayers = BasePlayer.activePlayerList.Where(x=> !x.IsSleeping() && !x.IsDead() && !x.HasPlayerFlag(BasePlayer.PlayerFlags.ReceivingSnapshot) && x.modelState.onLadder && x.FindTrigger<TriggerLadder>() == null).ToList();
foreach(var player in affectPlayers)
{
if (LastDetect.Contains(player.userID))
{
Puts($"Jugador {player.displayName} ({player.userID}) Fue kickeado por usar: FlyHack");
player.Kick("Fly hack dected?");
}
else
LastDetect.Add(player.userID);
}
LastDetect.RemoveAll(x=> !affectPlayers.Exists(y=> y.userID == x));
timer.Once(4f, RunCheckLadder);
}
}
}