Raised This Month: $ Target: $400
 0% 

Traceline hit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
m4m3ts
Senior Member
Join Date: Jun 2012
Old 01-19-2014 , 19:57   Traceline hit
Reply With Quote #1

i got this script for hit multiple player for deagle weapon, (make higher penetration)

https://forums.alliedmods.net/showthread.php?t=148432

but i have no idea to use that.
i try on ham_traceattack, but not work.
please help.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

public plugin_init()
{
    
RegisterHam(Ham_TraceAttack"player""fw_PlayerTraceAttack")
}


public 
fw_PlayerTraceAttack(VictimAttackerFloat:DamageFloat:Direction[3], TraceResultDamageBits
{
    if(!
is_user_alive(Attacker))    
        return 
HAM_IGNORED
    
if(get_user_weapon(Attacker) != CSW_DEAGLE)
        return 
HAM_IGNORED
    
    trace
()
        
    return 
HAM_SUPERCEDE
}

public 
trace()
{
    new 
Float:vecStart[3// This should be the original start position
    
new Float:vecEnd[3// And this should be the end position

    
new iTraceHit // hitted entity
    
new iEntToIgnore // this would change at every trace
    
new iTraceHandle create_tr2()// trace handle

    
while(engfunc(EngFunc_TraceLinevecStartvecEndDONT_IGNORE_MONSTERSiEntToIgnoreiTraceHandle)) // will always return 1, see engfunc.cpp
    
{
        
iTraceHit get_tr2(iTraceHandleTR_pHit// getting hitted entity
        
        
if(get_global_float(GL_trace_fraction) >= 1.0// the traceline finished at the original end position, so we will stop here
            
break;
        
        if(!
is_user_alive(iTraceHit)) // if you want to stop the traceline when it hits a wall, use this
            
break;
            
        
// your functions here
        
        // the next traceline will start at the end of the last one
        
iEntToIgnore iTraceHit
        get_tr2
(iTraceHandleTR_vecEndPosvecStart)
    }

    
get_tr2(iTraceHandleTR_vecEndPosvecEnd// out of the loop, this will get the last position of the last traceline. you can use a beam effect or something if you want

    
free_tr2(iTraceHandle// freeing the tracehandle  

and how to limit for certain mount of enemy ?
thanks.
m4m3ts is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 01-19-2014 , 20:38   Re: Traceline hit
Reply With Quote #2

Quote:
Originally Posted by m4m3ts View Post
i got this script for hit multiple player for deagle weapon, (make higher penetration)

https://forums.alliedmods.net/showthread.php?t=148432

but i have no idea to use that.
i try on ham_traceattack, but not work.
please help.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

public plugin_init()
{
    
RegisterHam(Ham_TraceAttack"player""fw_PlayerTraceAttack")
}


public 
fw_PlayerTraceAttack(VictimAttackerFloat:DamageFloat:Direction[3], TraceResultDamageBits
{
    if(!
is_user_alive(Attacker))    
        return 
HAM_IGNORED
    
if(get_user_weapon(Attacker) != CSW_DEAGLE)
        return 
HAM_IGNORED
    
    trace
()
        
    return 
HAM_SUPERCEDE
}

public 
trace()
{
    new 
Float:vecStart[3// This should be the original start position
    
new Float:vecEnd[3// And this should be the end position

    
new iTraceHit // hitted entity
    
new iEntToIgnore // this would change at every trace
    
new iTraceHandle create_tr2()// trace handle

    
while(engfunc(EngFunc_TraceLinevecStartvecEndDONT_IGNORE_MONSTERSiEntToIgnoreiTraceHandle)) // will always return 1, see engfunc.cpp
    
{
        
iTraceHit get_tr2(iTraceHandleTR_pHit// getting hitted entity
        
        
if(get_global_float(GL_trace_fraction) >= 1.0// the traceline finished at the original end position, so we will stop here
            
break;
        
        if(!
is_user_alive(iTraceHit)) // if you want to stop the traceline when it hits a wall, use this
            
break;
            
        
// your functions here
        
        // the next traceline will start at the end of the last one
        
iEntToIgnore iTraceHit
        get_tr2
(iTraceHandleTR_vecEndPosvecStart)
    }

    
get_tr2(iTraceHandleTR_vecEndPosvecEnd// out of the loop, this will get the last position of the last traceline. you can use a beam effect or something if you want

    
free_tr2(iTraceHandle// freeing the tracehandle  

and how to limit for certain mount of enemy ?
thanks.
So you don't need that.

Best way is hooking FireBullets3 with Rage, and change penetration parameter with the number of penetrations that you want for the weapon.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS 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 10:14.


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