AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Change weapon damage in HL1 (https://forums.alliedmods.net/showthread.php?t=345880)

muro32 02-01-2024 09:30

Change weapon damage in HL1
 
Hello all. I need to reduce the damage of 9mmAR's grenade and shotgun(both of primary and secondary attack) in my server. Skill.cfg did'nt worked for me. How can i solve it? Codes in this reply look like useful, how can i adapt shotgun and 9mmAR's grenade? Thank you.

mlibre 02-01-2024 11:47

Re: Change weapon damage in HL1
 
identify the weapon HLW_?

muro32 02-01-2024 15:50

Re: Change weapon damage in HL1
 
Quote:

Originally Posted by mlibre (Post 2817194)
identify the weapon HLW_?

HLW_SHOTGUN for shotgun, HLW_MP5 for 9mmAR but unfortunately I don't know if there is a different ident for 9mmar's grenade. And I have no idea how to adjust primary and secondary attack damage separately.

DJEarthQuake 02-03-2024 08:08

Re: Change weapon damage in HL1
 
Code:
#if !defined DMG_GRENADE const DMG_GRENADE = (1<<24) #endif     bOF_run =  is_running("gearbox") || is_running("valve")     g_MOD_DMG = !bOF_run ? DMG_GRENADE : DMG_BLAST

mlibre 02-03-2024 10:47

Re: Change weapon damage in HL1
 
you can identify exactly the type of damage with a print with the help of Ham_TakeDamage

muro32 02-06-2024 06:39

Re: Change weapon damage in HL1
 
this block can help me thank you

muro32 02-06-2024 06:39

Re: Change weapon damage in HL1
 
Quote:

Originally Posted by mlibre (Post 2817363)
you can identify exactly the type of damage with a print with the help of Ham_TakeDamage

ok i will try this at weekend thank you

DJEarthQuake 02-09-2024 10:37

Re: Change weapon damage in HL1
 
Tested OK.
PHP Code:

#include amxmodx
#include fakemeta
#include hamsandwich

#define PLUGIN "AR SHOTTY DAMAGE ADJ"
#define VERSION "1.0"

new const CvarXMultiplerDesc[]="Damage multiplier"

new const gWeaponClassname[] = "weapon_shotgun"
new bool:bShottyAttack[MAX_PLAYERS +1]
new 
Float:XMultipler

public plugin_init()
{
    
register_plugin(PLUGINVERSION".sρiηX҉.");
    
    
RegisterHamHam_Weapon_PrimaryAttack  gWeaponClassname"Weapon_Attack_Pre" )
    
RegisterHamHam_Weapon_PrimaryAttack  gWeaponClassname"Weapon_Attack_Post" )

    
RegisterHamHam_Weapon_SecondaryAttack  gWeaponClassname"Weapon_Attack_Pre" )
    
RegisterHamHam_Weapon_SecondaryAttack  gWeaponClassname"Weapon_Attack_Post" )
    
RegisterHam(Ham_TakeDamage"player""Event_Damage"0);
    
bind_pcvar_float(get_cvar_pointer("mp_damage_multiplier") ?
    
get_cvar_pointer("mp_damage_multiplier") :
    
create_cvar("mp_damage_multiplier""0.1"FCVAR_SERVERCvarXMultiplerDesc,.has_min true, .min_val 0.0, .has_max true, .max_val 10.0), XMultipler)
}

public 
Weapon_Attack_Pre( const weapon )
{
    static 
iPlayer;iPlayer pev(weaponpev_owner)
    
bShottyAttack[iPlayer] = true
}

public 
Weapon_Attack_Post( const weapon )
{
    static 
iPlayer;iPlayer pev(weaponpev_owner)
    
bShottyAttack[iPlayer] = false
}

public 
Event_Damage(victiminflictorattackerFloat:fDamagedmgbits)
{
    if(
is_user_connected(attacker))
    {
        
#define DAMAGE       4
        
new Float:Damage_adj  fDamage*XMultipler;

        if(
bShottyAttack[attacker] || dmgbits == DMG_BLAST )
        {
            if(!
XMultipler)
                return 
HAM_SUPERCEDE
            
else
                
SetHamParamFloat(DAMAGEDamage_adj)
            
client_print attackerprint_center"%i"floatround(Damage_adj)
        }
        else return 
HAM_IGNORED
    
}
    return 
PLUGIN_HANDLED





All times are GMT -4. The time now is 00:33.

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