View Single Post
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 03-12-2008 , 16:04   Re: modCS (damage/speed mod for CSS)
Reply With Quote #43

It just uses sourcehook to hook the TraceAttack function on each player that joins. Then this code gets called every time the game's TraceAttack gets called:
Code:
void SamplePlugin::TraceAttack_handler( CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr )
{
    // adjust damage for ALL players 
    float damage = info.GetDamage();
    damage = damage * mc_damage_mult.GetFloat() + mc_damage_add.GetFloat();
    info.SetDamage(damage);

    // use modified damage info
    RETURN_META(MRES_HANDLED);  
}
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline