Speed Hack detection

Think this is a good idea?

  • VAC IS SO 1337 IT STOPS EVERYTHING!

    Votes: 0 0.0%

  • Total voters
    7

CraniX

New Member
I have found out that when one speed hacks their game fps drops between 0-6 fps depending on how good of a rig you have. I would like some help in making a simple script that would kick a person when their fps drops to within that 0-6 fps range. Could you help me?
 
Personally, my fps goes up and down every single moment of the game, even if i'm just standing still looking at the sky.
 
My frames have never & I mean NEVER approched 10 FPS in the most laggy of servers, that is why I am suggesting a range of 0-6.
the way you worded your first post makes it seem like if I was rolling with 58 fps and dropped to 52 i'd get banned.
 
My frames have never & I mean NEVER approched 10 FPS in the most laggy of servers, that is why I am suggesting a range of 0-6.
I average about 30-40 on most servers but when you first join fps tends to be low for a few seconds and at random points so this might ban more legit players than hackers.
 
I average about 30-40 on most servers but when you first join fps tends to be low for a few seconds and at random points so this might ban more legit players than hackers.

SLEEP = 30; & I did not say anything about banning, I said "kick". Please read posts thoroughly before replying to them please.
 
My frames have never & I mean NEVER approched 10 FPS in the most laggy of servers, that is why I am suggesting a range of 0-6.
i have a moderately decent computer but an old graphics card and am usually around 25-30 fps. It does drop to 12-15 if I drive through a city with zombies spawned. and it gets barely playable at 12fps. So kicking a player with < 6fps would be doing them a favor anyways :p
So no problem.
If I start to record using fraps it does drop to zero fps or close to that for about 5 seconds so as long as you averaged your fps for 10 seconds or so, it would be okay I think.
 
well you can check the FPS like the debug monitor does and then all you need to to is kick when the FPS drops below 6fps

Example code

Code:
speedcheck = true;

while {speedcheck} do {

        FPS = round(diag_fps);

         if (FPS < 6) then {
                          //KICK PLAYER CODE HERE
          };
};
 
my friend says the client can't kick its self from the server so how else would you do this? setdamage 1 ???
 
@CraniX this may work (i saw your code and comment and modified mine :p

Code:
while {true} do {
    FPS = round(diag_fps);
    if (FPS < 6) then {
        LowFPS = true;
    }else{
        LowFPS = false;
    };
    sleep 10; // wait 10 seconds in case its a spike
    if (LowFPS)then {
        player setdamage 1; //kill offending player
    };
};

use the same way you would the debug monitor ( or even put it in your debug monitor code

UNTESTED

EDIT: Change code slightly
 
Last edited:
@CraniX this may work (i saw your code and comment and modified mine :p

Code:
while {true} do {
    FPS = round(diag_fps);
    if (FPS < 6) then {
        LowFPS = true;
    }else{
        LowFPS = false;
    };
    sleep 10; // wait 10 seconds in case its a spike
    if (LowFPS)then {
        player setdamage 1; //kill offending player
    };
};

use the same way you would the debug monitor ( or even put it in your debug monitor code

UNTESTED

EDIT: Change code slightly

Change code slightly more because in the above, LOWFPS is never rechecked after the 10 second delay, so it will always be true if it was true initially.
Code:
while {true} do {
    if ( ( round(diag_fps)) < 6) then {
              sleep 10; // wait 10 seconds in case its a spike
              if ( ( round(diag_fps)) < 6)then {
                          player setdamage 1; //kill offending player
                          };
               };
    };
The code checks for less than 6 fps. if its higher we ignore it. if its lower then it goes into the code block, waits 10 seconds then checks again. If its still < 6 fps then it kills the player.

If you wanted to have the server kick the player instead you would replace the setdamage = 1 line with

speedhacker = getplayeruid player;
publicvariable "speedhacker";

and the server would have a publicvariableeventhandler which would kick the player referred to in the speedhacker variable. OR it could write to the logs, or do something else just to track the player.
 
Last edited:
LOL I have seen endmission "loser"; a million times in the wasteland files but never put it together that it was a BIS function, always assumed it was a wasteland function, and completely forgot about it until I looked up the endmission.
Thanks!
 
You can kick someone from the server with a public variable. Here I've also added 'speedwalk' or 'teleport' detection as well.
Code:
while {true} do {
    _FPS = round(diag_fps);
    if (_FPS < 6) then {
        PVAHR_ = 'Kick';
        publicVariableClient "PVAHR_";//Kicks Player
    }else{
        sleep 10; // wait 10 seconds in case its a spike
    };
};
//Check if player is teleporting or 'Speedhacking'
while{true} do { //Open Loop
    _getpos = getpos player; //Get player position.
    uisleep 1.5; //Wait 1.5 seconds/
    _distance =  player distance _getpos; //Get the distance between the current position and the last position.
    if (_distance > 40 ) then { //Has the player moved 40 meters within one and a half seconds?
        PVAHR_ = 'Kick';
        publicVariableClient "PVAHR_";//Kick Player
    };//End IF
};//Close Loop
 
Code:
while{true} do { //Open Loop
    _getpos = getpos player; //Get player position.
    uisleep 1.5; //Wait 1.5 seconds/
    _distance =  player distance _getpos; //Get the distance between the current position and the last position.
    if (_distance > 40 ) then { //Has the player moved 40 meters within one and a half seconds?
        PVAHR_ = 'Kick';
        publicVariableClient "PVAHR_";//Kick Player
    };//End IF
};//Close Loop

Works until a legit player respawns after dying and gets kicked for teleporting because _distance > 40.
 
Last edited:
have to add in a delay to wait until fully spawned in

I'm new at this so here it goes.....

Code:
};while{true} do {
   _getpos = getpos player;
   uisleep 1.5;
   _distance =  player distance _getpos;
   if (player alive = false) then {
   sleep 30;
   }else{
   (_distance > 40 ) then {
   PVAHR_ = 'Kick';
   publicVariableClient "PVAHR_";//Kicks Player
     
  };
};
 
I'm new at this so here it goes.....

Code:
};while{true} do {
   _getpos = getpos player;
   uisleep 1.5;
   _distance =  player distance _getpos;
   if (player alive = false) then {
   sleep 30;
   }else{
   (_distance > 40 ) then {
   PVAHR_ = 'Kick';
   publicVariableClient "PVAHR_";//Kicks Player
    
  };
};
Code:
 if (player alive = false) then {
Should be
Code:
if !(alive player) then {

Here we can do it like this
Code:
while{true} do {
waitUntil { sleep 1; !isNil 'PVDZE_plr_LoginRecord' };
   _getpos = getpos player;
   uisleep 1.5;
   _distance =  player distance _getpos;
if  (_distance > 40 ) then {
   PVAHR_ = 'Kick';
   publicVariableClient "PVAHR_";//Kicks Player
  };
};
 
Back
Top