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

[REQ] Reduce AWP Damage When Zoom


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xairgeo
Member
Join Date: Oct 2014
Old 08-10-2017 , 12:56   [REQ] Reduce AWP Damage When Zoom
Reply With Quote #1

I need a plugin that reduce the AWP damage by 50% when it's zoomed in, I looked around but can't find any such plugins please help.
xairgeo is offline
FR0NTLINE
AlliedModders Donor
Join Date: Apr 2006
Location: Riverside Cali
Old 08-13-2017 , 01:13   Re: [REQ] Reduce AWP Damage When Zoom
Reply With Quote #2

Thats because you have a NEW IDEA, should be easy for someone to code that. Should add no scope kill with extra health also.
__________________
FR0NTLINE is offline
Send a message via AIM to FR0NTLINE Send a message via MSN to FR0NTLINE Send a message via Yahoo to FR0NTLINE
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-13-2017 , 07:21   Re: [REQ] Reduce AWP Damage When Zoom
Reply With Quote #3

I haven't tested this one. Try it and let me know if it works.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>


public plugin_init()
{
    
register_plugin("Reduce AWP Damage on Zoom""1.0.0""KliPPy");

    
RegisterHam(Ham_TakeDamage"player""@Ham_TakeDamage_Pre"false);
}

@
Ham_TakeDamage_Pre(thisinflictorIdattackerIdFloat:damagedamageBits)
{
    if(!
is_user_connected(attackerId))
        return 
HAM_IGNORED;

    if(
inflictorId == attackerId && get_user_weapon(attackerId) == CSW_AWP)
    {
        if(
Float:pev(attackerIdpev_fov) < 45.0)
        {
            
SetHamParamFloat(4damage 0.5);
            return 
HAM_HANDLED;
        }
    }

    return 
HAM_IGNORED;


Last edited by klippy; 08-13-2017 at 09:05.
klippy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-13-2017 , 10:47   Re: [REQ] Reduce AWP Damage When Zoom
Reply With Quote #4

Tested and working. This allows different levels of damage reduction based on the level of zoom -- currently set to 50% reduction at zoom level 1 and 75% reduction at zoom level 2.

Message to attacker on zoomed attack:
Code:
* Your damage was reduced by 50% since you were scoping [Zoom 1]!
* Your damage was reduced by 75% since you were scoping [Zoom 2]!
PHP Code:

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

#define MAX_PLAYERS 32

new g_iCurrentZoomMAX_PLAYERS ];

new 
g_szZoomType[][] = 
{
    
"",
    
"",
    
"Zoom 1",
    
"Zoom 2"
};

new 
Float:g_fDamageReduction[] = 
{
    
0.0,
    
0.0,
    
0.5,
    
0.25
};

public 
plugin_init()
{
    
register_plugin"Reduce AWP damage when scoped" "0.1" "bugsy" );
    
    
RegisterHamHam_TakeDamage "player" "HamTakeDamage_Pre" );
    
    
register_event"CurWeapon" "EvCurWeapon" "b" "1=1" "2=18" );
}

public 
HamTakeDamage_Prethis iInflictor iAttacker Float:fDamageDamageBits )
{
    if ( 
iInflictor == iAttacker && is_user_connectediAttacker ) && ( get_user_weaponiAttacker ) == CSW_AWP ) && ( CS_SET_FIRST_ZOOM <= g_iCurrentZoomiAttacker ] <= CS_SET_SECOND_ZOOM ) )
    {
        
client_printiAttacker print_chat "* Your damage was reduced by %d%% since you were scoping [%s]!" floatround100.0 * ( 1.0 g_fDamageReductiong_iCurrentZoomiAttacker ] ] ) ) , g_szZoomTypeg_iCurrentZoomiAttacker ] ] );
        
SetHamParamFloatfDamage g_fDamageReductiong_iCurrentZoomiAttacker ] ] );
        
        return 
HAM_HANDLED;
    }
    
    return 
HAM_IGNORED;
}  

public 
EvCurWeaponid )
{
    
g_iCurrentZoomid ] = cs_get_user_zoomid );

__________________

Last edited by Bugsy; 08-13-2017 at 11:14.
Bugsy is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-13-2017 , 13:46   Re: [REQ] Reduce AWP Damage When Zoom
Reply With Quote #5

PHP Code:
cs_get_user_zoomid 
To be honest, I didn't even know this existed lol.
klippy is offline
xairgeo
Member
Join Date: Oct 2014
Old 08-13-2017 , 19:11   Re: [REQ] Reduce AWP Damage When Zoom
Reply With Quote #6

Quote:
Originally Posted by Bugsy View Post
Tested and working. This allows different levels of damage reduction based on the level of zoom -- currently set to 50% reduction at zoom level 1 and 75% reduction at zoom level 2.

Message to attacker on zoomed attack:
Code:
* Your damage was reduced by 50% since you were scoping [Zoom 1]!
* Your damage was reduced by 75% since you were scoping [Zoom 2]!
PHP Code:

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

#define MAX_PLAYERS 32

new g_iCurrentZoomMAX_PLAYERS ];

new 
g_szZoomType[][] = 
{
    
"",
    
"",
    
"Zoom 1",
    
"Zoom 2"
};

new 
Float:g_fDamageReduction[] = 
{
    
0.0,
    
0.0,
    
0.5,
    
0.25
};

public 
plugin_init()
{
    
register_plugin"Reduce AWP damage when scoped" "0.1" "bugsy" );
    
    
RegisterHamHam_TakeDamage "player" "HamTakeDamage_Pre" );
    
    
register_event"CurWeapon" "EvCurWeapon" "b" "1=1" "2=18" );
}

public 
HamTakeDamage_Prethis iInflictor iAttacker Float:fDamageDamageBits )
{
    if ( 
iInflictor == iAttacker && is_user_connectediAttacker ) && ( get_user_weaponiAttacker ) == CSW_AWP ) && ( CS_SET_FIRST_ZOOM <= g_iCurrentZoomiAttacker ] <= CS_SET_SECOND_ZOOM ) )
    {
        
client_printiAttacker print_chat "* Your damage was reduced by %d%% since you were scoping [%s]!" floatround100.0 * ( 1.0 g_fDamageReductiong_iCurrentZoomiAttacker ] ] ) ) , g_szZoomTypeg_iCurrentZoomiAttacker ] ] );
        
SetHamParamFloatfDamage g_fDamageReductiong_iCurrentZoomiAttacker ] ] );
        
        return 
HAM_HANDLED;
    }
    
    return 
HAM_IGNORED;
}  

public 
EvCurWeaponid )
{
    
g_iCurrentZoomid ] = cs_get_user_zoomid );

i don't know why but it doesn't seem to work.
xairgeo is offline
xairgeo
Member
Join Date: Oct 2014
Old 08-13-2017 , 19:11   Re: [REQ] Reduce AWP Damage When Zoom
Reply With Quote #7

Quote:
Originally Posted by KliPPy View Post
I haven't tested this one. Try it and let me know if it works.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>


public plugin_init()
{
    
register_plugin("Reduce AWP Damage on Zoom""1.0.0""KliPPy");

    
RegisterHam(Ham_TakeDamage"player""@Ham_TakeDamage_Pre"false);
}

@
Ham_TakeDamage_Pre(thisinflictorIdattackerIdFloat:damagedamageBits)
{
    if(!
is_user_connected(attackerId))
        return 
HAM_IGNORED;

    if(
inflictorId == attackerId && get_user_weapon(attackerId) == CSW_AWP)
    {
        if(
Float:pev(attackerIdpev_fov) < 45.0)
        {
            
SetHamParamFloat(4damage 0.5);
            return 
HAM_HANDLED;
        }
    }

    return 
HAM_IGNORED;

This isn't working for me either.
xairgeo is offline
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 08-14-2017 , 03:47   Re: [REQ] Reduce AWP Damage When Zoom
Reply With Quote #8

how it's not ?
did you installed it properly ?
if yes what is your compiler version and server amxx version.
__________________

Last edited by Ayman Khaled; 08-14-2017 at 03:48.
Ayman Khaled is offline
xairgeo
Member
Join Date: Oct 2014
Old 08-14-2017 , 12:17   Re: [REQ] Reduce AWP Damage When Zoom
Reply With Quote #9

Quote:
Originally Posted by Ayman Khaled View Post
how it's not ?
did you installed it properly ?
if yes what is your compiler version and server amxx version.
I don't know what my compiler version is but i assume it's the same as my amxmod version which is 1.8.2
xairgeo 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 08:21.


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