Raised This Month: $ Target: $400
 0% 

[Help] tripmine satchel trigger


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ujjl
Senior Member
Join Date: Jul 2009
Location: Hungary
Old 01-30-2010 , 10:52   [Help] tripmine satchel trigger
Reply With Quote #1

How to blow up a satchels, or tripmines, if i know theire entity id?

I have to remove them, but i dont want to use
Code:
engfunc(EngFunc_RemoveEntity, ent);
And i need to set the activator (who blowed up them) to a specific player id.
__________________
- blupi blupi
ujjl is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-30-2010 , 11:21   Re: [Help] tripmine satchel trigger
Reply With Quote #2

Normal way :

For satchel, you can use Ham_Use, or force_use().
For tripmine, you can try to set to 0 m_hOwner offset.

With Orpheu :

For satchel, call : CGrenade::Detonate()
For tripmine, call : CGrenade::Explode() or CGrenade::Detonate().
__________________
Arkshine is offline
ujjl
Senior Member
Join Date: Jul 2009
Location: Hungary
Old 01-30-2010 , 13:55   Re: [Help] tripmine satchel trigger
Reply With Quote #3

Quote:
For tripmine, you can try to set to 0 m_hOwner offset.
EDIT:
I have to use Ham_TakeDamage

THX, solved.
__________________
- blupi blupi

Last edited by ujjl; 01-30-2010 at 14:07.
ujjl is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-30-2010 , 14:06   Re: [Help] tripmine satchel trigger
Reply With Quote #4

Code:
	float		m_flPowerUp;
	Vector		m_vecDir;
	Vector		m_vecEnd;
	float		m_flBeamLength;

	EHANDLE		m_hOwner;
	CBeam		*m_pBeam;
	Vector		m_posOwner;
	Vector		m_angleOwner;
	edict_t		*m_pRealOwner;// tracelines don't hit PEV->OWNER, which means a player couldn't detonate his own trip mine, so we store the owner here.
};
EHANDLE is not Cbase
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-30-2010 , 14:09   Re: [Help] tripmine satchel trigger
Reply With Quote #5

For Tripmine looks the code :
PHP Code:
void CTripmineGrenade :: BeamBreakThinkvoid  )
{
    
BOOL bBlowup 0;

    
TraceResult tr;

    
// HACKHACK Set simple box using this really nice global!
    
gpGlobals->trace_flags FTRACE_SIMPLEBOX;
    
UTIL_TraceLinepev->originm_vecEnddont_ignore_monstersENTpev ), &tr );

    
// ALERT( at_console, "%f : %f\n", tr.flFraction, m_flBeamLength );

    // respawn detect. 
    
if ( !m_pBeam )
    {
        
MakeBeam( );
        if ( 
tr.pHit )
            
m_hOwner CBaseEntity::Instancetr.pHit );    // reset owner too
    
}

    if (
fabsm_flBeamLength tr.flFraction ) > 0.001)
    {
        
bBlowup 1;
    }
    else
    {
        if (
m_hOwner == NULL)
            
bBlowup 1;
        else if (
m_posOwner != m_hOwner->pev->origin)
            
bBlowup 1;
        else if (
m_angleOwner != m_hOwner->pev->angles)
            
bBlowup 1;
    }

    if (
bBlowup)
    {
        
// a bit of a hack, but all CGrenade code passes pev->owner along to make sure the proper player gets credit for the kill
        // so we have to restore pev->owner from pRealOwner, because an entity's tracelines don't strike it's pev->owner which meant
        // that a player couldn't trigger his own tripmine. Now that the mine is exploding, it's safe the restore the owner so the 
        // CGrenade code knows who the explosive really belongs to.
        
pev->owner m_pRealOwner;
        
pev->health 0;
        
KilledVARSpev->owner ), GIB_NORMAL );
        return;
    }

    
pev->nextthink gpGlobals->time 0.1;

PHP Code:
        if (m_hOwner == NULL)
            
bBlowup 1;
        else if (
m_posOwner != m_hOwner->pev->origin)
            
bBlowup 1;
        else if (
m_angleOwner != m_hOwner->pev->angles)
            
bBlowup 1
it will explode if m_hOwner is null, or if m_posOwner/m_angleOwner is different.
For m_hOwner, get_pdata_ent() should work.
__________________
Arkshine is offline
ujjl
Senior Member
Join Date: Jul 2009
Location: Hungary
Old 01-30-2010 , 14:24   Re: [Help] tripmine satchel trigger
Reply With Quote #6

Yes it will blow up, but the made frags will count for the original deployer, not for the specified player. (Correct me if im wrong)
__________________
- blupi blupi
ujjl is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-30-2010 , 15:01   Re: [Help] tripmine satchel trigger
Reply With Quote #7

Which is logic.. I don't get your point.
__________________
Arkshine is offline
ujjl
Senior Member
Join Date: Jul 2009
Location: Hungary
Old 01-30-2010 , 15:06   Re: [Help] tripmine satchel trigger
Reply With Quote #8

Im destroying respawn mines when a player respawn near to them, so the frags made the explosion because of destroying them shoud be counted for the respawner (who is in respawn protection for avoiding suicide)
So force_use and takedamage works well.
__________________
- blupi blupi
ujjl is offline
Reply



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 07:20.


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