Raised This Month: $ Target: $400
 0% 

[HELP] Scoping damage not being multiplied


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 06-14-2011 , 07:43   [HELP] Scoping damage not being multiplied
Reply With Quote #1

Ham_TraceAttack(post/pre)
PHP Code:
public fw_TraceAttack(victimattackerFloat:damageFloat:direction[3], trdamagebits)
{
    if(
victim == attacker || !is_user_alive(attacker) || !is_user_alive(victim) || !zp_get_user_zombie(victim))
        return 
HAM_IGNORED
        
    
if(!(<= victim <= iMaxPlayers))
        return 
HAM_IGNORED
        
    
if(get_tr2(trTR_iHitgroup) == HIT_HEAD)
    {
        
IsHeadshot[attacker] = true
    
}
    return 
HAM_IGNORED

FM_TraceLine(post/pre)
PHP Code:
public fw_TraceLine(Float:start[3], Float:end[3], noMonstersidtrace)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED
    
    
static victimvictim get_tr2(traceTR_pHit)
    
    if(!(
<= victim <= iMaxPlayers) || !is_user_alive(victim))
        return 
FMRES_IGNORED
    
    
if(get_tr2(traceTR_iHitgroup) == HIT_HEAD && (pev(idpev_button) & IN_ATTACK))
    {
        
IsHeadshot[id] = true
    
}
    
    return 
FMRES_IGNORED

Ham_TakeDamage(pre)
PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damage)
{
    if(
victim == attacker || !is_user_alive(victim) || !is_user_alive(attacker))
        return 
HAM_IGNORED
        
    
if(iCurrentClass[victim] == && !zp_get_user_zombie(victim))
        
set_pdata_float(victimOFFSET_PAINSHOCK1.0OFFSET_LINUX)
    
    if(!
zp_get_user_zombie(victim))
        return 
HAM_IGNORED
    
    
switch(iCurrentClass[attacker])
    {
        case 
1:
        {
            if(
SUPPORT_SPECIALIST)
                
SetHamParamFloat(4damage dmg_ss)
        }
        case 
2:
        {
            if(
SHARPSHOOTER)
            {
                if(
IsHeadshot[attacker])
                {
                    
IsHeadshot[attacker] = false
                    SetHamParamFloat
(4damage dmg_s hsdmg_s)
                }
                    
                else
                {
                    
SetHamParamFloat(4damage dmg_s)
                }
            }
        }
        case 
3:
        {
            if(
COMMANDO)
                
SetHamParamFloat(4damage dmg_c)
        }
        case 
4:
        {
            if(
BERSERKER)
                
SetHamParamFloat(4damage dmg_b)
        }
    }
    return 
HAM_IGNORED

Define
PHP Code:
#define SHARPSHOOTER        (iCurrentWeapon[attacker] == CSW_SCOUT || iCurrentWeapon[attacker] == CSW_AWP || iCurrentWeapon[attacker] == CSW_SG550 || iCurrentWeapon[attacker] == CSW_G3SG1 || iCurrentWeapon[attacker] == CSW_GLOCK18 || iCurrentWeapon[attacker] == CSW_USP || iCurrentWeapon[attacker] == CSW_P228 || iCurrentWeapon[attacker] == CSW_DEAGLE || iCurrentWeapon[attacker] == CSW_ELITE) 
Snipers damage multiplier doesn't seems to work at all. Other pistols damage do multiply. Sry. Could only give codes related to the problem.

Focus on the case 2 which is Sharpshooter.

More description:
Scope damage doesn't multiplies but without scope it does multiply.

Last edited by Excalibur.007; 06-15-2011 at 20:37.
Excalibur.007 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-14-2011 , 11:32   Re: [HELP] Snipers damage not being multiplied
Reply With Quote #2

Show all code where iCurrentWeapon is set.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 06-14-2011 , 19:18   Re: [HELP] Snipers damage not being multiplied
Reply With Quote #3

PHP Code:
register_event("CurWeapon""event_CurWeapon""be"
PHP Code:
public event_CurWeapon(id)
{
    if(!
is_user_alive(id))
        return 
PLUGIN_HANDLED
    
    iCurrentWeapon
[id] = read_data(2)
    
    if(
iCurrentClass[id] == 4)
    {    
        if(
iCurrentWeapon[id] != CSW_KNIFE)
            return 
PLUGIN_HANDLED
        
        
static Float:N_SpeedN_Speed rof_b
        
        
static weapon[32], ent
        get_weaponname
(iCurrentWeapon[id], weapon31)
        
ent fm_find_ent_by_owner(-1weaponid)
        
        if(
ent)
        {
            static 
Float:DelayFloat:M_Delay
            Delay 
get_pdata_float(ent464) * N_Speed
            M_Delay 
get_pdata_float(ent474) * N_Speed
            
            
if(Delay 0.0)
            {
                
set_pdata_float(ent46Delay4)
                
set_pdata_float(ent47M_Delay4)
            }
        }
    }
    return 
PLUGIN_HANDLED

Only CurWeapon is related to iCurrentWeapon.

Ignore this
PHP Code:
if(iCurrentClass[id] == 4)
{
//...

Oh there are FM_TraceLine & Ham_TraceAttack. Choose either 1 of them. Both of them have the same problems. My code uses both FM and Ham so just choose whichever is better.

Last edited by Excalibur.007; 06-14-2011 at 19:53.
Excalibur.007 is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 06-15-2011 , 20:37   Re: [HELP] Snipers damage not being multiplied
Reply With Quote #4

Anybody has the same problems?

Scoping doesn't adds the damage multiplier

Topic title changed. Not snipers but it's scoping.
Excalibur.007 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 23:34.


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