new const Float:kb_weapon_power[] =
{
-1.0, // ---
2.4, // P228
-1.0, // ---
6.5, // SCOUT
-1.0, // ---
8.0, // XM1014
-1.0, // ---
2.3, // MAC10
5.0, // AUG
-1.0, // ---
2.4, // ELITE
2.0, // FIVESEVEN
2.4, // UMP45
5.3, // SG550
5.5, // GALIL
5.5, // FAMAS
2.2, // USP
2.0, // GLOCK18
10.0, // AWP
2.5, // MP5NAVY
5.2, // M249
8.0, // M3
5.0, // M4A1
2.4, // TMP
6.5, // G3SG1
-1.0, // ---
5.3, // DEAGLE
5.0, // SG552
6.0, // AK47
-1.0, // ---
2.0 // P90
};
@CBasePlayer_TraceAttack_Post(id, attacker, Float:damage, Float:vecDir[3], tracehandle, bitsDamageType)
{
if (!(bitsDamageType & (DMG_NEVERGIB | DMG_BULLET)))
return;
if( id == attacker || !is_user_connected( attacker ) )
return;
if (!rg_is_player_can_takedamage(id, attacker))
return;
new Float:weaponPower = 1.0;
new Float:ducking = 1.0;
new Float:knockback = 1.0;
new Float:vecVelocity[3];
get_entvar(id, var_velocity, vecVelocity);
new attacker_weapon = get_user_weapon(attacker);
if ( kb_weapon_power[attacker_weapon] > 0.0 )
weaponPower = kb_weapon_power[attacker_weapon];
if (get_entvar(id, var_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND))
ducking = 0.25;
knockback = 2.0;
for ( new i = 0; i < 3; i++ )
vecVelocity[i] += vecDir[i] * damage * weaponPower * ducking * knockback;
set_entvar(id, var_velocity, vecVelocity);
}