Raised This Month: $32 Target: $400
 8% 

Anti DoubleDuck


Post New Thread Reply   
 
Thread Tools Display Modes
ViBE
Member
Join Date: Jul 2011
Location: Somewhere over the...
Old 05-28-2014 , 21:09   Re: Anti DoubleDuck
Reply With Quote #111

i installed this plugin and the standard crouching changed too a little bit. is it normal? or it's the plugin's bug or side effect?

Last edited by ViBE; 06-17-2014 at 11:04. Reason: mistype
ViBE is offline
Send a message via ICQ to ViBE
ViBE
Member
Join Date: Jul 2011
Location: Somewhere over the...
Old 06-22-2014 , 08:20   Re: Anti DoubleDuck
Reply With Quote #112

Quote:
Originally Posted by ViBE View Post
i installed this plugin and the standard crouching changed too a little bit. is it normal? or it's the plugin's bug or side effect?
please MPNumB, check this thread too.

Last edited by ViBE; 06-22-2014 at 08:20.
ViBE is offline
Send a message via ICQ to ViBE
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 06-23-2014 , 10:25   Re: Anti DoubleDuck
Reply With Quote #113

Side effect
__________________
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.
MPNumB is offline
Send a message via Skype™ to MPNumB
ViBE
Member
Join Date: Jul 2011
Location: Somewhere over the...
Old 06-23-2014 , 10:28   Re: Anti DoubleDuck
Reply With Quote #114

Quote:
Originally Posted by MPNumB View Post
Side effect
no way to fix it?
ViBE is offline
Send a message via ICQ to ViBE
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 06-23-2014 , 11:38   Re: Anti DoubleDuck
Reply With Quote #115

you can comment "#define BLOCK_CLIENT_SIDE_DD_VIEW", and it will remove client-side block, and effect will be gone, but other things will pop up at high ping.
__________________
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.
MPNumB is offline
Send a message via Skype™ to MPNumB
kwpd
AlliedModders Donor
Join Date: Mar 2009
Location: panama
Old 11-30-2014 , 18:37   Re: Anti DoubleDuck
Reply With Quote #116

Quote:
Originally Posted by MPNumB View Post
you can comment "#define BLOCK_CLIENT_SIDE_DD_VIEW", and it will remove client-side block, and effect will be gone, but other things will pop up at high ping.
Any way to reduce CPU consumption?
PHP Code:
/**
*
* Anti DoubleDuck (DoubleDuck Blocker)
*  by Numb
*
*
* Description:
*  Permanently blocks player ability to doubleduck.
*
*
* Requires:
*  FakeMeta
*
*
* Additional Info:
*  + Tested in Counter-Strike 1.6 with amxmodx 1.8.1. But should work with all Half-Life mods and some older amxx versions.
*
*
* Notes:
*  + I'm begging Valve to not use any ideas of this plugin for future updates of CS/CZ.
*  + If your game mod is not Counter-Strike / Condition-Zero, you should take a look on plugins config.
*
*
* ChangeLog:
*
*  + 1.7
*  - Changed: Client-side doubleduck block uses almost twice less CPU power.
*
*  + 1.6
*  - Fixed: There was one frame delay during what player was fully ducked while trying to doubleduck.
*  - Changed: Plugin uses a bit less resources.
*
*  + 1.5
*  - Added: Config in source code to disable client-side doubleduck block (when disabled uses less resources).
*  - Changed: Plugin uses a bit less resources.
*
*  + 1.4
*  - Fixed: Client-side bug moving up. (Suggesting to use sv_stepsize 17 instead of standard 18, but there aren't much blocks where you are going up more than 16 units.)
*
*  + 1.3
*  - Fixed: If user is lagy and in a run - client-side doubleduck block isn't working properly.
*  - Fixed: If user just landed and doubleducked client-side doubleduck block isn't working all the time (depends from ping).
*  - Fixed: Client-side doubleduck block not working properly in random map areas.
*  - Fixed: If user just unducked and made a doubleduck - client-side doubleduck block isn't working all the time (depends from ping).
*
*  + 1.2
*  - Added: Client-side doubleduck block.
*
*  + 1.1
*  - Changed: Made 1-based array (lower CPU usage).
*  - Changed: Modified check when user is pre-doubleducking - now uses only 1 variable (lower cpu usage).
*
*  + 1.0
*  - First release.
*
*
* Downloads:
*  Amx Mod X forums: http://forums.alliedmods.net/showthread.php?p=619219
*
**/



// ========================================================================= CONFIG START =========================================================================

// Comment this line if you need more CPU or you don't want to block client-side doubleduck.
#define BLOCK_CLIENT_SIDE_DD_VIEW // default: enabled (uncommented)



// If you are using client-side doubleduck block (this is just a start of upcoming configs):
#if defined BLOCK_CLIENT_SIDE_DD_VIEW // this is only a notification (but a needed one) - do not change/remove it.


// Please write any world-view gun model what is automatically downloaded by the engine.
#define ENTITY_MDL "models/w_awp.mdl" // default: ("models/w_awp.mdl") (for use in cs/cz)

// Class-Name of anti-doubleduck entity.
#define ENTITY_NAME "anti_doubleducker" // default: ("anti_doubleducker")


#endif // this is only a notification (but a needed one) - do not change/remove it.

// ========================================================================== CONFIG END ==========================================================================



#include <amxmodx>
#include <fakemeta>

#define PLUGIN_NAME    "Anti DoubleDuck"
#define PLUGIN_VERSION "1.7"
#define PLUGIN_AUTHOR  "Numb"

#if defined BLOCK_CLIENT_SIDE_DD_VIEW
#define ENTITY_NAME "anti_doubleducker"
new g_iFakeEnt;
#endif

new bool:g_bIsUserDead[33];

public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    
register_event("ResetHUD""Event_ResetHUD""be");
    
register_event("Health",   "Event_Health",   "bd""1=0");
    
register_forward(FM_PlayerPreThink"FM_PlayerPreThink_Pre"0);
    
    
#if defined BLOCK_CLIENT_SIDE_DD_VIEW
    
if( (g_iFakeEnt=engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")))>)
    {
        
set_pev(g_iFakeEntpev_classname,  ENTITY_NAME);
        
set_pev(g_iFakeEntpev_solid,      SOLID_NOT);
        
set_pev(g_iFakeEntpev_movetype,   MOVETYPE_NONE);
        
set_pev(g_iFakeEntpev_rendermodekRenderTransAlpha);
        
set_pev(g_iFakeEntpev_renderamt,  0.0);
        
        
engfunc(EngFunc_SetModelg_iFakeEntENTITY_MDL);
        
engfunc(EngFunc_SetSizeg_iFakeEntFloat:{-16.0, -16.053.0}, Float:{16.016.054.0});
        
register_forward(FM_AddToFullPack"FM_AddToFullPack_Pre"0);
    }
    
#endif
}

public 
client_connect(iPlrId)
{
    
g_bIsUserDead[iPlrId] = true;
}

public 
Event_ResetHUD(iPlrId)
{
    
g_bIsUserDead[iPlrId] = false;
}

public 
Event_Health(iPlrId)
{
    
g_bIsUserDead[iPlrId] = true;
}

public 
FM_PlayerPreThink_Pre(iPlrId)
{
    if( 
g_bIsUserDead[iPlrId] )
    {
        return 
FMRES_IGNORED;
    }
    if( 
pev(iPlrIdpev_oldbuttons)&IN_DUCK && !(pev(iPlrIdpev_button)&IN_DUCK) )
    {
        static 
s_iFlags;
        
s_iFlags pev(iPlrIdpev_flags);
        if( !(
s_iFlags&FL_DUCKING) && pev(iPlrIdpev_bInDuck) )
        {
            
set_pev(iPlrIdpev_bInDuckfalse);
            
set_pev(iPlrIdpev_flags, (s_iFlags|FL_DUCKING));
            
engfunc(EngFunc_SetSizeiPlrIdFloat:{-16.0, -16.0, -25.0}, Float:{16.016.025.0});
        }
    }
    return 
FMRES_IGNORED;
}

#if defined BLOCK_CLIENT_SIDE_DD_VIEW
public FM_AddToFullPack_Pre(iEsHandleiEiEntiPlrIdiHostFlagsiPlayeriPSet)
{
    if( 
iEnt == g_iFakeEnt )
    {
        if( 
g_bIsUserDead[iPlrId] )
        {
            return 
FMRES_SUPERCEDE;
        }
        static 
Float:s_fFallSpeed;
        
pev(iPlrIdpev_flFallVelocitys_fFallSpeed);
        if( 
s_fFallSpeed >= 0.0 )
        {
            static 
Float:s_fOrigin[3];
            
pev(iPlrIdpev_origins_fOrigin);
            
            if( 
pev(iPlrIdpev_flags) & FL_DUCKING )
            {
                
s_fOrigin[2] += s_fFallSpeed?2.0:18.0;
            }
            else { 
s_fOrigin[2] -= s_fFallSpeed?16.0:0.0; }
            
            
engfunc(EngFunc_SetOriginiEnts_fOrigin);
            
forward_return(FMV_CELLdllfunc(DLLFunc_AddToFullPackiEsHandleiEiEntiPlrIdiHostFlagsiPlayeriPSet));
            
set_es(iEsHandleES_SolidSOLID_BBOX);
            
            return 
FMRES_SUPERCEDE;
        }
        return 
FMRES_SUPERCEDE;
    }
    return 
FMRES_IGNORED;
}
#endif 
__________________
kwpd is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 12-05-2014 , 20:57   Re: Anti DoubleDuck
Reply With Quote #117

commenting "#define BLOCK_CLIENT_SIDE_DD_VIEW" will make cpu usage less, just like I wrote earlier.
__________________
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; 12-05-2014 at 20:57.
MPNumB is offline
Send a message via Skype™ to MPNumB
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 02-05-2015 , 18:21   Re: Anti DoubleDuck
Reply With Quote #118

MPNumB, what you think about this method of Double Duck MWHEEL disabler (?):
Add condition: if player send duck (+duck) > 1 times in N milliseconds, then block it.
It's prevent spam of +duck command by MWHEEL.
N milliseconds — time, during which player can normally press CTRL button on keyboard (about 175 milliseconds).

Last edited by Phant; 02-05-2015 at 18:22.
Phant is offline
Send a message via ICQ to Phant
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 02-08-2015 , 15:54   Re: Anti DoubleDuck
Reply With Quote #119

You should check my anti-silent run plugin, since idea of this one at the beginning was to block count-jumping and no other reason.

Just if someone is interested, when this technique was discovered (CJ), I hated it (since high frame rates play a big role, and it didn't seem fair), so I've done this plugin. Later (when got a newer pc) of course I grew to like it. About crouch-hopping, I personally like it as well. And am quite sad to see that this plugin became as popular, that I was seeing it in shooting-based servers where it was fun to play before it was installed.

Don't get me wrong, but I feel like having a discussion with someone who is against silent-run (aka crouch-hop, aka russian-walk) is like being an atheist and having a discussion with a strong believer. Therefor I hope this is the last time I have to refer someone to anti-silent run plugin.
__________________
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.
MPNumB is offline
Send a message via Skype™ to MPNumB
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 03-14-2015 , 17:50   Re: Anti DoubleDuck
Reply With Quote #120

So, I done it.
In attachment: unofficial "1.8" version of this plugin. I adds new feature: doubleduck will be blocked only when it become by previous doubleduck per some time (400 ms by default).
Thus, player can easily do "not aggresive" doubleducks, especially by keyboard key (CTRL). But plugin will be block aggresive doubleducks (usually by MOUSEWHEEL'ing).
Edit 73 line ("ALLOWED_DD_SEC" float constant) for change time. Comment this line for disabling this feature (same as 1.7 version).
Attached Files
File Type: sma Get Plugin or Get Source (antidoubleduck.sma - 706 views - 8.5 KB)

Last edited by Phant; 03-14-2015 at 18:21.
Phant is offline
Send a message via ICQ to Phant
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 00:27.


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