package swol_exploitFix
{
function player::moveExploitCheckLoop(%pl)
{
cancel(%pl.moveExploitCheckSched);
%db = %pl.getDatablock();
if((%db.maxForwardSpeed >= 2 && %db.maxSideSpeed >= 2 && %db.maxBackwardSpeed >= 2 && %db.maxForwardCrouchSpeed >= 2 && %db.maxSideCrouchSpeed >= 2 && %db.maxBackwardCrouchSpeed >= 2))
{
%vel = %pl.getVelocity();
%x = getWord(%vel,0);
%y = getWord(%vel,1);
%z = getWord(%vel,2);
%moveSpeed = mAbs(%x) + mAbs(%y);
if(%z == 0 && %moveSpeed > 0.1 && %moveSpeed < 1.8 && !(getSimTime()-%pl.velAdd < 200))
{
%pl.hackMoveCount++;
}
else
{
if(%pl.hackMoveCount > 0)
%pl.hackMoveCount--;
}
if(%pl.hackMoveCount > 10)
{
centerPrint(%pl.client,"Stop using move glitches or you will be killed",1);
}
if(%pl.hackMoveCount > 15)
{
%pl.kill();
}
}
%pl.moveExploitCheckSched = %pl.schedule(50,moveExploitCheckLoop);
}
function gameConnection::createPlayer(%cl,%pos)
{
%cl.schedule(2,moveExploitCheck);
parent::createPlayer(%cl,%pos);
}
function gameConnection::moveExploitCheck(%cl)
{
if(!isObject(%pl = %cl.player))
return;
%pl.moveExploitCheckLoop();
}
function player::addVelocity(%pl,%vel)
{
%pl.velAdd = getSimTime();
parent::addVelocity(%pl,%vel);
}
function player::setVelocity(%pl,%vel)
{
%pl.velAdd = getSimTime();
parent::setVelocity(%pl,%vel);
}
};
activatePackage(swol_exploitFix);
I attempted to create a fix
it should theoretically work and requires that all of the players base movements are greater than 2 so if you have a really slow playertype people may still be able to abuse the glitch