Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Respawn Kill
#8
i was going to post this under a new topic, but i think it's more fitting here:

i fixed the whole "getting extra points off the dead and decapitated in dm" thing...using the code snipet i posted above in red. however, it is exactly the same logic and idea as netniv was suggesting (equivalent because their is no real need for the nested 'if' statement that i placed the new condition in...doesn't hurt anything though in terms of cycles of course).

to reiterate, if you want to get rid of people exploiting the dead in dm, do this ^_^:

just comment out the original function DiscTouch() belonging to the CDisc class in "disc_weapon_disc.cpp" (as shown in the first post in this thread), and place this modified function directly below it (you could just modify that small chunk of code but be careful in case you want to revert):

void CDisc::DiscTouch ( CBaseEntity *pOther )
{
// Push players backwards
if ( pOther->IsPlayer() )
{
if ( ((CBaseEntity*)m_hOwner) == pOther )
{
if (m_fDontTouchOwner < gpGlobals->time)
{
// Play catch sound
EMIT_SOUND_DYN( pOther->edict(), CHAN_WEAPON, "items/gunpickup2.wav", 1.0, ATTN_NORM, 0, 98 + RANDOM_LONG(0,3));

ReturnToThrower();
}

return;
}
else if ( m_fDontTouchEnemies < gpGlobals->time)
{
// .ASM - netniV's solution to the "extra point" exploit
if ( (pev->team != pOther->pev->team) && (pOther->IsAlive()) ) // end .ASM

{
((CBasePlayer*)pOther)->m_LastHitGroup = HITGROUP_GENERIC;

// Do freeze seperately so you can freeze and shatter a person with a single shot
if ( m_iPowerupFlags & POW_FREEZE && ((CBasePlayer*)pOther)->m_iFrozen == FALSE )
{
// Freeze the player and make them glow blue
EMIT_SOUND_DYN( pOther->edict(), CHAN_WEAPON, "weapons/electro5.wav", 1.0, ATTN_NORM, 0, 98 + RANDOM_LONG(0,3));
((CBasePlayer*)pOther)->Freeze();

// If it's not a decap, return now. If it's a decap, continue to shatter
if ( !m_bDecapitate )
{
m_fDontTouchEnemies = gpGlobals->time + 2.0;
return;
}
}

// Decap or push
if (m_bDecapitate)
{
// Decapitate!
if ( m_bTeleported )
((CBasePlayer*)pOther)->m_flLastDiscHitTeleport = gpGlobals->time;
((CBasePlayer*)pOther)->Decapitate( ((CBaseEntity*)m_hOwner)->pev );

m_fDontTouchEnemies = gpGlobals->time + 0.5;
}
else
{
// Play thwack sound
switch( RANDOM_LONG(0,2) )
{
case 0:
EMIT_SOUND_DYN( pOther->edict(), CHAN_ITEM, "weapons/cbar_hitbod1.wav", 1.0, ATTN_NORM, 0, 98 + RANDOM_LONG(0,3));
break;
case 1:
EMIT_SOUND_DYN( pOther->edict(), CHAN_ITEM, "weapons/cbar_hitbod2.wav", 1.0, ATTN_NORM, 0, 98 + RANDOM_LONG(0,3));
break;
case 2:
EMIT_SOUND_DYN( pOther->edict(), CHAN_ITEM, "weapons/cbar_hitbod3.wav", 1.0, ATTN_NORM, 0, 98 + RANDOM_LONG(0,3));
break;
}

// Push the player
Vector vecDir = pev->velocity.Normalize();
pOther->pev->flags &= ~FL_ONGROUND;
((CBasePlayer*)pOther)->m_vecHitVelocity = vecDir * DISC_PUSH_MULTIPLIER;

// Shield flash only if the player isnt frozen
if ( ((CBasePlayer*)pOther)->m_iFrozen == false )
{
pOther->pev->renderfx = kRenderFxGlowShell;
pOther->pev->rendercolor.x = 255;
pOther->pev->renderamt = 150;
}

((CBasePlayer*)pOther)->m_hLastPlayerToHitMe = m_hOwner;
((CBasePlayer*)pOther)->m_flLastDiscHit = gpGlobals->time;
((CBasePlayer*)pOther)->m_flLastDiscBounces = m_iBounces;
if ( m_bTeleported )
((CBasePlayer*)pOther)->m_flLastDiscHitTeleport = gpGlobals->time;

m_fDontTouchEnemies = gpGlobals->time + 2.0;
}
}
}
}
Reply


Messages In This Thread
Respawn Kill - by Guest - 07-29-2003, 03:48 PM
Respawn Kill - by Guest - 07-29-2003, 03:52 PM
Respawn Kill - by evil_admin - 07-29-2003, 09:42 PM
Respawn Kill - by Guest - 07-30-2003, 02:22 AM
Respawn Kill - by kermit - 08-09-2003, 10:55 PM
Respawn Kill - by Gwarsbane - 08-09-2003, 11:20 PM
Respawn Kill - by kermit - 08-09-2003, 11:49 PM
Respawn Kill - by kermit - 08-10-2003, 01:28 AM
Respawn Kill - by Guest - 08-10-2003, 10:19 AM

Forum Jump:


Users browsing this thread: 4 Guest(s)