Raised This Month: $95 Target: $400
 23% 

HEs destroy grenades 1.1.1


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose        Approver:   Arkshine (91)
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 11-08-2013 , 09:01   HEs destroy grenades 1.1.1
Reply With Quote #1

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.
Attached Files
File Type: sma Get Plugin or Get Source (hdg.sma - 314 views - 3.5 KB)
File Type: zip signatures.zip (1.5 KB, 180 views)

Last edited by BeasT; 01-25-2015 at 12:35.
BeasT is offline
Send a message via Skype™ to BeasT
bibu
Veteran Member
Join Date: Sep 2010
Old 11-08-2013 , 11:30   Re: HEs destroy grenades
Reply With Quote #2

Cool idea and good job!
__________________
Accepting paid work for clans and communities. !Plugins & Models!
Don't hesitate to contact me.
bibu is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 11-08-2013 , 12:11   Re: HEs destroy grenades
Reply With Quote #3

Destroy?
You should use another word
Btw, good job
__________________
alan_el_more is offline
Old 11-09-2013, 04:28
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: you continue
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 11-09-2013 , 08:29   Re: HEs destroy grenades
Reply With Quote #4

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

Last edited by hornet; 11-09-2013 at 08:31.
hornet is offline
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 11-09-2013 , 10:24   Re: HEs destroy grenades
Reply With Quote #5

Quote:
Originally Posted by hornet View Post
  • Hook CGrenade:etonate3()
  • 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 View Post
Destroy?
You should use another word
Quote:
Originally Posted by LordOfNothing View Post
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...
BeasT is offline
Send a message via Skype™ to BeasT
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 11-09-2013 , 10:36   Re: HEs destroy grenades
Reply With Quote #6

If the grenades were destroyed, they should just disappear without detonating. That's my point of view
__________________
alan_el_more is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-09-2013 , 10:58   Re: HEs destroy grenades
Reply With Quote #7

Quote:
Originally Posted by alan_el_more View Post
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
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (intervening in a thread, asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
DWIGHTpN
Senior Member
Join Date: Jan 2013
Location: Romania.
Old 11-09-2013 , 11:02   Re: HEs destroy grenades
Reply With Quote #8

Gj, nice plugin
Although this plugin was written by you (your original idea), would be great if nademodes by OT would contain this mod .
DWIGHTpN is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 11-09-2013 , 11:28   Re: HEs destroy grenades
Reply With Quote #9

Quote:
Originally Posted by YamiKaitou View Post
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
__________________
alan_el_more is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-09-2013 , 13:29   Re: HEs destroy grenades
Reply With Quote #10

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 

__________________
- tired and retired -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 02:07.


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