[FilterScript] nBug (Currently Patches CBug + Desync Bug)
#1



This is the easy solution to an annoying problem, it simply detects the keys and uses an animation to flip the player to avoid any further abuse.

Download.
Pastebin.

[ame]http://www.youtube.com/watch?v=8MD5a7hlO8I[/ame]

I didn't even put music into that video, it was playing in WMP when the video was recording. Fits it nicely though, right?
Reply
#2

Just checked script its quite accurate except that it can be evaded for a few times but 90% the player will get detected
Reply
#3

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
Just checked script its quite accurate except that it can be evaded for a few times but 90% the player will get detected
I've noticed that, but as you said it gets detected 90% of the times so they'll have problems abusing it anyway.

Not sure why it happens though.
Reply
#4

Nice RCON pass & nice script sir, I made something similar a while ago but never got to finishing it.
Reply
#5

Hold Key Fire and the System is not working!
Reply
#6

This is quite easy to evade. I made one like this as a test a while ago, utilizing GetPlayerAnimationIndex.

This blocks C-Bug and the most common infinity bugs (no-reload).

pawn Код:
#include <a_samp>

#define WEAPON_UNARMED  ( 0 )
#define KEY_AIM         ( 128 )

enum ePlayerInfo
{
    bool:isCrouched,
    bool:isFiring,
         iCrouchTime,
         iLastFire,
         iLastFiring,
         iLastStrafeFire
};

new
    PlayerInfo[ MAX_PLAYERS ][ ePlayerInfo ]
;

public OnFilterScriptInit( )
{
    new
        iTick = GetTickCount( )
    ;
   
    for ( new i = 0; i < MAX_PLAYERS; i++ )
    {
        PlayerInfo[ i ][ isCrouched      ] = false;
        PlayerInfo[ i ][ iLastFire       ] = iTick;
        PlayerInfo[ i ][ iLastStrafeFire ] = iTick;
    }
   
    return 1;
}

public OnPlayerConnect( playerid )
{
    new
        iTick = GetTickCount( )
    ;
   
    PlayerInfo[ playerid ][ isCrouched      ] = false;
    PlayerInfo[ playerid ][ isFiring        ] = false;
    PlayerInfo[ playerid ][ iLastFire       ] = iTick;
    PlayerInfo[ playerid ][ iLastFiring     ] = iTick;
    PlayerInfo[ playerid ][ iLastStrafeFire ] = iTick;
   
    return 1;
}

public OnPlayerUpdate( playerid )
{
    new
             iTick = GetTickCount( ),
             iAnimationIndex = GetPlayerAnimationIndex( playerid ),
             iWeapon = GetPlayerWeapon( playerid ),
             iKeys,
             iKeysUD,
             iKeysLR
    ;
   
    GetPlayerKeys( playerid, iKeys, iKeysUD, iKeysLR );
   
    if ( ( iKeys & KEY_FIRE ) || ( ( iKeys & KEY_ACTION ) && ( iKeys & KEY_AIM ) ) )
    {
        PlayerInfo[ playerid ][ iLastFire ] = iTick;
       
        if ( !PlayerInfo[ playerid ][ isFiring ] )
        {
            PlayerInfo[ playerid ][ isFiring ] = true;
           
            PlayerInfo[ playerid ][ iLastFiring ] = iTick;
        }
    }
    else if ( PlayerInfo[ playerid ][ isFiring ] )
        PlayerInfo[ playerid ][ isFiring ] = false;
   
    switch ( iAnimationIndex )
    {
        case 1274: // WEAPON_CROUCH
        {
            if ( !PlayerInfo[ playerid ][ isCrouched ] )
            {
                PlayerInfo[ playerid ][ isCrouched ] = true;
               
                PlayerInfo[ playerid ][ iCrouchTime ] = iTick;
            }
           
            if ( iWeapon && ( iKeys & KEY_FIRE ) && iTick - PlayerInfo[ playerid ][ iCrouchTime ] > 300 )
                ClearAnimations( playerid );
        }
       
        case 1160 .. 1163, 1167: // GUNMOVE_L/R/FWD/BWD, GUN_STAND
        {
            if ( ( iKeys & KEY_FIRE ) )
            {
                switch ( iWeapon )
                {
                    case
                        WEAPON_SILENCED,
                        WEAPON_DEAGLE,
                        WEAPON_SHOTGUN,
                        WEAPON_SHOTGSPA,
                        WEAPON_MP5,
                        WEAPON_M4,
                        WEAPON_AK47,
                        WEAPON_RIFLE,
                        WEAPON_SNIPER:
                    {
                        PlayerInfo[ playerid ][ iLastStrafeFire ] = iTick;
                    }
                }
            }
        }
       
        case
            1231, // RUN_PLAYER
            1223, // RUN_ARMED
            1141, // FIGHTA_M
            478,  // FIGHTB_M
            489,  // FIGHTC_M
            500,  // FIGHTD_M
            759,  // KNIFE_PART
            27,   // BAT_PART
            1554  // SWORD_PART
            :  
        {
            switch ( GetWeaponSlot( iWeapon ) )
            {
                case 0, 1, 8, 9, 10, 11, 12:
                {
                   
                }
                default:
                {
                    if ( ( iKeys & KEY_AIM ) && ( iKeys & KEY_ACTION ) )
                        ClearAnimations( playerid );
                    else if ( PlayerInfo[ playerid ][ isFiring ] && iTick - PlayerInfo[ playerid ][ iLastFiring ] > 150 )
                        ClearAnimations( playerid );
                }
            }
        }
    }
   
    if ( ( iKeys & KEY_CROUCH ) && iTick - PlayerInfo[ playerid ][ iLastStrafeFire ] < 500 )
    {
        ClearAnimations( playerid );
       
        ApplyAnimation( playerid, "PED", "XPRESSscratch", 0.0, 1, 0, 0, 0, 500 - ( iTick - PlayerInfo[ playerid ][ iLastStrafeFire ] ), 1 );
    }
   
    if ( PlayerInfo[ playerid ][ isCrouched ] && iAnimationIndex != 1274 ) // WEAPON_CROUCH
        PlayerInfo[ playerid ][ isCrouched ] = false;
   
    return 1;
}

stock GetWeaponSlot( iWeapon )
{
    switch ( iWeapon )
    {
        case  0,      1: return  0; // Unarmed
        case  2  ..   9: return  1; // Melee
        case 22  ..  24: return  2; // Pistol
        case 25  ..  27: return  3; // Shotgun
        case 28, 29, 32: return  4; // SMG
        case 30,     31: return  5; // Machinegun
        case 33,     34: return  6; // Rifle
        case 35  ..  38: return  7; // Heavy
        case 16, 18, 39: return  8; // Projectile
        case 42,     43: return  9; // Special
        case 14        : return 10; // Gifts
        case 44  ..  46: return 11; // Special
        case 40        : return 12; // Detonator
    }
   
    return 0;
}
Reply
#7

Quote:
Originally Posted by g_aSlice
Посмотреть сообщение
Long Quote
Nice sir, this is just a simple script that does the job.

Wouldn't using that bulk amount of code on OnPlayerUpdate lag?
Reply
#8

Quote:
Originally Posted by Norn
Посмотреть сообщение
Nice sir, this is just a simple script that does the job.

Wouldn't using that bulk amount of code on OnPlayerUpdate lag?
I guess so but it will be 100% accurate.

No need for that accurate? ++ I also think it would lag tons.
Reply
#9

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
I guess so but it will be 100% accurate.

No need for that accurate? ++ I also think it would lag tons.
True, nice work though I like it.
Reply
#10

Quote:
Originally Posted by Norn
Посмотреть сообщение
Nice sir, this is just a simple script that does the job.

Wouldn't using that bulk amount of code on OnPlayerUpdate lag?
I did a test where that code was being repeated 1000 times each OnPlayerUpdate and it would take 2-3 ms for it to finish. When I repeated it 500 times, it only took 0-1 ms. It's safe to say it doesn't cause any lag.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)