Giter VIP home page Giter VIP logo

Comments (1)

bersek-777 avatar bersek-777 commented on August 27, 2024
const player = alt.Player.local;
let noclipviolation = 0

// exlude vehicles with caution! Some cheats know that noclipping in vehicles is safe!
if (!native.isPedRagdoll(player) && !player.vehicle && !native.isPedClimbing(player) && !natives.isPedInParachuteFreeFall(alt.Player.local.scriptID)) {
            // we try to get the actual ground position of the player. Sometimes the function fails due to roof etc.
            // may lead to issues in interiors or parking garages, make sure to test all possible locations and before only carefully execute automated bans
            let [_, height] = native.getGroundZFor3dCoord(player.pos.x, player.pos.y, player.pos.z, undefined, undefined);
            if (height == 0) [_, height] = native.getGroundZFor3dCoord(player.pos.x, player.pos.y, player.pos.z + 2, undefined, undefined);
            if (height == 0) [_, height] = native.getGroundZFor3dCoord(player.pos.x, player.pos.y, player.pos.z + 50, undefined, undefined);
            // If the game found no ground height the result is simply 0
            if (height != 0) {
                const heightdiff = player.pos.z - height;
                if (heightdiff < -3 || heightdiff > 10) {
                    // check if the player is swimming or at least over water and ignore it
                    const [waterprobe, ___] = native.testVerticalProbeAgainstAllWater(player.pos.x, player.pos.y, player.pos.z, 0, 30);
                    if(!waterprobe){ //if not over water and height difference above ground is too bad
                        noclipviolation++;
                    }
                } else {
                    noclipviolation = 0;
                }
                if (noclipviolation == 5) {
                    // Send Noclip detection to server
                    // Sending the detection after the first violation may lead to false positives, so we use 5 violations in a row
                }
            }
        }
``

from alt-v-anticheat-guide.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.