Raised This Month: $ Target: $400
 0% 

knockback power


Post New Thread Reply   
 
Thread Tools Display Modes
kazuki
Senior Member
Join Date: Dec 2008
Old 04-05-2009 , 08:35   Re: knockback power
Reply With Quote #11

what do u mean by this ?

Quote:
edit Zombie_Plague40.sma knockback function code (above)
kazuki is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-05-2009 , 10:10   Re: knockback power
Reply With Quote #12

I mean find
PHP Code:
public fw_TraceAttack(victimattackerFloat:damageFloat:direction[3], tracehandledamage_type)
{
    
// Non-player damage or self damage
    
if (victim == attacker || !is_user_connected(attacker))
        return 
HAM_IGNORED;
    
    
// New round starting or round ended
    
if (g_newround || g_endround)
        return 
HAM_SUPERCEDE;
    
    
// Victim shouldn't take damage or victim is frozen
    
if (g_nodamage[victim] || g_frozen[victim])
        return 
HAM_SUPERCEDE;
    
    
// Prevent friendly fire
    
if (g_zombie[attacker] == g_zombie[victim])
        return 
HAM_SUPERCEDE;
    
    
// Victim isn't a normal zombie
    
if (!g_zombie[victim] || g_nemesis[victim])
        return 
HAM_IGNORED;
    
    
// Get custom hitzones setting
    
static hitzones
    hitzones 
get_pcvar_num(cvar_hitzones)
    
    
// Check if we hit an allowed one
    
if (hitzones && !(hitzones & (1<<get_tr2(tracehandleTR_iHitgroup))))
        return 
HAM_SUPERCEDE;
    
    
// Knockback disabled or not bullet damage
    
if (!(damage_type DMG_BULLET) || !get_pcvar_num(cvar_knockback))
        return 
HAM_IGNORED;
    
    
// Get victim flags and knockback while ducking setting
    
static victimflagsFloat:knockduck
    victimflags 
pev(victimpev_flags)
    
knockduck get_pcvar_float(cvar_knockbackducking)
    
    
// Zombie is ducking on ground
    
if (knockduck == 0.0 && (victimflags FL_DUCKING) && (victimflags FL_ONGROUND))
        return 
HAM_IGNORED;
    
    
// Get distance between players
    
static Float:origin1F[3], Float:origin2F[3]
    
pev(victimpev_originorigin1F)
    
pev(attackerpev_originorigin2F)
    
    
// Max distance exceeded
    
if (get_distance_f(origin1Forigin2F) > get_pcvar_float(cvar_knockbackdist))
        return 
HAM_IGNORED;
    
    
// Get victim's velocity
    
static Float:velocity[3]
    
pev(victimpev_velocityvelocity)
    
    
// Use damage on knockback calculation
    
if (get_pcvar_num(cvar_knockbackdamage))
        
xs_vec_mul_scalar(directiondamagedirection)
    
    
// Use weapon power on knockback calculation
    
if (kb_weapon_power[g_currentweapon[attacker]] > 0.0 && get_pcvar_num(cvar_knockbackpower))
        
xs_vec_mul_scalar(directionkb_weapon_power[g_currentweapon[attacker]], direction)
    
    
// Apply ducking knockback multiplier
    
if ((victimflags FL_DUCKING) && (victimflags FL_ONGROUND))
        
xs_vec_mul_scalar(directionknockduckdirection)
    
    
// Apply zombie class knockback multiplier
    
xs_vec_mul_scalar(directiong_zclass_kb[g_zombieclass[victim]], direction)
    
    
// Add up the new vector
    
xs_vec_add(velocitydirectiondirection)
    
    
// Should knockback also affect vertical velocity?
    
if (!get_pcvar_num(cvar_knockbackzvel))
        
direction[2] = velocity[2]
    
    
// Set the knockback'd victim's velocity
    
set_pev(victimpev_velocitydirection)
    
    return 
HAM_IGNORED;

In zombie_plague40.sma and add
if (user_has_antiknocback_extraitem[id]) retund HAM_IGNORED;
Into it.
Also you'll need to add extraitem itself and variable that stores if player has this item or not. In example above this variable is user_has_antiknocback_extraitem
__________________

SonicSonedit is offline
Reply



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 19:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode