MisterDeath
Частый гость

Дата регистрации: Nov 2010
Проживает: asd
Сообщений: 91
Возраст: 29
Рейтинг
|
Kill Mine
I modified transformed tripmine to kill mine, the function is player touch laser, kill instantany player...
but not works...
C++ Source Code:
1 | void CTripmineGrenade :: BeamBreakThink( void ) |
7 | // HACKHACK Set simple box using this really nice global! |
8 | gpGlobals->trace_flags = FTRACE_SIMPLEBOX; |
9 | UTIL_TraceLine( pev->origin, m_vecEnd, dont_ignore_monsters, ENT( pev ), &tr ); |
11 | // ALERT( at_console, "%f : %f\n", tr.flFraction, m_flBeamLength ); |
18 | m_hOwner = CBaseEntity::Instance( tr.pHit ); // reset owner too |
20 | CBaseEntity *pEntity = CBaseEntity::Instance(tr.pHit); |
22 | if ( tr.pHit->v.takedamage ) |
26 | CBaseEntity::Instance(tr.pHit)->TraceAttack(pev, 120, ( pev->origin - m_vecEnd), &tr, DMG_BULLET | DMG_NEVERGIB ); |
27 | ApplyMultiDamage( pev, pev ); |
32 | if (fabs( m_flBeamLength - tr.flFraction ) > 0.001) |
40 | else if (m_posOwner != m_hOwner->pev->origin) |
42 | else if (m_angleOwner != m_hOwner->pev->angles) |
48 | // a bit of a hack, but all CGrenade code passes pev->owner along to make sure the proper player gets credit for the kill |
49 | // so we have to restore pev->owner from pRealOwner, because an entity's tracelines don't strike it's pev->owner which meant |
50 | // that a player couldn't trigger his own tripmine. Now that the mine is exploding, it's safe the restore the owner so the |
51 | // CGrenade code knows who the explosive really belongs to. |
52 | pev->owner = m_pRealOwner; |
54 | Killed( VARS( pev->owner ), GIB_NORMAL ); |
58 | pev->nextthink = gpGlobals->time + 0.1; |
Sorry Bad English 
__________________
hl 4 ever
Сообщить модератору | IP: Записан
Сообщение: 91322
|