AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Super Destructive Grenades V2 (https://forums.alliedmods.net/showthread.php?t=163841)

hornet 08-04-2011 00:49

Super Destructive Grenades V2
 
4 Attachment(s)
Super Destructive Grenades
Version 2.1.0
By hornet

Description

This plugin sends weapons flying and knocks back players when a HE Grenade explodes in its vacinity. It also damages / destroys breakable entities including entities that are destroyed when the bomb goes off.

Last updated: May 31st, 2013

CVar:
  • sdg_breakables_damage
-Damage HE Grenade inflicts on surrounding breakable entities
  • sdg_explode_radius
-HE Grenade explosion radius for surrounding entities
  • sdg_break_mode <0|1|2>
-0 to disable functionaliy, 1 to damage breakable entities, 2 to always destroy them including bomb targeted entities
  • sdg_knockback_player
-The power amount used to knock back surrounding players
  • sdg_knockback_weapons
-The power amount used to knock back surrounding weapon entities
  • sdg_through_walls

    -Determines whether knockback will occur through solid objects [ Default 0 ]

Custom Modules Required

Installation
  • Have Orpheu Module installed ( see link in Required Modules )
  • Extract CGrenade folder into cstrike/addons/amxmodx/configs/orpheu/functions/

Credits
  • Arkshine - CGrenade::Detonate3 signature.

Changelog:


Quote:

2.1.0 [ 8/3/14 ] Cvar added for knockback through walls.

2.0.1 [ 31/5/13 ] Safety check added. Small efficiency revision.

2.0.0 [ 29/5/13 ] Huge update.
  • Grenades now use a radius damage formula to inflict damage on breakable entities
  • All weapon entities on the ground are now knocked back by grenade explosions
  • Players are now knocked back by grenade explosions ( obeys friendly fire )

Quote:

1.1.0 Plugin now uses Orpheu module for maximum efficiency. Also considers bomb targeted entities.
1.0.0 Inital Release

juan2394 08-04-2011 01:55

Re: HE Explosions Destroy Breakables
 
Cool!

nikhilgupta345 08-04-2011 02:04

Re: HE Explosions Destroy Breakables
 
Good job.

abdul-rehman 08-04-2011 05:55

Re: HE Explosions Destroy Breakables
 
Awesome.

Hunter-Digital 08-04-2011 06:54

Re: HE Explosions Destroy Breakables
 
Shouldn't you check if the breakable is meant to be broken ? For example, the crates on de_dust2 are breakable but they only break when C4 explodes due to a trigger, will your plugin break those ?

Still... doesn't HE already break stuff on explosion, like glass... ?

ConnorMcLeod 08-04-2011 08:10

Re: HE Explosions Destroy Breakables
 
Dunno if it only breaks on touch or also when explode.
I think there should be a better way that Think to detect explosion.

Arkshine 08-04-2011 09:10

Re: HE Explosions Destroy Breakables
 
To detect HE grenade explosion, there are not much ways :

Using Orpheu :

- Hooking CGrenade::Detonate3() or CGrenade::Explode3() : The most efficient/reliable method.

Without Orpheu :

- Checking exploding time with pev_dmgtime by hooking "grenade" think. Method is acceptable, though forward will be called until the grenade dies, not cool.
- Using grenade_throw forward, setting a set_task or next think of a dummy entity, to (pev_dmgtime - gametime) seconds. Not a good way, because we don't know if the grenade has really exploded.
- Hooking TE_EXPLOSION (There is 2 messages) with register_event (SVC_TEMPENTITY). "1=3" "6=25" "7=30" "8=0". Not a good way since you need the grenade entity index and it could be thrown for another purpose.
- Using grenade_throw forward, hooking FM_EmitSound, checking "weapons/debris1.wav" + "weapons/debris2.wav" + "weapons/debris3.wav" + checking the grenade is well a grenade and unregistering FM_EmitSound. Not bad.

Of course, I would use Orpheu. :mrgreen:
Without Orpheu, between, dmgtime and emitsound, I guess the latter would fairly good.

ConnorMcLeod 08-04-2011 09:33

Re: HE Explosions Destroy Breakables
 
If you keep fm_cs_get_grenade_type, put the c4 check back ;), and don't bother with the 3 nades types, once the c4 check passed, only check for HE ;)

Arkshine 08-04-2011 15:24

Re: HE Explosions Destroy Breakables
 
Normally the c4 check is not required since the offset is different.

Considering that and since m_usEvent is set when a grenade spawns only, it means that checking if it's a C4 before is not needed. Checking m_usEvent & 1 (or 1<<0) should be enough.

Hunter-Digital 08-04-2011 19:12

Re: HE Explosions Destroy Breakables
 
Oh nvm, I just tested on de_prodigy, HE grenade doesn't break the glass on explosion, it just makes the glass damage sound but it doesn't actually damage it, it seems... that's disappointing =)


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

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