Smoke grenade explosion delay + finding players in radius [SOLVED]
Hello, guys! I'm trying to make some type of hallelujah nade (that's what I thought of). It will be in the slot of the smoke nade. So, the first questions are:
- How can I detect when the smoke (and future nade) stays still on the ground (when it stops bouncing and moving and is ready to explode)? I guess with FM_EmitSound would be good to check when the smoke explosion sound is being started, then destroy the ent and etc.? - How to set a timer before the explosion, after the nade has stopped on the ground? I want to play some creepy "hallelujah" sound while the nade stays on the ground and then, like after 8 seconds, to explode. - How to create a circle with a radius, where to put a fire ring explosion effect and the most important - to set some damage in this radius. This damage stuff is unfortunately pretty unclear for me and еspecially for the radius. This'd be the most helpful info. I tried to search for similar functions in some other nades, bub didn't find the exact events/forwards I need. I haven't worked with nades so much before and am some kind of unexperienced with this type of coding. So if someone could be nice enough to explain me long and detailed, I'd be very thankful! |
Re: Hallelujah nade - base questions about nade entities
1. You mean the moment right before nade explosion ? If so you can hook CGrenade::SG_Detonate() as pre with orpheu and remove the entity there, then spawn another one in it's place. If you don't want to work with orpheu or you don't know I may give you the code or you can use FM_EmitSound too, but it's not a good ideea since you have the direct way with orpheu. You can also hook CGrenade::SG_Detonate() as post, block the smokegrenade effect and use m_SGExplosionPos offset to get it's origin, then spawn your new grenade with this origins.
2. When you create your new nade entity set pev_dmgtime to a higer value so it will explode x seconds later. 3. If you want to set a damage in a specific radius use find_sphere_class( it works like get_players and give you an array of players) then use ExecuteHam(Ham_TakeDamage,...) in the for loop. About the circle, you mean like an wave that starts from nade origin and go to the "end point" of the radius ? If so, look for TE_BEAMCYLINDER The function that create the c4(grenade entity) is CGrenade::ShootSatchelCharge(), it can be hooked and you can create very easy a planted c4. I would like to know if this can be done with a smokegrenade too(maybe two minutes of searching into the cssdk but I'm too lazy now). Glad to see you back :d |
Re: Hallelujah nade - base questions about nade entities
Duuuuude, you have gone some lightyears further in the coding. Also glad to see your progress!
1. Also, I've never known anything about orpheu and at this point I'm too afraid to work with it, but there is first time for everything! So I'm gonna try what you have suggested, since it seems to be the most effective method. I'll just need some little example of the function, to create some conception in my mind. Will google a lot, it's obvious. :D 2. That's clear, I think I'll succeed with it. 3. Aaaand that's again super unknown for me... I mean, the find_sphere_class(), how do I define the end point of the radius and in which value is the distance from the center to the end point of the radius? And before someone says to google and search - I did that already, but at this point I've understood nothing from the threads around... |
Re: Hallelujah nade - base questions about nade entities
|
Re: Hallelujah nade - base questions about nade entities
http://amxmodx.org/api/engine/find_sphere_class
Better to use the new documentation, more convenient :D 1. Oprheu it's not hard, the hard part is searching for functions in windows dll( they don't have names so you need to search by used strings ), finding what function do what you want, but you get used with it after some time. This is the signature: Code:
{The code: PHP Code:
3. You choose your radius as you want. PHP Code:
|
Re: Hallelujah nade - base questions about nade entities
So, as first I tried that, just to remove the smoke nade before it explodes:
PHP Code:
|
Re: Hallelujah nade - base questions about nade entities
PHP Code:
Code:
It worksPHP Code:
Run orpheu config command into your server console and look into addons/amxmodx/logs. You should see something like Code:
Parsing folder "CGrenade" started |
Re: Hallelujah nade - base questions about nade entities
Maybe it's something with the orpheu module itself, that I'm not doing right. Tried the both codes, put some info messages everywhere - nothing. I think the hook doesn't even get called, will check the instalation and return with some answers.
EDIT: It all seems to be alright, I have no idea what's going on... I hate that :D |
Re: Hallelujah nade - base questions about nade entities
You didn't installed the plugin right or the signature. Give me the output of the orpheu config command.
|
Re: Hallelujah nade - base questions about nade entities
Orpheu config command:
Code:
Orpheu configuration started. |
| All times are GMT -4. The time now is 15:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.