SA-MP Forums Archive
Anti-SAMPFUNC??? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti-SAMPFUNC??? (/showthread.php?tid=535958)



Anti-SAMPFUNC??? - Tantalio - 06.09.2014

my server is attacked with "SAMPFUNC" hack and crash players.


Re: Anti-SAMPFUNC??? - DaTa[X] - 06.09.2014

pawn Код:
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
{
    if( hittype == BULLET_HIT_TYPE_PLAYER )
    {
        if( !( -20.0 <= fX <= 20.0 ) || !( -20.0 <= fY <= 20.0 ) || !( -20.0 <= fZ <= 20.0 ) )
        {
            // kick or ban the crasher
            return 0;
        }
    }
    return 1;
}



Re: Anti-SAMPFUNC??? - Tantalio - 06.09.2014

Quote:
Originally Posted by DaTa[X]
Посмотреть сообщение
pawn Код:
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
{
    if( hittype == BULLET_HIT_TYPE_PLAYER )
    {
        if( !( -20.0 <= fX <= 20.0 ) || !( -20.0 <= fY <= 20.0 ) || !( -20.0 <= fZ <= 20.0 ) )
        {
            // kick or ban the crasher
            return 0;
        }
    }
    return 1;
}
I worked perfect, Thanks.


Re: Anti-SAMPFUNC??? - IstuntmanI - 06.09.2014

Quote:
Originally Posted by DaTa[X]
Посмотреть сообщение
pawn Код:
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
{
    if( hittype == BULLET_HIT_TYPE_PLAYER )
    {
        if( !( -20.0 <= fX <= 20.0 ) || !( -20.0 <= fY <= 20.0 ) || !( -20.0 <= fZ <= 20.0 ) )
        {
            // kick or ban the crasher
            return 0;
        }
    }
    return 1;
}
Next time better link to the topic: https://sampforum.blast.hk/showthread.php?tid=535559 .