View Single Post
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 06-27-2022 , 12:18   Re: Requesting a HE damage multiplier that works and does not mess with scoreboard.
Reply With Quote #10

Quote:
Originally Posted by DJEarthQuake View Post
Rewritten with cs_ham_bots_api. Install it and include.
PHP Code:
/*Tired of weak grenades?*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>

#define CZ ///uncomment for CZ bot damage

#if defined CZ
#tryinclude cs_ham_bots_api
//https://github.com/djearthquake/amxx/tree/main/scripting/czero/AI
#endif

#define PLUGIN  "Grenade Damage Adjust"
#define VERSION "06-25-22"
#define AUTHOR  "SPiNX"

#define HE_IMMUNITY_ACCESS     ADMIN_RCON

#if !defined DMG_GRENADE
const DMG_GRENADE = (1<<24)
#endif

new Float:Xmultipler
new const CvarXmultiplerDesc[]="Grenade damage multiplier"
new bool:bOF_run
new g_MOD_DMG

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_touch("grenade""func_breakable""@pop")
    
register_touch("grenade""func_pushable""@pop")

    
bind_pcvar_num(get_cvar_pointer("mp_grenade_multiplier") ?
    
get_cvar_pointer("mp_grenade_multiplier") :
    
create_cvar("mp_grenade_multiplier""10.0" ,FCVAR_SERVERCvarXmultiplerDesc,.has_min true, .min_val 0.0, .has_max true, .max_val 10.0), Xmultipler)

    
bOF_run =  is_running("gearbox") || is_running("valve")
    
g_MOD_DMG = !bOF_run DMG_GRENADE DMG_BLAST

    RegisterHam
(Ham_TakeDamage"player""Fw_Damage");
#if defined CZ
    
if(is_running("czero"))
    {
        
RegisterHamBots(Ham_TakeDamage"Fw_Damage")
    }
#endif
}

@
pop(grenadebreakable)
    
ExecuteHam(Ham_TakeDamage,breakable,breakable,grenade,500.0,DMG_CRUSH)

public 
Fw_Damage(victiminflictorattackerFloat:fDamagedmgbits)
{
    if(
is_user_connected(victim) && !is_user_bot(attacker))
    {
        if( 
dmgbits == g_MOD_DMG)
        {
            if(
fDamage)
            {
                    
#define DAMAGE       4
                    
new Damage_adj  fDamage*Xmultipler;

                    if(
/*access(victim, HE_IMMUNITY_ACCESS) ||*/ !Xmultipler)
                        return 
HAM_SUPERCEDE
                    
else
                    {
                        
SetHamParamFloat(DAMAGEfloat(Damage_adj))
                        if(
is_user_connected(attacker))
                        {
                            
client_print attackerprint_center"%d"Damage_adj
                            client_print attacker
print_console"%n hit %n with %d grenade damage"attackervictimDamage_adj
                        
}

                    }


            }

        }
        else return 
HAM_IGNORED
    
}
    return 
HAM_HANDLED


Request #1: Please, if you may remove ability to break "plant zone boxes" or whatever they are called
since when a Hegrenade touches them by throwing it, they will explode dramatically and remove essential cover on plant zones.

Bug detected: Probably related to Request #1, If you plant the C4 in those boxes , after planting, the box you are standing on explodes, killing you and anyone near.

Request #2: Deactivate by CVAR the damage print info.

Last edited by Ark_Procession; 06-27-2022 at 12:18.
Ark_Procession is offline