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

HEs destroy grenades 1.1.1


Post New Thread Reply   
 
Thread Tools Display Modes
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 11-09-2013 , 17:22   Re: HEs destroy grenades
Reply With Quote #11

Quote:
Originally Posted by ConnorMcLeod View Post
The way you used to retrieve nade type may be not accurate.
Why? In what situations the check could fail?
BeasT is offline
Send a message via Skype™ to BeasT
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-30-2013 , 03:44  
Reply With Quote #12

Quote:
Originally Posted by BeasT View Post
Why? In what situations the check could fail?
trying to find nades in sphere, you gonna collect c4 as well.

Also, linux diff is 5 on nades.

What you should do for nade type detection is :

1. check m_bIsC4 so you can filter c4
2. check m_usEvent (use get_pdata_short (is integrated to amxx1.8.3 or you can find a stock))
if value is 0 : flashbang
if value is m_usExplo ( = precache_event(1, "events/createexplo.sc") ) -> he
else if value is m_usSmoke ( = precache_event(1, "events/createsmoke.sc") ) -> smoke


So, you should use the stock i've posted.

Last edited by ConnorMcLeod; 11-30-2013 at 04:37.
ConnorMcLeod is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 11-30-2013 , 05:09   Re: HEs destroy grenades
Reply With Quote #13

Quote:
Originally Posted by BeasT View Post
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...
I can't imagine why anyone wouldn't want to use Orpheu since some of the most powerful plugins are powered by it.
The second method is reliable, so long as the sounds have not been changed or blocked.

You don't need either of those in order for approval, but it would still be preferable.
Something you do need, during Think, check for either entity owner = 0, or for EF_NODRAW to prevent the final useless think after explosion.

Optional: Another and more efficient way with using think would be to use Ham_Think ( Post ) and only register the think when a grenade is thrown. On explosion, check for other grenade's existance, and then unregister think. This will also prevent the planted C4 from thinking ( Unless of course a HE grenade is thrown during C4 countdown ).
hornet is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 11-30-2013 , 08:09   Re: HEs destroy grenades
Reply With Quote #14

very good idea, but I have some questions/suggestions:
__________________
ANTICHRISTUS is offline
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 12-01-2013 , 12:33   Re: HEs destroy grenades
Reply With Quote #15

Quote:
Originally Posted by ConnorMcLeod View Post
What you should do for nade type detection is :

1. check m_bIsC4 so you can filter c4
Will do.

Quote:
Originally Posted by ConnorMcLeod View Post
2. check m_usEvent (use get_pdata_short (is integrated to amxx1.8.3 or you can find a stock))
if value is 0 : flashbang
if value is m_usExplo ( = precache_event(1, "events/createexplo.sc") ) -> he
I don't need to check for flash and HE, only for smoke, which I do by...

Quote:
Originally Posted by ConnorMcLeod View Post
else if value is m_usSmoke ( = precache_event(1, "events/createsmoke.sc") ) -> smoke
...using this check: if(get_pdata_int(nearbyNade, m_usEvent, XO_WEAPON) & SMOKENADE)
As far as I tested it works fine.



Quote:
Originally Posted by hornet View Post
Something you do need, during Think, check for either entity owner = 0, or for EF_NODRAW to prevent the final useless think after explosion.
Checking owner will do fine, imo.



Quote:
Originally Posted by ANTICHRISTUS View Post
very good idea, but I have some questions/suggestions:
1. Those won't get destroyed, because they are not "grenade" ents.
2. Should work.

Last edited by BeasT; 12-01-2013 at 12:35.
BeasT is offline
Send a message via Skype™ to BeasT
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 12-01-2013 , 13:26   Re: HEs destroy grenades
Reply With Quote #16

Quote:
Originally Posted by BeasT View Post
1. Those won't get destroyed, because they are not "grenade" ents.
idk.. can't you create a grenade entity at their place and make it exploding ? I am only suggesting.
Quote:
Originally Posted by BeasT View Post
2. Should work.
weapon physics and explosion X are directly tied to the dropped and ground weapons -;-.

I just wanted it to be more realistic, thanks anyway.
__________________
ANTICHRISTUS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-01-2013 , 15:09   Re: HEs destroy grenades
Reply With Quote #17

Quote:
Originally Posted by BeasT View Post
I don't need to check for flash and HE, only for smoke, which I do by...
You need to figure out which nade are smoke or not, implies to filter first c4.

Quote:
Originally Posted by BeasT View Post
...using this check: if(get_pdata_int(nearbyNade, m_usEvent, XO_WEAPON) & SMOKENADE)
As far as I tested it works fine.
This is only by chance.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 12-01-2013 , 17:21   Re: HEs destroy grenades 1.0.1
Reply With Quote #18

Update: filtered out C4.

Though I didn't find the check below necessary

Quote:
Originally Posted by hornet View Post
Something you do need, during Think, check for either entity owner = 0, or for EF_NODRAW to prevent the final useless think after explosion.
BeasT is offline
Send a message via Skype™ to BeasT
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 12-01-2013 , 17:45   Re: HEs destroy grenades 1.0.1
Reply With Quote #19

Quote:
Originally Posted by BeasT View Post
Checking owner will do fine, imo.
Quote:
Originally Posted by BeasT View Post
Though I didn't find the check below necessary
Opinion has no place here, only fact. And the fact of the matter is that you have chosen the least efficient method for your plugin, therefore the least you can do is prevent an extra think from being called.
hornet is offline
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 12-02-2013 , 10:56   Re: HEs destroy grenades 1.0.1
Reply With Quote #20

Quote:
Originally Posted by hornet View Post
Opinion has no place here, only fact. And the fact of the matter is that you have chosen the least efficient method for your plugin, therefore the least you can do is prevent an extra think from being called.
How is calling pev(he, pev_owner) on each think (about 16 times) more efficient then just calling two functions one time (that useless think)?
BeasT is offline
Send a message via Skype™ to BeasT
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 09:35.


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