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

is there a way to make grenades more powerful in CS 1.6?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pandabot
Junior Member
Join Date: Jun 2020
Old 02-15-2021 , 21:48   is there a way to make grenades more powerful in CS 1.6?
Reply With Quote #1

It would be cool if grenades instantly killed you, is there some way to increase the amount of damage they give in CS 1.6?
pandabot is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-15-2021 , 21:49   Re: is there a way to make grenades more powerful in CS 1.6?
Reply With Quote #2

I believe you can do that by hooking TakeDamage and modifying the damage value depending on what is causing the damage.
__________________
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-15-2021 , 22:15   Re: is there a way to make grenades more powerful in CS 1.6?
Reply With Quote #3

I set the multiplier to 10.0 which is guaranteed to kill anyone who catches a whiff of the grenade, you can try altering the value if you want to make it only slightly more powerful (eg. change 10.0 to 1.1, 1.2, 1.3, etc.).
PHP Code:

#include <amxmodx>
#include <hamsandwich>

new const Version[] = "0.1";

const 
DMG_GRENADE = ( << 24 );

public 
plugin_init() 
{
    
register_plugin"Instant Grenade Kill" Version "bugsy" );
    
    
RegisterHamHam_TakeDamage "player" "HamTakeDamage" );
}

public 
HamTakeDamagevictim inflictor attacker Float:fDamage damageBits)
{
    if ( 
damageBits DMG_GRENADE )
    {
        
SetHamParamFloatfDamage 10.0 );
        return 
HAM_HANDLED;
    }
    
    return 
HAM_IGNORED;

__________________
Bugsy is offline
pandabot
Junior Member
Join Date: Jun 2020
Old 02-15-2021 , 22:30   Re: is there a way to make grenades more powerful in CS 1.6?
Reply With Quote #4

Hmmmm this seems to only work for self damage, using it on enemies and teammates appears to be the normal amount. I've had some weirdness using HamSandwich on my machine in the past, I'm not sure if it's related to that

Last edited by pandabot; 02-15-2021 at 22:31.
pandabot is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-15-2021 , 22:49   Re: is there a way to make grenades more powerful in CS 1.6?
Reply With Quote #5

I just tested it on a bot and it worked completely fine. Do you have other plugins running that may be interfering?
__________________
Bugsy is offline
pandabot
Junior Member
Join Date: Jun 2020
Old 02-16-2021 , 01:24   Re: is there a way to make grenades more powerful in CS 1.6?
Reply With Quote #6

Ah okay, no the only other one that's active is amx_gore_ultimate.amxx. I've had issues with HamSandwich before, I think it has something to do with bots and my machine. For example on Zombie Swarm 2.4 none of the bots would turn into zombies until I removed HamSandwich and replaced those hooks in the codebase to do the same thing without it. Maybe there is a way to do this without HamSandwich using this code as a starting point Thanks
pandabot is offline
pandabot
Junior Member
Join Date: Jun 2020
Old 02-16-2021 , 05:37   Re: is there a way to make grenades more powerful in CS 1.6?
Reply With Quote #7

Lol this kind of works

Code:
#include <amxmodx>
#include <fun>

new const Version[] = "1.0";

public plugin_init() 
{
    register_plugin("Instant Grenade Kill", Version, "pandabot");    
}

public client_damage(iAttacker, iVictim, iDamage, iWpnIndex, iHitPlace, iTA)
{

    if( is_user_alive(iVictim) && iDamage>0 ) {
        if (iWpnIndex == CSW_HEGRENADE) {
            set_user_health(iVictim, 0);
        }
    }
}
pandabot is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-16-2021 , 06:35   Re: is there a way to make grenades more powerful in CS 1.6?
Reply With Quote #8

Quote:
Originally Posted by pandabot View Post
Ah okay, no the only other one that's active is amx_gore_ultimate.amxx. I've had issues with HamSandwich before, I think it has something to do with bots and my machine. For example on Zombie Swarm 2.4 none of the bots would turn into zombies until I removed HamSandwich and replaced those hooks in the codebase to do the same thing without it. Maybe there is a way to do this without HamSandwich using this code as a starting point Thanks
I believe it's an issue with the bots you are using as bot entities from some bot plugins/modules don't quite properly imitate player entities. If I remember correctly, Podbot works great for plugin testing.
__________________
klippy 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 03:05.


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