Raised This Month: $ Target: $400
 0% 

TraceAttack & TakeDamage weapons overpass teammates


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 06-21-2017 , 11:41   Re: TraceAttack & TakeDamage weapons overpass teammates
Reply With Quote #5

Quote:
Originally Posted by PRoSToTeM@ View Post
Make your teammates non-solid before the attack and restore solid after the attack.
Ok, working

But where to restore solid? I tried TraceAttack_Post, FM_PlayerPostThink, but seems to be soon to restore solid and bullet doesn't overpass teammate.

My test plugin:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

new bool:HasSemiclip[33]

const 
WEAPONS_TO_FIX = (1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_MP5NAVY)|(1<<CSW_M3)|(1<<CSW_TMP)|(1<<CSW_P90)

public 
plugin_init()
{
    
register_forwardFM_PlayerPostThink"fwdPlayerPostThink" )
    
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack_Pre")
    
//RegisterHam(Ham_TraceAttack, "player", "fw_TraceAttack_Post", 1)
}

public 
fwdPlayerPostThinkid )
{
    if( 
HasSemiclip[id] )
    {
        
entity_set_intidEV_INT_solidSOLID_SLIDEBOX )
        
HasSemiclip[id] = false
        client_print
(0print_chat"Debug solid final")
    }
}

public 
fw_TraceAttack_Pre(victimattackerFloat:DamageFloat:fDir[3], ptriDamageType)
{
    if (!
is_user_connected(attacker)) // not player
        
return HAM_IGNORED;
        
    if (
cs_get_user_team(attacker) != cs_get_user_team(victim))
    {
        
client_print(0print_chat"Debug team")
        return 
HAM_IGNORED;
    }
        
    if (!((
1<<get_user_weapon(attacker)) & WEAPONS_TO_FIX))
    {
        
client_print(0print_chat"Debug weapon")
        return 
HAM_IGNORED;
    }
    
    
client_print(0print_chat"Debug solid")
    
entity_set_int(victimEV_INT_solidSOLID_NOT)
    
HasSemiclip[victim] = true
    
return HAM_HANDLED;
}

public 
fw_TraceAttack_Post(victimattackerFloat:DamageFloat:fDir[3], ptriDamageType)
{
    if (!
is_user_connected(attacker)) // not player
        
return HAM_IGNORED;
        
    
entity_set_int(victimEV_INT_solidSOLID_SLIDEBOX)
    return 
HAM_HANDLED;


Last edited by baneado; 06-21-2017 at 13:06.
baneado 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 22:59.


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