AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   HEs destroy grenades 1.1.1 (https://forums.alliedmods.net/showthread.php?t=229457)

BeasT 11-08-2013 08:01

HEs destroy grenades 1.1.1
 
2 Attachment(s)
When a HE grenade explodes, it also detonates grenades that are nearby. Demonstration video: http://www.youtube.com/watch?&v=VG96m52Ffkg

Cvars:
  • hdg_affect_radius - affect radius. Default 350.
  • hdg_survival_chance - a chance (default 3% (+ some randomized distance chance)) for a grenade to survive an explosion of a nearby HE grenade. Set 0 to disable.


Installation:
  • Install latest Orpheu.
  • Put attached signatures to addons/amxmodx/configs/
  • Compile the source file localy.

Credits:

Arkshine for various help, Orpheu signatures, CSSDK.
ConnorMcLeod for help getting the grenade type correctly.

bibu 11-08-2013 10:30

Re: HEs destroy grenades
 
Cool idea and good job!

alan_el_more 11-08-2013 11:11

Re: HEs destroy grenades
 
Destroy?
You should use another word
Btw, good job

hornet 11-09-2013 07:29

Re: HEs destroy grenades
 
Sounds fun.

You need to use a better method than Think() for detecting explosion, because several useless checks are made for each grenade between whence it's thrown through till when it explodes, including the C4 once it's planted.
Your best 2 options would be:
  • Hook CGrenade::Detonate3()
  • Register FM_EmitSound cand check for "weapons/debris1.wav" - "weapons/debris2.wav" - "weapons/debris3.wav

BeasT 11-09-2013 09:24

Re: HEs destroy grenades
 
Quote:

Originally Posted by hornet (Post 2058683)
  • Hook CGrenade::Detonate3()
  • Register FM_EmitSound cand check for "weapons/debris1.wav" - "weapons/debris2.wav" - "weapons/debris3.wav

I don't want to use orpheu for such a simple plugin, unless it's a must for aproval. Also is the second method reliable? The sounds could be changed or blocked...


Quote:

Originally Posted by alan_el_more (Post 2058376)
Destroy?
You should use another word

Quote:

Originally Posted by LordOfNothing (Post 2058630)
1: This not destroy nades this is auto activate when explozion colosion with other nades :)

I don't see the difference, really. The grenades get destroyed by the damage wave that's why they explode...

alan_el_more 11-09-2013 09:36

Re: HEs destroy grenades
 
If the grenades were destroyed, they should just disappear without detonating. That's my point of view

YamiKaitou 11-09-2013 09:58

Re: HEs destroy grenades
 
Quote:

Originally Posted by alan_el_more (Post 2058733)
If the grenades were destroyed, they should just disappear without detonating. That's my point of view

Not always. If you were to destroy (by explosives) a nuclear weapon, would it not cause the nuclear warhead to detonate? You would be correct if you were destroying the weapon by dismantling it, but that isn't the case with this plugin

DWIGHTpN 11-09-2013 10:02

Re: HEs destroy grenades
 
Gj, nice plugin :)
Although this plugin was written by you (your original idea), would be great if nademodes by OT would contain this mod :P.

alan_el_more 11-09-2013 10:28

Re: HEs destroy grenades
 
Quote:

Originally Posted by YamiKaitou (Post 2058741)
Not always. If you were to destroy (by explosives) a nuclear weapon, would it not cause the nuclear warhead to detonate? You would be correct if you were destroying the weapon by dismantling it, but that isn't the case with this plugin

Maybe but i think a plugin name like "HEs detonate grenades" or "HEs detonate others grenades" are more appropriate

ConnorMcLeod 11-09-2013 12:29

Re: HEs destroy grenades
 
The way you used to retrieve nade type may be not accurate.

Correct way is following :

PHP Code:

GetGrenadeTypeentbool:bCheckClass true 

    if( 
bCheckClass 
    { 
        new class[
9
        
pev(entpev_classname, class, charsmax(class)) 
        if( !
equal(class, "grenade") ) 
        { 
            return 

        

    } 

    if( 
get_pdata_bool(entm_bIsC4) ) 
    { 
        return 
CSW_C4 
    


    new 
usEvent get_pdata_short(entm_usEvent_Grenade
    if( !
usEvent 
    { 
        return 
CSW_FLASHBANG 
    


    static 
m_usHgrenExplo // , m_usSmokeExplo 
    
if( !m_usHgrenExplo 
    { 
        
m_usHgrenExplo engfunc(EngFunc_PrecacheEvent1"events/createexplo.sc"
        
// m_usSmokeExplo = engfunc(EngFunc_PrecacheEvent, 1, "events/createsmoke.sc") 
    


    return 
usEvent == m_usHgrenExplo CSW_HEGRENADE CSW_SMOKEGRENADE 




All times are GMT -4. The time now is 22:16.

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