AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Orpheu] CGrenade::Detonate3 (https://forums.alliedmods.net/showthread.php?t=196671)

bogdyuttzu 09-24-2012 03:09

[Orpheu] CGrenade::Detonate3
 
2 Attachment(s)
Hi, I found this post about how to call grenades functions with orpheu:

http://forums.alliedmods.net/showpos...2&postcount=11

I try to use Detonate3 in mine grenade launcher but the explosion is show only on vertical platforms and don't give damage.

PHP Code:

public CGrenade_OnTouch( const grenade, const entity )
{
    if( 
pevgrenadePEV_NADE_TYPE ) ==  NADE_TYPE_GRENADE )
        
CGrenade_Detonate3grenade );
}
CGrenade_Detonate3( const grenade )
{
    static 
OrpheuFunction:HandleDetonate3;

    if ( !
HandleDetonate3 )
    {
        
HandleDetonate3 OrpheuGetFunction"Detonate3""CGrenade" );
    }

    
OrpheuCallHandleDetonate3grenade );



Arkshine 09-24-2012 05:23

Re: [Orpheu] CGrenade::Detonate3
 
Is pev_dmg set with a value ?

bogdyuttzu 09-24-2012 05:36

Re: [Orpheu] CGrenade::Detonate3
 
Thanks now its work fine

Arkshine 09-24-2012 05:48

Re: [Orpheu] CGrenade::Detonate3
 
Because pev->dmg is used as reference value to pull the explosion up out the wall a bit, like :

Code:

if ( pTrace->flFraction != 1.0 )
{
        pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * (pev->dmg - 24) * 0.6);
}

So, you should set a value to pev_dmg. In CS, the value is 100 for HE grenade, you can put what you want but I think the value above (24, 0.6) has been tuned for around 100 or something.
Well, just test.


All times are GMT -4. The time now is 08:11.

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