static void CheckForSpeedHack(PlayerHack hack) { if (hack.Distance3D < minSpeedPerSecond) { return; } if (hack.VerticalDistance < -10f) { return; } if (hack.lastTickSpeed == hack.lastTick) { hack.speedHackDetections++; SendDetection(string.Format("{0} - {1} is being detected with: Speedhack ({2}m/s)", hack.player.userID.ToString(), hack.player.displayName, hack.Distance3D.ToString())); if (hack.speedHackDetections >= speedhackDetections) { if (speedhackPunish) { Punish(hack.player, string.Format("rSpeedhack ({0}m/s)", hack.Distance3D.ToString())); } } } else { hack.speedHackDetections = 0f; } hack.lastTickSpeed = hack.currentTick; }
static void CheckForHacks(PlayerHack hack) { if (speedhack) { CheckForSpeedHack(hack); } if (flyhack) { CheckForFlyhack(hack); } }
// Use this for initialization void Start() { bio = GetComponent <Biostim>(); Enemy = GameObject.FindGameObjectsWithTag("Enemy"); foreach (GameObject e in Enemy) { e.GetComponent <EnemyMili>(); } hack = GetComponentInChildren <PlayerHack>(); // state = false; s1 = Shader.Find("Standard"); s2 = Shader.Find("uSE - Refraction"); }
static void CheckForFlyhack(PlayerHack hack) { if (hack.isonGround) { return; } if (hack.player.transform.position.y < 5f) { return; } if (hack.VerticalDistance < -10f) { return; } if (UnityEngine.Physics.Raycast(hack.player.transform.position, VectorDown, 5f)) { return; } if (hack.lastTickFly == hack.lastTick) { hack.flyHackDetections++; SendDetection(string.Format("{0} - {1} is being detected with: Flyhack ({2}m/s)", hack.player.userID.ToString(), hack.player.displayName, hack.Distance3D.ToString())); if (hack.flyHackDetections >= flyhackDetections) { if (flyhackPunish) { Punish(hack.player, string.Format("rFlyhack ({0}m/s)", hack.Distance3D.ToString())); } } } else { hack.flyHackDetections = 0f; } hack.lastTickFly = hack.currentTick; }