AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Calling grenade explosion (https://forums.alliedmods.net/showthread.php?t=168535)

NiHiLaNTh 09-30-2011 13:55

Calling grenade explosion
 
So the actually the question is - how to call HE grenade explosion.I mean explosion sprites etc.I thought there is an event which creates an explosion, but I wasn't able to catch it.

Obviously it can be done through using orpheu and calling this:

Code:

CGrenade::ShootTimed2( m_pPlayer->pev, vecSrc, vecThrow, 1.5, m_pPlayer->m_iTeam, m_usExplo );


Although I am not sure will this work :? .

Arkshine 09-30-2011 14:21

Re: Calling grenade explosion
 
This function sets up the grenade and it will explode after 1,5 seconds. But if for just the explosion, you may not needed to setup like a real grenade. I mean setting offset, some pev, model and such may be fairly pointless, therefore the method below would be more appropriate.

Without using Orpheu, you can simply create a "grenade" entity at a specific origin, set pev_dmg with a value > 40 (otherwise you will get a flashbang explosion) and forcing it to think, then it should explode right away. (EDIT: not sure it will work actually, if you don't mind using orpheu, use it)

NiHiLaNTh 09-30-2011 14:45

Re: Calling grenade explosion
 
Damn it, obviously I explained it wrong.

Anyway, I have created a grenade launcher, and whenever grenade projectile launched by it touches something it should explode.All I need is explosion sprite(radius damage is needed too, since my radius damage stocks sucks!).

I tried your method and it doesn't work :(

Arkshine 09-30-2011 14:48

Re: Calling grenade explosion
 
So you should call directly CGrenade::Detonate3()

NiHiLaNTh 09-30-2011 15:14

Re: Calling grenade explosion
 
It works, thanks for helping. :oops:

If what this post helped me a lot^^

Arkshine 09-30-2011 15:51

Re: Calling grenade explosion
 
lol, did not remember that at all.


All times are GMT -4. The time now is 19:37.

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