Liberty Unleashed

Scripting => Script Snippets => Topic started by: Merk. on October 19, 2014, 08:53:41 pm

Title: Speedhack detection
Post by: Merk. on October 19, 2014, 08:53:41 pm
Code: [Select]
iTicks <- GetTickCount ( );
sBoolCalled <- false;
Cheating <- 0;

const MAX_SPEEDHACK_CHEAT_ATTEMPTS = 5;

function onClientRender ( ) {

local ticks = ( GetTickCount ( ) - iTicks );

if ( ticks > 1070 && ticks <= 2000 && sBoolCalled == false ) {

if ( Cheating >= MAX_SPEEDHACK_CHEAT_ATTEMPTS ) {

CallServerFunc ( "Some/Script.nut", "SomeFunction", FindLocalPlayer ( ) );

sBoolCalled = true;

return;
}

Cheating ++;
}

iTicks = GetTickCount ( );
}

Code tested and working.

Edit [20/11/2014]: Forgot add the last line.