Raised This Month: $ Target: $400
 0% 

[Help] tripmine satchel trigger


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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