04.09.2014, 18:28
(
Последний раз редактировалось IstuntmanI; 08.09.2014 в 15:54.
)
Originally posted there: http://forum.sa-mp.com/showpost.php?...4&postcount=14 .
-------------------
This fix is patching a hack which appeared few days ago. This hack crashes players when you are near them.
-------------------
I got this hack, and used it on a test server using a debug for OnPlayerWeaponShot, this is what it returned:
See those huge numbers ? Yeah... they are reported by that hack to the server. It is sent only with hittype BULLET_HIT_TYPE_PLAYER.
This is the fix:
I bet this will be patched in a future Release of 0.3z, but until then, feel free to use that fix.
-------------------
It's not really a tutorial, but I posted it there because in that topic (link in the first row there) almost nobody would see it.
-------------------
This fix is patching a hack which appeared few days ago. This hack crashes players when you are near them.
-------------------
I got this hack, and used it on a test server using a debug for OnPlayerWeaponShot, this is what it returned:
pawn Код:
OnPlayerWeaponShot(0,0,1,0,2004318080.000000,2004318080.000000,2004318080.000000)
This is the fix:
pawn Код:
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
{
if( hittype != BULLET_HIT_TYPE_NONE ) // Bullet Crashing uses just this hittype
{
if( !( -1000.0 <= fX <= 1000.0 ) || !( -1000.0 <= fY <= 1000.0 ) || !( -1000.0 <= fZ <= 1000.0 ) ) // a valid offset, it's impossible that a offset bigger than 1000 is legit (also less than -1000.0 is impossible, not used by this hack, but still, let's check for it, just for the future, who knows what hacks will appear). The object with biggest offset is having ~700-800 radius.
{
/*
If you want, here you can kick the cheater
*/
return 0; // let's desynchronize that bullet, so players won't crash
}
}
return 1;
}
-------------------
It's not really a tutorial, but I posted it there because in that topic (link in the first row there) almost nobody would see it.