Raised This Month: $51 Target: $400
 12% 

Accuracy Fix


Post New Thread Reply   
 
Thread Tools Display Modes
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 06-22-2014 , 06:39   Re: Accuracy Fix
Reply With Quote #111

Updated to 3.0
Added: Fix for glock wrong movement condition accuracy when in burst mode.

(875 downloads reset)

It's simple... When in burst-mode with glock you were more accurate while moving, than while standing still.
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 06-22-2014 at 06:40.
MPNumB is offline
Send a message via Skype™ to MPNumB
souvikdas95
Senior Member
Join Date: Mar 2012
Old 07-06-2014 , 23:47   Re: Accuracy Fix
Reply With Quote #112

Another thing I noticed is that, for players who don't get a steady network graph ( chokes and/or losses and/or spikes as observed from net_graph 1 ) appear to have almost zero accuracy with the plugin. however without it, atleast a few shots strike. why so?

Sometimes with large no. of players on the server, and CPU usage striking near around 90%, similar thing happens for all players on the server.

Lastly, could you do something about this issue : https://github.com/ValveSoftware/halflife/issues/1183

Last edited by souvikdas95; 07-06-2014 at 23:57.
souvikdas95 is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 07-08-2014 , 07:09   Re: Accuracy Fix
Reply With Quote #113

Quote:
Originally Posted by souvikdas95 View Post
Another thing I noticed is that, for players who don't get a steady network graph ( chokes and/or losses and/or spikes as observed from net_graph 1 ) appear to have almost zero accuracy with the plugin. however without it, atleast a few shots strike. why so?

Sometimes with large no. of players on the server, and CPU usage striking near around 90%, similar thing happens for all players on the server.

Lastly, could you do something about this issue : https://github.com/ValveSoftware/halflife/issues/1183
Cause ping is a random thing, and every player would rather blame some plugin, than their own inability to adapt to hard situations or ping, even if the plugin has nothing to do with it - math doesn't lie.

High server CPU usage... That includes delays, so basically the same thing.

Ping by itself has a a factor of client-side not predicting the weapon punchangle (recoil part where crosshair goes up/down, left/right). Even if there is a little punchangle and ping high enough to effect the gameplay enough for it to have a significant visual effect (usually above 30), the bullets wont go where person thinks they will, when in recoil. And there's nothing this plugin has to do with any of it.

Tell you this, if anyone who has this plugin installed really 'feels' that it makes the gameplay worse, please remove it. I know for a fact, it improves the gameplay (math is math), and players will be players, and blame everything they can if they have a bad game (even if the thing they are blaming has nothing negative to do with their game). Seen the demos, read the description? That's what my plugin does exactly - no more "and"'s, no more "but"'s. Just that, performing that job to the fullest extend - no catches, nothing more or less.

// EDIT:

That animation thing is just that - an animation thing when client-side and server-side doesn't agree. That glitch existed for a long time already, and I don't know no way of how to fix it.

And just in case, I've even reported bugs what this plugin fixes to VALVe, here.

Plus I've also reported that issue where client-side doesn't predict the recoil and everything gets messed up while in recoil when in high ping - link.
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 07-08-2014 at 07:18.
MPNumB is offline
Send a message via Skype™ to MPNumB
Old 07-17-2014, 10:00
souvikdas95
This message has been deleted by souvikdas95. Reason: nvm
souvikdas95
Senior Member
Join Date: Mar 2012
Old 07-24-2014 , 03:08   Re: Accuracy Fix
Reply With Quote #114

@MPNumb - can you do something about knife headshots?
souvikdas95 is offline
Old 07-27-2014, 00:37
souvikdas95
This message has been deleted by hornet. Reason: Wait 14 days before you bump
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 08-02-2014 , 17:19   Re: Accuracy Fix
Reply With Quote #115

Knife headshots aren't bullet based things, therefor it's not related to this plugin (at least in my opinion). Knife attack trace (scan) is basically a ducked player moving few units in front of where you are aiming. The first hitbox the scan-box will hit, will be the hitbox knife attack hits. Simple as that, and I know it's not a best or most logical way, but it's not something for this plugin to edit/modify.
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 08-02-2014 at 17:19.
MPNumB is offline
Send a message via Skype™ to MPNumB
coolmans
Member
Join Date: Sep 2009
Old 12-23-2014 , 07:20   Re: Accuracy Fix
Reply With Quote #116

I did not understand where to write cl_lw 0, the client? Server 6153 build topical?
coolmans is offline
Warlord_dd2
Junior Member
Join Date: Oct 2013
Old 12-24-2014 , 09:44   Re: Accuracy Fix
Reply With Quote #117

Hello,

I have a little bit unusual problem, and I need your help.

Namely, I have placed the plugin on the server and it works, and as I am guy with solid net connection + not really of a crying sort, it probably works little bit worse for me, but I do not really care as I am in CS for hanging around with friends and not really for the game itself.

Now, let me get to the problem:
- Majority likes what plugin does, but majority is consisted mostly of players with less skill
- Many of the players with more skill find plugin doing badly

For that reason, I was thinking to make a console command where everyone who wants, can turn off the plugin for himself, and I envisioned it this way:

- To make array (g_blocked[33]) where I will record who wants the plugin up and who doesn't, with default 0 for non blocking and 1 for blocking

- To make command amx_blockfix that will block it on/off (1/0), and store in the g_blocked[id].

- To put on top of every function in the following simple check:
Code:
if(g_blocked[id])
        return
However, I have realized that due to predefined ifs it might not work as I planned, and therefore I am asking you if you can help me with a proper way to turn off the fix for people who want it that way, and keep it on for the rest of the people.

Tanks in advanced
Warlord_dd2 is offline
flaxo
Member
Join Date: Nov 2013
Old 12-24-2014 , 12:28   Re: Accuracy Fix
Reply With Quote #118

Is this plugin still needed for HLDS build 6153?
__________________
FastDL hosting for FREE. Just drop me a PM ;)
flaxo is offline
ViBE
Member
Join Date: Jul 2011
Location: Somewhere over the...
Old 12-27-2014 , 10:14   Re: Accuracy Fix
Reply With Quote #119

Quote:
Originally Posted by flaxo View Post
Is this plugin still needed for HLDS build 6153?
the bug is still exists. so it's on you what's needed and what's not.
ViBE is offline
Send a message via ICQ to ViBE
Warlord_dd2
Junior Member
Join Date: Oct 2013
Old 01-10-2015 , 08:56   Re: Accuracy Fix
Reply With Quote #120

Ah well, since my request has been ignored, I did it by myself, so if anyone is interested on how to turn off the plugin for just some people, you have entire code right here:

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN_NAME    "Accuracy Fix (with off option)"
#define PLUGIN_VERSION    "3.0"
#define PLUGIN_AUTHOR    "Numb"

#define SMOOTH_SPREAD_TRANSITION
#define LOW_FPS_SPREAD_COOLDOWN_FIX

#define m_pPlayer 41
#define m_flAccuracy 62
#define m_flLastFire 63
#define m_iShotsFired 64
#define m_fWeaponState 74
#define WEAPONSTATE_GLOCK18_BURST_MODE (1<<1)
#define m_flDecreaseShotsFired 76

new Float:g_fAccuracy;
#if defined LOW_FPS_SPREAD_COOLDOWN_FIX
new Float:g_fOldDecreaseShotsFired;
new 
g_iOldShotsFired;
#endif
new bool:g_bGlockDuckRemoved;
new 
bool:g_bGlockVelocityChanged;
new 
Float:g_fGlockVelocity[3];
new 
g_accbl[33], g_maxplayers


public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    
    
register_cvar("accuracy_fix"PLUGIN_VERSION, (FCVAR_SERVER|FCVAR_SPONLY));
    
#if defined LOW_FPS_SPREAD_COOLDOWN_FIX
    
RegisterHam(Ham_Item_PostFrame"weapon_ak47",    "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_aug",     "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_famas",   "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_galil",   "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_m249",    "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_m4a1",    "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_mac10",   "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_mp5navy""Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_p90",     "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_sg552",   "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_tmp",     "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_ump45",   "Ham_PostFrame_Pre"0);
    
RegisterHam(Ham_Item_PostFrame"weapon_ak47",    "Ham_PostFrame_Pre"0);
    
    
RegisterHam(Ham_Item_PostFrame"weapon_aug",     "Ham_PostFrame_Post"1);
    
RegisterHam(Ham_Item_PostFrame"weapon_famas",   "Ham_PostFrame_Post"1);
    
RegisterHam(Ham_Item_PostFrame"weapon_galil",   "Ham_PostFrame_Post"1);
    
RegisterHam(Ham_Item_PostFrame"weapon_m249",    "Ham_PostFrame_Post"1);
    
RegisterHam(Ham_Item_PostFrame"weapon_m4a1",    "Ham_PostFrame_Post"1);
    
RegisterHam(Ham_Item_PostFrame"weapon_mac10",   "Ham_PostFrame_Post"1);
    
RegisterHam(Ham_Item_PostFrame"weapon_mp5navy""Ham_PostFrame_Post"1);
    
RegisterHam(Ham_Item_PostFrame"weapon_p90",     "Ham_PostFrame_Post"1);
    
RegisterHam(Ham_Item_PostFrame"weapon_sg552",   "Ham_PostFrame_Post"1);
    
RegisterHam(Ham_Item_PostFrame"weapon_tmp",     "Ham_PostFrame_Post"1);
    
RegisterHam(Ham_Item_PostFrame"weapon_ump45",   "Ham_PostFrame_Post"1);
#endif
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_ak47",      "Ham_Attack_ak47_Pre",    0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_aug",       "Ham_Attack_aug_Pre",     0);
    
    
// awp accuracy offset does not exist
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_deagle",    "Ham_Attack_deagle_Pre",  0);
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_deagle",    "Ham_Attack_deagle_Post"1);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_elite",     "Ham_Attack_elite_Pre",   0);
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_elite",     "Ham_Attack_elite_Post",  1);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_famas",     "Ham_Attack_famas_Pre",   0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_fiveseven""Ham_Attack_57_Pre",      0);
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_fiveseven""Ham_Attack_57_Post",     1);
    
    
// g3sg1 accuracy offset has no effect
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_galil",     "Ham_Attack_galil_Pre",   0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_glock18",   "Ham_Attack_glock_Pre",   0);
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_glock18",   "Ham_Attack_glock_Post",  1);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_m249",      "Ham_Attack_m249_Pre",    0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_m4a1",      "Ham_Attack_m4a1_Pre",    0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_mac10",     "Ham_Attack_mac10_Pre",   0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_mp5navy",   "Ham_Attack_mp5_Pre",     0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_p228",      "Ham_Attack_p228_Pre",    0);
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_p228",      "Ham_Attack_p228_Post",   1);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_p90",       "Ham_Attack_p90_Pre",     0);
    
    
// scout accuracy offset does not exist
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_scout",     "Ham_Attack_scout_Pre",   0);
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_scout",     "Ham_Attack_scout_Post",  1);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_sg550",     "Ham_Attack_sg550_Pre",   0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_sg552",     "Ham_Attack_sg552_Pre",   0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_tmp",       "Ham_Attack_tmp_Pre",     0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_ump45",     "Ham_Attack_ump45_Pre",   0);
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_usp",       "Ham_Attack_usp_Pre",     0);
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_usp",       "Ham_Attack_usp_Post",    1);
    
    
register_clcmd("amx_blockfix""cmd_blockfix"0"<command><1 or 0> - command that allows player to turn the fix off for himself")
    
register_clcmd("amx_accfix_status""cmd_accfix_status"ADMIN_BAN"Displays all users who have blocked the plugin")
    
    
g_maxplayers get_maxplayers()
}

public 
plugin_unpause()
{
    
g_fAccuracy 0.0;
#if defined LOW_FPS_SPREAD_COOLDOWN_FIX
    
g_fOldDecreaseShotsFired 0.0;
    
g_iOldShotsFired 0;
#endif
    
    
g_bGlockDuckRemoved false;
    
g_bGlockVelocityChanged false;
}

#if defined LOW_FPS_SPREAD_COOLDOWN_FIX
public Ham_PostFrame_Pre(iEnt)
{
    if(
g_accbl[get_pdata_cbase(iEntm_pPlayer4)])
        return
    
    if( 
pev(get_pdata_cbase(iEntm_pPlayer4), pev_button)&IN_ATTACK )
    {
        
g_fOldDecreaseShotsFired 0.0;
        
g_iOldShotsFired 0;
    }
    else
    {
        
g_fOldDecreaseShotsFired get_pdata_float(iEntm_flDecreaseShotsFired4);
        if( 
g_fOldDecreaseShotsFired<get_gametime() )
            
g_iOldShotsFired get_pdata_int(iEntm_iShotsFired4);
        else
        {
            
g_fOldDecreaseShotsFired 0.0;
            
g_iOldShotsFired 0;
        }
    }
}

public 
Ham_PostFrame_Post(iEnt)
{    
    if(
g_accbl[get_pdata_cbase(iEntm_pPlayer4)])
        return
    
    if( 
g_iOldShotsFired>&& g_fOldDecreaseShotsFired>0.0 )
    {
        static 
s_iShotsFired;
        
s_iShotsFired get_pdata_int(iEntm_iShotsFired4);
        
        if( 
g_iOldShotsFired>s_iShotsFired>)
        {
            static 
Float:s_fDecreaseShotsFired;
            
s_fDecreaseShotsFired get_pdata_float(iEntm_flDecreaseShotsFired4);
            
            if( 
s_fDecreaseShotsFired>g_fOldDecreaseShotsFired )
            {
                static 
Float:s_fGameTime;
                
s_fGameTime get_gametime();
                
                if( 
s_fDecreaseShotsFired>s_fGameTime )
                {
                    static 
Float:s_fDelay;
                    
s_fDelay = (s_fDecreaseShotsFired-s_fGameTime);
                    
s_fDecreaseShotsFired -= (s_fGameTime-g_fOldDecreaseShotsFired);
                    
                    
/*while( s_fDecreaseShotsFired<s_fGameTime ) // may not be super CPU friendly, if some other plugin messes things up
                    {
                        s_fDecreaseShotsFired += s_fDelay;
                        s_iShotsFired--;
                        
                        if( s_iShotsFired<=0 )
                            break;
                    }
                    
                    set_pdata_float(iEnt, m_flDecreaseShotsFired, s_fDecreaseShotsFired, 4);
                    set_pdata_int(iEnt, m_iShotsFired, s_iShotsFired, 4);*/
                    
                    
if( s_fDecreaseShotsFired<s_fGameTime // 'a bit' more complicated way, but does the same thing
                    
{
                        static 
s_iDecreaseCount;
                        
s_iDecreaseCount floatround(((s_fGameTime-s_fDecreaseShotsFired)/s_fDelay), floatround_ceil);
                        
                        if( 
s_iDecreaseCount>s_iShotsFired )
                            
s_iDecreaseCount s_iShotsFired;
                        
                        
set_pdata_float(iEntm_flDecreaseShotsFired, (s_fDecreaseShotsFired+(float(s_iDecreaseCount)*s_fDelay)), 4);
                        
set_pdata_int(iEntm_iShotsFired, (s_iShotsFired-s_iDecreaseCount), 4);
                    }
                    else
                        
set_pdata_float(iEntm_flDecreaseShotsFireds_fDecreaseShotsFired4);
                }
            }
        }
    }
}
#endif


public Ham_Attack_ak47_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired*s_iShotsFired)/200.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.153));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired*s_iShotsFired)/200.0)+0.35;
#endif
        
        
if( g_fAccuracy>1.25 )
            
g_fAccuracy 1.25;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iFlagss_iOwner
        s_iOwner 
get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}

public 
Ham_Attack_aug_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired*s_iShotsFired)/215.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.12));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired*s_iShotsFired)/215.0)+0.3;
#endif
        
        
if( g_fAccuracy>1.0 )
            
g_fAccuracy 1.0;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}


public 
Ham_Attack_deagle_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return    
    
    static 
Float:s_fLastFire;
    
s_fLastFire get_pdata_float(iEntm_flLastFire4);
    if( !
s_fLastFire )
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
g_fAccuracy 1.0;
                else
                    
g_fAccuracy 0.96;
            }
            else
                
g_fAccuracy 0.92;
        }
        else
            
g_fAccuracy 0.92;
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else if( 
get_pdata_int(iEntm_iShotsFired4)<=)
    {
        
g_fAccuracy get_pdata_float(iEntm_flAccuracy4);
        
g_fAccuracy -= (0.4-(get_gametime()-s_fLastFire))*0.35;
        
        if( 
g_fAccuracy<0.55 )
            
g_fAccuracy 0.55;
        else if( 
g_fAccuracy>0.92 )
        {
            static 
s_iOwners_iFlags;
            
s_iOwner get_owner
            s_iFlags 
pev(s_iOwnerpev_flags);
            
            if( 
s_iFlags&FL_ONGROUND )
            {
                static 
Float:s_fVelocity[3];
                
pev(s_iOwnerpev_velocitys_fVelocity);
                
                if( !
s_fVelocity[0] && !s_fVelocity[1] )
                {
                    if( 
s_iFlags&FL_DUCKING )
                    {
                        if( 
g_fAccuracy>1.0 )
                            
g_fAccuracy 1.0;
                    }
                    else if( 
g_fAccuracy>0.96 )
                        
g_fAccuracy 0.96;
                }
                else
                    
g_fAccuracy 0.92;
            }
            else
                
g_fAccuracy 0.92;
        }
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
    }
    else
        
g_fAccuracy = -1.0;
}

public 
Ham_Attack_deagle_Post(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    if( 
g_fAccuracy>0.92 )
        
set_pdata_float(iEntm_flAccuracy 0.924);
    else if( 
g_fAccuracy>0.0 )
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
}


public 
Ham_Attack_elite_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    static 
Float:s_fLastFire;
    
s_fLastFire get_pdata_float(iEntm_flLastFire4);
    if( !
s_fLastFire )
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
g_fAccuracy 1.0;
                else
                    
g_fAccuracy 0.94;
            }
            else
                
g_fAccuracy 0.88;
        }
        else
            
g_fAccuracy 0.88;
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else if( 
get_pdata_int(iEntm_iShotsFired4)<=)
    {
        
g_fAccuracy get_pdata_float(iEntm_flAccuracy4);
        
g_fAccuracy -= (0.325-(get_gametime()-s_fLastFire))*0.275;
        
        if( 
g_fAccuracy<0.55 )
            
g_fAccuracy 0.55;
        else if( 
g_fAccuracy>0.88 )
        {
            static 
s_iOwners_iFlags;
            
s_iOwner get_owner
            s_iFlags 
pev(s_iOwnerpev_flags);
            
            if( 
s_iFlags&FL_ONGROUND )
            {
                static 
Float:s_fVelocity[3];
                
pev(s_iOwnerpev_velocitys_fVelocity);
                
                if( !
s_fVelocity[0] && !s_fVelocity[1] )
                {
                    if( 
s_iFlags&FL_DUCKING )
                    {
                        if( 
g_fAccuracy>1.0 )
                            
g_fAccuracy 1.0;
                    }
                    else if( 
g_fAccuracy>0.94 )
                        
g_fAccuracy 0.94;
                }
                else
                    
g_fAccuracy 0.88;
            }
            else
                
g_fAccuracy 0.88;
        }
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
    }
    else
        
g_fAccuracy = -1.0;
}

public 
Ham_Attack_elite_Post(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    if( 
g_fAccuracy>0.88 )
        
set_pdata_float(iEntm_flAccuracy 0.884);
    else if( 
g_fAccuracy>0.0 )
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
}


public 
Ham_Attack_famas_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired*s_iShotsFired)/215.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.12));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired*s_iShotsFired)/215.0)+0.3;
#endif
        
        
if( g_fAccuracy>1.0 )
            
g_fAccuracy 1.0;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}


public 
Ham_Attack_57_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    static 
Float:s_fLastFire;
    
s_fLastFire get_pdata_float(iEntm_flLastFire4);
    if( !
s_fLastFire )
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
g_fAccuracy 1.0;
                else
                    
g_fAccuracy 0.96;
            }
            else
                
g_fAccuracy 0.92;
        }
        else
            
g_fAccuracy 0.92;
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else if( 
get_pdata_int(iEntm_iShotsFired4)<=)
    {
        
g_fAccuracy get_pdata_float(iEntm_flAccuracy4);
        
g_fAccuracy -= (0.275-(get_gametime()-s_fLastFire))*0.25;
        
        if( 
g_fAccuracy<0.725 )
            
g_fAccuracy 0.725;
        else if( 
g_fAccuracy>0.92 )
        {
            static 
s_iOwners_iFlags;
            
s_iOwner get_owner
            s_iFlags 
pev(s_iOwnerpev_flags);
            
            if( 
s_iFlags&FL_ONGROUND )
            {
                static 
Float:s_fVelocity[3];
                
pev(s_iOwnerpev_velocitys_fVelocity);
                
                if( !
s_fVelocity[0] && !s_fVelocity[1] )
                {
                    if( 
s_iFlags&FL_DUCKING )
                    {
                        if( 
g_fAccuracy>1.0 )
                            
g_fAccuracy 1.0;
                    }
                    else if( 
g_fAccuracy>0.96 )
                        
g_fAccuracy 0.96;
                }
                else
                    
g_fAccuracy 0.92;
            }
            else
                
g_fAccuracy 0.92;
        }
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
    }
    else
        
g_fAccuracy = -1.0;
}

public 
Ham_Attack_57_Post(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    if( 
g_fAccuracy>0.92 )
        
set_pdata_float(iEntm_flAccuracy 0.924);
    else if( 
g_fAccuracy>0.0 )
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
}


public 
Ham_Attack_galil_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired*s_iShotsFired)/200.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.154));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired*s_iShotsFired)/200.0)+0.35;
#endif
        
        
if( g_fAccuracy>1.25 )
            
g_fAccuracy 1.25;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}

public 
Ham_Attack_glock_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    static 
Float:s_fLastFirebool:s_bInBurst;
    
s_fLastFire get_pdata_float(iEntm_flLastFire4);
    if( 
get_pdata_int(iEntm_fWeaponState4)&WEAPONSTATE_GLOCK18_BURST_MODE )
        
s_bInBurst true;
    else
        
s_bInBurst false;
    if( !
s_fLastFire )
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            
pev(s_iOwnerpev_velocityg_fGlockVelocity);
            
            if( !
g_fGlockVelocity[0] && !g_fGlockVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
g_fAccuracy 1.0;
                else
                    
g_fAccuracy 0.95;
                
                if( 
s_bInBurst )
                {
                    if( ~
s_iFlags&FL_DUCKING )
                    {
                        
g_bGlockVelocityChanged true;
                        
set_pev(s_iOwnerpev_velocityFloat:{150.00.00.0});
                    }
                }
            }
            else
            {
                
g_fAccuracy 0.90;
                
                if( 
s_bInBurst )
                {
                    
g_bGlockVelocityChanged true;
                    
set_pev(s_iOwnerpev_velocityFloat:{0.00.00.0});
                    if( 
s_iFlags&FL_DUCKING )
                    {
                        
g_bGlockDuckRemoved true;
                        
set_pev(s_iOwnerpev_flags, (s_iFlags&~FL_DUCKING));
                    }
                }
            }
        }
        else
            
g_fAccuracy 0.90;
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else if( 
get_pdata_int(iEntm_iShotsFired4)<=|| s_bInBurst )
    {
        
g_fAccuracy get_pdata_float(iEntm_flAccuracy4);
        
g_fAccuracy -= (0.325-(get_gametime()-s_fLastFire))*0.275;
        
        if( 
g_fAccuracy<0.6 )
            
g_fAccuracy 0.6;
        else if( 
g_fAccuracy>0.90 )
        {
            static 
s_iOwners_iFlags;
            
s_iOwner get_owner
            s_iFlags 
pev(s_iOwnerpev_flags);
            
            if( 
s_iFlags&FL_ONGROUND )
            {
                
pev(s_iOwnerpev_velocityg_fGlockVelocity);
                
                if( !
g_fGlockVelocity[0] && !g_fGlockVelocity[1] )
                {
                    if( 
s_iFlags&FL_DUCKING )
                    {
                        if( 
g_fAccuracy>1.0 )
                            
g_fAccuracy 1.0;
                    }
                    else if( 
g_fAccuracy>0.95 )
                        
g_fAccuracy 0.95;
                
                    if( 
s_bInBurst )
                    {
                        if( ~
s_iFlags&FL_DUCKING )
                        {
                            
g_bGlockVelocityChanged true;
                            
set_pev(s_iOwnerpev_velocityFloat:{150.00.00.0});
                        }
                    }
                }
                else
                {
                    
g_fAccuracy 0.90;
                
                    if( 
s_bInBurst )
                    {
                        
g_bGlockVelocityChanged true;
                        
set_pev(s_iOwnerpev_velocityFloat:{0.00.00.0});
                        if( 
s_iFlags&FL_DUCKING )
                        {
                            
g_bGlockDuckRemoved true;
                            
set_pev(s_iOwnerpev_flags, (s_iFlags&~FL_DUCKING));
                        }
                    }
                }
            }
            else
                
g_fAccuracy 0.90;
        }
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
    }
    else
        
g_fAccuracy = -1.0;
}

public 
Ham_Attack_glock_Post(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    if( 
g_fAccuracy>0.90 )
        
set_pdata_float(iEntm_flAccuracy 0.904);
    else if( 
g_fAccuracy>0.0 )
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
    
    static 
s_iOwner;
    
s_iOwner get_owner
    
    
if( g_bGlockVelocityChanged )
    {
        
g_bGlockVelocityChanged false;
        
set_pev(s_iOwnerpev_velocityg_fGlockVelocity);
    }
    
    if( 
g_bGlockDuckRemoved )
    {
        
g_bGlockDuckRemoved false;
        
set_pev(s_iOwnerpev_flags, (pev(s_iOwnerpev_flags)|FL_DUCKING));
    }
}


public 
Ham_Attack_m249_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired*s_iShotsFired)/175.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.24));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired*s_iShotsFired)/175.0)+0.4;
#endif
        
        
if( g_fAccuracy>0.9 )
            
g_fAccuracy 0.9;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}


public 
Ham_Attack_m4a1_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return    
    
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired*s_iShotsFired)/220.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.153));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired*s_iShotsFired)/220.0)+0.35;
#endif
        
        
if( g_fAccuracy>1.25 )
            
g_fAccuracy 1.25;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}


public 
Ham_Attack_mac10_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return    
    
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired*s_iShotsFired)/200.0)+0.15+smooth_accuracy_transition((s_iShotsFired+1), 0.458));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired*s_iShotsFired)/200.0)+0.6;
#endif
        
        
if( g_fAccuracy>1.65 )
            
g_fAccuracy 1.65;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.0754);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.154);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.154);
    }
}


public 
Ham_Attack_mp5_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired)/220.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.255));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired)/220.0)+0.45;
#endif
        
        
if( g_fAccuracy>0.75 )
            
g_fAccuracy 0.75;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}


public 
Ham_Attack_p228_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    static 
Float:s_fLastFire;
    
s_fLastFire get_pdata_float(iEntm_flLastFire4);
    if( !
s_fLastFire )
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
g_fAccuracy 1.0;
                else
                    
g_fAccuracy 0.95;
            }
            else
                
g_fAccuracy 0.90;
        }
        else
            
g_fAccuracy 0.90;
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else if( 
get_pdata_int(iEntm_iShotsFired4)<=)
    {
        
g_fAccuracy get_pdata_float(iEntm_flAccuracy4);
        
g_fAccuracy -= (0.325-(get_gametime()-s_fLastFire))*0.3;
        
        if( 
g_fAccuracy<0.6 )
            
g_fAccuracy 0.6;
        else if( 
g_fAccuracy>0.90 )
        {
            static 
s_iOwners_iFlags;
            
s_iOwner get_owner
            s_iFlags 
pev(s_iOwnerpev_flags);
            
            if( 
s_iFlags&FL_ONGROUND )
            {
                static 
Float:s_fVelocity[3];
                
pev(s_iOwnerpev_velocitys_fVelocity);
                
                if( !
s_fVelocity[0] && !s_fVelocity[1] )
                {
                    if( 
s_iFlags&FL_DUCKING )
                    {
                        if( 
g_fAccuracy>1.0 )
                            
g_fAccuracy 1.0;
                    }
                    else if( 
g_fAccuracy>0.95 )
                        
g_fAccuracy 0.95;
                }
                else
                    
g_fAccuracy 0.90;
            }
            else
                
g_fAccuracy 0.90;
        }
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
    }
    else
        
g_fAccuracy = -1.0;
}

public 
Ham_Attack_p228_Post(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
        
    if( 
g_fAccuracy>0.90 )
        
set_pdata_float(iEntm_flAccuracy 0.904);
    else if( 
g_fAccuracy>0.0 )
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
}


public 
Ham_Attack_p90_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return    
    
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired)/175.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.256));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired)/175.0)+0.45;
#endif
        
        
if( g_fAccuracy>1.0 )
            
g_fAccuracy 1.0;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}


public 
Ham_Attack_scout_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return    

    static 
s_iOwners_iFlags;
    
s_iOwner get_owner
    s_iFlags 
pev(s_iOwnerpev_flags);
    
    if( 
s_iFlags&FL_DUCKING || ~s_iFlags&FL_ONGROUND )
        
g_fAccuracy 0.0;
    else
    {
        static 
Float:s_fVelocity[3];
        
pev(s_iOwnerpev_velocitys_fVelocity);
        
        if( !
s_fVelocity[0] && !s_fVelocity[1] )
        {
            
set_pev(s_iOwnerpev_flags, (s_iFlags|FL_DUCKING));
            
g_fAccuracy 1.0;
        }
        else
            
g_fAccuracy 0.0;
    }
}

public 
Ham_Attack_scout_Post(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
    
    if( 
g_fAccuracy )
    {
        static 
s_iOwner;
        
s_iOwner get_owner
        set_pev
(s_iOwnerpev_flags, (pev(s_iOwnerpev_flags)&~FL_DUCKING));
    }
}


public 
Ham_Attack_sg550_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return

    static 
Float:s_fLastFire;
    
s_fLastFire get_pdata_float(iEntm_flLastFire4);
    if( !
s_fLastFire )
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
g_fAccuracy 1.0;
                else
                    
g_fAccuracy 0.99;
            }
            else
                
g_fAccuracy 0.98;
        }
        else
            
g_fAccuracy 0.98;
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        
g_fAccuracy = (0.65+(get_gametime()-s_fLastFire))*0.725//*0.35; (this is way too inaccurate comparing to g3sg1)
        
        
if( g_fAccuracy>0.98 )
        {
            static 
s_iOwners_iFlags;
            
s_iOwner get_owner
            s_iFlags 
pev(s_iOwnerpev_flags);
            
            if( 
s_iFlags&FL_ONGROUND )
            {
                static 
Float:s_fVelocity[3];
                
pev(s_iOwnerpev_velocitys_fVelocity);
                
                if( !
s_fVelocity[0] && !s_fVelocity[1] )
                {
                    if( 
s_iFlags&FL_DUCKING )
                    {
                        if( 
g_fAccuracy>1.0 )
                            
g_fAccuracy 1.0;
                    }
                    else if( 
g_fAccuracy>0.99 )
                        
g_fAccuracy 0.99;
                }
                else
                    
g_fAccuracy 0.98;
            }
            else
                
g_fAccuracy 0.98;
        }
        else if( 
g_fAccuracy<0.5 )
            
g_fAccuracy 0.5;
        
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
    }
}


public 
Ham_Attack_sg552_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return

    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired*s_iShotsFired)/220.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.13));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired*s_iShotsFired)/220.0)+0.3;
#endif
        
        
if( g_fAccuracy>1.0 )
            
g_fAccuracy 1.0;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}


public 
Ham_Attack_tmp_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
        
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired*s_iShotsFired)/220.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.357));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired*s_iShotsFired)/220.0)+0.55;
#endif
        
        
if( g_fAccuracy>1.4 )
            
g_fAccuracy 1.4;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}


public 
Ham_Attack_ump45_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
        
    static 
s_iShotsFired;
    
s_iShotsFired get_pdata_int(iEntm_iShotsFired4)-1;
    if( 
s_iShotsFired>=)
    {
#if defined SMOOTH_SPREAD_TRANSITION
        
g_fAccuracy = (((s_iShotsFired*s_iShotsFired)/210.0)+0.2+smooth_accuracy_transition((s_iShotsFired+1), 0.35));
#else
        
g_fAccuracy = ((s_iShotsFired*s_iShotsFired)/210.0)+0.5;
#endif
        
        
if( g_fAccuracy>1.0 )
            
g_fAccuracy 1.0;
        
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
set_pdata_float(iEntm_flAccuracy0.04);
                else
                    
set_pdata_float(iEntm_flAccuracy0.14);
            }
            else
                
set_pdata_float(iEntm_flAccuracy0.24);
        }
        else
            
set_pdata_float(iEntm_flAccuracy0.24);
    }
}


public 
Ham_Attack_usp_Pre(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
        
    static 
Float:s_fLastFire;
    
s_fLastFire get_pdata_float(iEntm_flLastFire4);
    if( !
s_fLastFire )
    {
        static 
s_iOwners_iFlags;
        
s_iOwner get_owner
        s_iFlags 
pev(s_iOwnerpev_flags);
        
        if( 
s_iFlags&FL_ONGROUND )
        {
            static 
Float:s_fVelocity[3];
            
pev(s_iOwnerpev_velocitys_fVelocity);
            
            if( !
s_fVelocity[0] && !s_fVelocity[1] )
            {
                if( 
s_iFlags&FL_DUCKING )
                    
g_fAccuracy 1.0;
                else
                    
g_fAccuracy 0.96;
            }
            else
                
g_fAccuracy 0.92;
        }
        else
            
g_fAccuracy 0.92;
        
set_pdata_float(iEntm_flAccuracyg_fAccuracy4);
    }
    else if( 
get_pdata_int(iEntm_iShotsFired4)<=)
    {
        
g_fAccuracy get_pdata_float(iEntm_flAccuracy4);
        
g_fAccuracy -= (0.3-(get_gametime()-s_fLastFire))*0.275;
        
        if( 
g_fAccuracy<0.6 )
            
g_fAccuracy 0.6;
        else if( 
g_fAccuracy>0.92 )
        {
            static 
s_iOwners_iFlags;
            
s_iOwner get_owner
            s_iFlags 
pev(s_iOwnerpev_flags);
            
            if( 
s_iFlags&FL_ONGROUND )
            {
                static 
Float:s_fVelocity[3];
                
pev(s_iOwnerpev_velocitys_fVelocity);
                
                if( !
s_fVelocity[0] && !s_fVelocity[1] )
                {
                    if( 
s_iFlags&FL_DUCKING )
                    {
                        if( 
g_fAccuracy>1.0 )
                            
g_fAccuracy 1.0;
                    }
                    else if( 
g_fAccuracy>0.96 )
                        
g_fAccuracy 0.96;
                }
                else
                    
g_fAccuracy 0.92;
            }
            else
                
g_fAccuracy 0.92;
        }
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
    }
    else
        
g_fAccuracy = -1.0;
}

public 
Ham_Attack_usp_Post(iEnt)
{
    static 
get_owner
    get_owner 
get_pdata_cbase(iEntm_pPlayer4)
    if(
g_accbl[get_owner])
        return
        
    if( 
g_fAccuracy>0.92 )
        
set_pdata_float(iEntm_flAccuracy 0.924);
    else if( 
g_fAccuracy>0.0 )
        
set_pdata_float(iEntm_flAccuracy g_fAccuracy4);
}

#if defined SMOOTH_SPREAD_TRANSITION
Float:smooth_accuracy_transition(iSteppingIdFloat:fMaxInaccuracyiSteppingsMax)
{            
    if( 
iSteppingId>=iSteppingsMax )
        return 
fMaxInaccuracy;
    
    return ((
float(iSteppingId)*fMaxInaccuracy)/float(iSteppingsMax));
}
#endif


public cmd_blockfix(id)
{
    new 
cmd_value[2]
    
read_argv(1,cmd_value,1)
    
    if(
cmd_value[0] == '1'// turn off the plugin
    
{
        
g_accbl[id] = 1
        console_print
(id,"Your accuracy_fix was successfully turned off!")
    }
    else  
// turn on plugin
    
{
        
g_accbl[id] = 0
        console_print
(id,"Your accuracy_fix was successfully turned on!")
    }

}

public 
cmd_accfix_status(id)
{
    if(!(
get_user_flags(id) & ADMIN_BAN))
    {
        
console_print(id,"You have no permission to use that command!")
        return 
PLUGIN_HANDLED
    
}
    
    new 
w_numw_anounce[180], w_block_countw_pl_name[16]
    
formatex(w_anounce,179,"[AMXX] Players who have blocked fix are:")
    for(
w_num 1w_num g_maxplayersw_num++)
    {
        if(
g_accbl[w_num] == && is_user_connected(w_num))
        {
            
w_block_count++
            
get_user_name(w_num,w_pl_name,15)
            
format(w_anounce179"%s | #%d#%s"w_anouncew_numw_pl_name)
            
            if(
w_block_count != && w_block_count == 0)
            {
                
console_print(id,w_anounce)
                
formatex(w_anounce,179,"[AMXX] :")
            }
        }
    }
    if(
w_block_count == || w_block_count != 0)
    {
        
console_print(id,w_anounce)
    }
    return 
PLUGIN_HANDLED
}

public 
client_putinserver(id)
{
    new 
accval[2]
    
get_user_info(id"_accblock"accval1)
    if(
accval[0] == '1'// if it is auto turned off
        
g_accbl[id] = 1
    
else // for everyone else
        
g_accbl[id] = 0

So, what this does is skipping forwards for those who want them skipped, as well as a way for person to save possibility to turn it off every time it connects to the server.
There is also a command where people with "d" flag can see who has plugin turned off.
Warlord_dd2 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode