Your ping remains the same when you're lagging, no one seems to understand.
if(!%this.player.isGrounded())
if(%this.newPos $= %this.oldPos)
if(%this.newVel $= %this.oldVel)
if(%this.newPing != %this.oldPing) <---------
%this.count++;
else
%this.count = 0;
else
%this.count = 0;
else
%this.count = 0;
Your position and velocity are also not whole numbers.
The problem with your hack detector is that it doesnt detect the ground sometimes (example: sitting on a ledge).
use this instead:
function Player::groundCheck(%this)
{
%mask = $TypeMasks::FxBrickObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::StaticObjectType | $TypeMasks::VehicleObjectType;
initContainerBoxSearch(vectorAdd(%this.getPosition(),"0 0 -1.7"),"1 1 3",%mask);
%object = containerSearchNext();
if(isObject(%object) && %object != SunLight.getId() && %object != %this.getId())
return 1;
return 0;
}
i had to add a check for the SunLight because for some reason it kept returning that ID to me when checking for the ground. any ideas why would be helpful, lol.