Comments (1)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alt-v-anticheat-guide.