Problem With Anti-2Shot (Sawns)
#2

That appears to be slice's anti-2shot script he wrote a while ago. Try lowering the punishment threshold a bit.
#define PUNISH_THRESOLD (2500). I extensively tested this a few years ago and there were no flaws in it. While your at it, use this:
pawn Код:
public OnPlayerUpdate( iPlayer )
{
    static
        s_iState,
        s_iSpecialAction
    ;

    s_iState = GetPlayerState( iPlayer );
    s_iSpecialAction = GetPlayerSpecialAction( iPlayer );

    if ( s_iState == PLAYER_STATE_ONFOOT && ( s_iSpecialAction == SPECIAL_ACTION_NONE || s_iSpecialAction == SPECIAL_ACTION_DUCK ) )
    {
        static
            s_iWeapon,
            s_iAmmo
        ;

        s_iWeapon = GetPlayerWeapon( iPlayer );
        s_iAmmo = GetPlayerAmmo( iPlayer );

        if ( g_cPreviousWeapon{ iPlayer } != s_iWeapon )
        {
            if ( g_cPreviousWeapon{ iPlayer } == WEAPON_SAWEDOFF )
            {
                if ( Bit_Get( g_abIsSawnoffClipUsed, iPlayer ) )
                {
                    static
                        s_iWeaponState
                    ;

                    s_iWeaponState = GetPlayerWeaponState( iPlayer );

                    if ( ( s_iWeaponState == WEAPONSTATE_MORE_BULLETS || s_iWeaponState == WEAPONSTATE_LAST_BULLET ) && g_cFiredShots{ iPlayer } != 4 )
                    {
                        Bit_Let( g_abThisBitchDidntReload, iPlayer );

                        g_iReloadEvadeTime[ iPlayer ] = GetTickCount( );
                    }
                }

                g_cFiredShots{ iPlayer } = 0;
            }
            else if ( s_iWeapon == WEAPON_SAWEDOFF )
            {
                if ( Bit_Get( g_abThisBitchDidntReload, iPlayer ) )
                {
                    if ( GetTickCount( ) - g_iReloadEvadeTime[ iPlayer ] < PUNISH_THRESOLD )
                    {
                        new
                            Float:fVX,
                            Float:fVY,
                            Float:fVZ
                        ;

                        GetPlayerVelocity( iPlayer, fVX, fVY, fVZ );

                        if ( floatabs( fVZ ) < 0.15 )
                        {
                            new string[65 + MAX_PLAYER_NAME];
                            switch(sWarns[playerid])
                            {
                                case 0:
                                {
                                    sWarns[playerid]++;
                                    GameTextForPlayer(playerid, "~r~2 shot Detected!", 3500, 3);
                                    format(string, sizeof(string), "(SERVER COMPLAINT) %s (%d) May Be Possibly Using 2 Shot.", PlayerInfo[playerid][pName],playerid);
                                    SendClientMessageToAdmins(COLOR_ADMIN, string);
                                    PlayerInfo[playerid][pWarnTime] = 80;
                                }
                                case 1:
                                {
                                    if(PlayerInfo[playerid][pWarnTime] < 1)
                                    {
                                        sWarns[playerid]++;
                                        format(string, sizeof(string), "(SERVER COMPLAINT) %s (%d) May Be Possibly Using 2 Shot.", PlayerInfo[playerid][pName],playerid);
                                        SendClientMessageToAdmins(COLOR_ADMIN, string);
                                        PlayerInfo[playerid][pWarnTime] = 140;
                                    }
                                }
                                case 2:
                                {
                                    if(PlayerInfo[playerid][pWarnTime] < 1)
                                    {
                                        sWarns[playerid]++;
                                        format(string, sizeof(string), "(SERVER COMPLAINT) %s (%d) May Be Possibly Using 2 Shot.", PlayerInfo[playerid][pName],playerid);
                                        SendClientMessageToAdmins(COLOR_ADMIN, string);
                                        PlayerInfo[playerid][pWarnTime] = 240;
                                    }
                                }
                                case 3:
                                {
                                    if(PlayerInfo[playerid][pWarnTime] < 1)
                                    {
                                        sWarns[playerid]++;
                                        format(string, sizeof(string), "(SERVER COMPLAINT) %s (%d) May Be Possibly Using 2 Shot.", PlayerInfo[playerid][pName],playerid);
                                        SendClientMessageToAdmins(COLOR_ADMIN, string);
                                        PlayerInfo[playerid][pWarnTime] = 520;
                                    }
                                }
                                case 4:
                                {
                                    if(PlayerInfo[playerid][pWarnTime] < 1)
                                    {
                                        format(string, sizeof(string), "(SERVER COMPLAINT) %s (%d) May Be Possibly Using 2 Shot.", PlayerInfo[playerid][pName],playerid);
                                        SendClientMessageToAdmins(COLOR_ADMIN, string);
                                        PlayerInfo[playerid][pWarnTime] = 720;
                                    }
                                }
                            }
                        }
                    }

                    Bit_Vet( g_abThisBitchDidntReload, iPlayer );
                }
            }

            g_cPreviousWeapon{ iPlayer } = s_iWeapon;
        }

        if ( s_iWeapon == WEAPON_SAWEDOFF )
        {
            if ( g_iSawnoffAmmo[ iPlayer ] == -1 )
                g_iSawnoffAmmo[ iPlayer ] = GetPlayerAmmo( iPlayer );
            else
            {
                if ( GetPlayerWeaponState( iPlayer ) == WEAPONSTATE_RELOADING )
                {
                    if ( Bit_Get( g_abIsSawnoffClipUsed, iPlayer ) )
                        Bit_Vet( g_abIsSawnoffClipUsed, iPlayer );
                }
                else
                {
                    if ( g_iSawnoffAmmo[ iPlayer ] != s_iAmmo )
                    {
                        if ( s_iAmmo < g_iSawnoffAmmo[ iPlayer ] )
                        {
                            Bit_Let( g_abIsSawnoffClipUsed, iPlayer );

                            g_cFiredShots{ iPlayer } += g_iSawnoffAmmo[ iPlayer ] - s_iAmmo;
                        }
                        else
                        {
                            g_cFiredShots{ iPlayer } = 0;

                            Bit_Vet( g_abIsSawnoffClipUsed, iPlayer );
                        }

                        g_iSawnoffAmmo[ iPlayer ] = s_iAmmo;
                    }
                }
            }
        }
        else if ( g_iSawnoffAmmo[ iPlayer ] != -1 || Bit_Get( g_abIsSawnoffClipUsed, iPlayer ) )
        {
            g_iSawnoffAmmo[ iPlayer ] = -1;

            Bit_Vet( g_abIsSawnoffClipUsed, iPlayer );

            g_cFiredShots{ iPlayer } = 0;
        }
    }
    else if ( g_iSawnoffAmmo[ iPlayer ] != -1 || Bit_Get( g_abIsSawnoffClipUsed, iPlayer ) )
    {
        g_iSawnoffAmmo[ iPlayer ] = -1;

        Bit_Vet( g_abIsSawnoffClipUsed, iPlayer );

        g_cFiredShots{ iPlayer } = 0;
    }

    return 1;
}
switch and case statements are better than if statements (faster and neater), I also lowered your string size as 256 is not needed period.
Reply


Messages In This Thread
Problem With Anti-2Shot (Sawns) - by Airman123 - 20.04.2015, 08:44
Re: Problem With Anti-2Shot (Sawns) - by Banana_Ghost - 21.04.2015, 05:08
Re: Problem With Anti-2Shot (Sawns) - by Airman123 - 23.04.2015, 09:47
Re: Problem With Anti-2Shot (Sawns) - by ball - 23.04.2015, 11:13
Re: Problem With Anti-2Shot (Sawns) - by Airman123 - 24.04.2015, 07:43

Forum Jump:


Users browsing this thread: 1 Guest(s)