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

Lower Auto Sniper Damage/Hits


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FR0NTLINE
AlliedModders Donor
Join Date: Apr 2006
Location: Riverside Cali
Old 08-15-2017 , 11:17   Lower Auto Sniper Damage/Hits
Reply With Quote #1

In desperate need of a plugin that lowers the hit damage from an auto sniper, Would like it to be as powerful as a glock bullet, For Reals. Thanks and a Cvar would be awesome.
__________________
FR0NTLINE is offline
Send a message via AIM to FR0NTLINE Send a message via MSN to FR0NTLINE Send a message via Yahoo to FR0NTLINE
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-15-2017 , 18:23   Re: Lower Auto Sniper Damage/Hits
Reply With Quote #2

Cvars:
  • rasd_enabled - Enables/disables plugin (default 1)
  • rasd_chatenabled - Enables/disables chat message to shooter letting him know of damage reduction (default 1)
The below cvars set the damage factor based on no scope or scope level. The total damage inflicted is multiplied by this multiplier. Note: Total damage inflicted is not the same as loss in hp to the victim.
  • rasd_noscopedamagefactor - Damage factor when no scoping (default 0.75, 25% reduction)
  • rasd_scope1damagefactor - Damage factor when scoping level 1 (default 0.5, 50% reduction)
  • rasd_scope2damagefactor - Damage factor when scoping level 2 (default 0.25, 75% reduction)
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#define MAX_PLAYERS 32

enum ScopeLevel
{
    
SL_NONE,
    
SL_NOSCOPE,
    
SL_SCOPE_1,
    
SL_SCOPE_2
}

new const 
g_szScopeTypeScopeLevel ][] = 
{
    
"",
    
"No scope",
    
"Scope 1",
    
"Scope 2"
};

new 
ScopeLevel:g_slCurrentScopeMAX_PLAYERS ];
new 
Float:g_fDamageReductionScopeLevel ];
new 
g_pEnabled g_pChatMsg g_pNoScopeDamage g_pScope1Damage g_pScope2Damage;

public 
plugin_init()
{
    
register_plugin"Reduce Auto Sniper Damage" "0.1" "bugsy" );
    
    
RegisterHamHam_TakeDamage "player" "HamTakeDamage_Pre" );
    
    
register_event"CurWeapon" "EvCurWeapon" "b" "1=1" "2=24" );
    
    
g_pEnabled register_cvar("rasd_enabled" "1" );
    
g_pChatMsg register_cvar("rasd_chatenabled" "1" );
    
g_pNoScopeDamage register_cvar("rasd_noscopedamagefactor" "0.75" );
    
g_pScope1Damage register_cvar("rasd_scope1damagefactor" "0.5" );
    
g_pScope2Damage =  register_cvar("rasd_scope2damagefactor" "0.25" );
    
    
g_fDamageReductionSL_NOSCOPE ] = get_pcvar_floatg_pNoScopeDamage );
    
g_fDamageReductionSL_SCOPE_1 ] = get_pcvar_floatg_pScope1Damage );
    
g_fDamageReductionSL_SCOPE_2 ] = get_pcvar_floatg_pScope2Damage );
}

public 
HamTakeDamage_Prethis iInflictor iAttacker Float:fDamageDamageBits )
{
    if ( ( 
iInflictor == iAttacker ) && get_pcvar_numg_pEnabled ) && is_user_connectediAttacker ) && ( get_user_weaponiAttacker ) == CSW_G3SG1 ) )
    {
        
SetHamParamFloatfDamage g_fDamageReductiong_slCurrentScopeiAttacker ] ] );
        
        if ( 
get_pcvar_numg_pChatMsg ) )
        {
            
client_printiAttacker print_chat "* Your damage was reduced by %d%% since you are using auto sniper [%s]!" floatround100.0 * ( 1.0 g_fDamageReductiong_slCurrentScopeiAttacker ] ] ) ) , g_szScopeTypeg_slCurrentScopeiAttacker ] ] );
        }
        
        return 
HAM_HANDLED;
    }
    
    return 
HAM_IGNORED;
}  

public 
EvCurWeaponid )
{
    
g_slCurrentScopeid ] = ScopeLevel:cs_get_user_zoomid );

__________________

Last edited by Bugsy; 08-15-2017 at 18:26.
Bugsy 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 19:24.


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