Raised This Month: $ Target: $400
 0% 

TraceAttack & TakeDamage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-15-2012 , 13:32   TraceAttack & TakeDamage
Reply With Quote #1

PHP Code:
    RegisterHam(Ham_TraceAttack"player""player_attack")
    
RegisterHam(Ham_TakeDamage"player""hook_TakeDamage"
What's the difference between these two?

I understand that "Ham_TraceAttack" activates when some player attack other player and "Ham_TakeDamage" is when the damage is deal.

Lets say i want to prevent ct's from any damage if "catch" variable is true so what's the difference between these codes?

PHP Code:
public player_attack(victimattackerFloat:damageFloat:direction[3], tracehandledamagebits)
{
    static 
vteam,ateam
    
if(!is_user_connected(victim) || !is_user_connected(attacker) || victim == attacker)
        return 
HAM_IGNORED
   
    vteam 
get_user_team(victim)
    
ateam get_user_team(attacker)

    if(catch)
    {  
        if(
ateam == && vteam == 2)
            return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED
}


public 
hook_TakeDamage(victimattackeruselessFloat:damagedamagebits) {
 
    static 
vteam,ateam
    
if(!is_user_connected(victim) || !is_user_connected(attacker) || victim == attacker)
        return 
HAM_IGNORED
   
    vteam 
get_user_team(victim)
    
ateam get_user_team(attacker)

    if(catch)
    {  
        if(
ateam == && vteam == 2)
            return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED

GhostMan is offline
 



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 15:17.


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