Raised This Month: $51 Target: $400
 12% 

TraceAttack & TakeDamage weapons overpass teammates


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 06-20-2017 , 11:47   TraceAttack & TakeDamage weapons overpass teammates
Reply With Quote #1

Making tests, I see some weapons can't take damage to the enemy if you have a teammate between him and you.

But others yees. Why is happening this? Any way to change (or fix) this?

List of weapons can overpass teammate:
  • deagle
  • galil, famas
  • ak47, m4a1
  • sg552, aug
  • g3sg1, sg550
  • awp
  • scout? (not tested)

Weapons not in the list can't overpass teammate. The bullet disappear on him

Last edited by baneado; 06-20-2017 at 11:49.
baneado is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-20-2017 , 11:59   Re: TraceAttack & TakeDamage weapons overpass teammates
Reply With Quote #2

I guess these weapons that can pass are also breaks through the walls... These wpns has ahigh traceattacks
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-08-2019 at 10:28.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 06-20-2017 , 13:23   Re: TraceAttack & TakeDamage weapons overpass teammates
Reply With Quote #3

Yes, it's true.

But I'm asking to solve the problem. It's really a headache on a server with semiclip.
baneado is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 06-20-2017 , 13:43   Re: TraceAttack & TakeDamage weapons overpass teammates
Reply With Quote #4

Make your teammates non-solid before the attack and restore solid after the attack.
__________________

Last edited by PRoSToTeM@; 06-20-2017 at 13:43.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
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
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 06-21-2017 , 12:27   Re: TraceAttack & TakeDamage weapons overpass teammates
Reply With Quote #6

Set a 0.1 second delay on TraceAttack post and test.
__________________
edon1337 is offline
Old 06-21-2017, 12:50
Natsheh
This message has been deleted by Natsheh.
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 06-21-2017 , 13:14   Re: TraceAttack & TakeDamage weapons overpass teammates
Reply With Quote #7

Quote:
Originally Posted by edon1337 View Post
Set a 0.1 second delay on TraceAttack post and test.
How? set_task isn't a good idea. An entity thinking would be worse here
Quote:
Originally Posted by Natsheh View Post
Here try this..
PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <engine>
#include <hamsandwich> 

new user_oldsolid[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() 
{
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack_Pre"
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack_Post"1


public 
fw_TraceAttack_Pre(victimattackerFloat:DamageFloat:fDir[3], ptriDamageType

    if (!
attacker// not player 
        
return HAM_IGNORED
         
    if (
cs_get_user_team(attacker) != cs_get_user_team(victim)) 
    { 
        return 
HAM_IGNORED
    } 
         
    if (!((
1<<get_user_weapon(attacker)) & WEAPONS_TO_FIX)) 
    { 
        return 
HAM_IGNORED
    } 
     
user_oldsolid[victim] = entity_get_int(victimEV_INT_solid);
    
entity_set_int(victimEV_INT_solidSOLID_NOT )
    return 
HAM_IGNORED


public 
fw_TraceAttack_Post(victimattackerFloat:DamageFloat:fDir[3], ptriDamageType

    if (!
attacker// not player 
        
return HAM_IGNORED
        
    if (
cs_get_user_team(attacker) != cs_get_user_team(victim)) 
    { 
        return 
HAM_IGNORED
    } 
   if (!((
1<<get_user_weapon(attacker)) & WEAPONS_TO_FIX)) 
    { 
        return 
HAM_IGNORED
    } 
    
entity_set_int(victimEV_INT_solid,  user_oldsolid[victim] )
    return 
HAM_IGNORED

It's the same...
baneado is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 06-21-2017 , 13:48   Re: TraceAttack & TakeDamage weapons overpass teammates
Reply With Quote #8

Quote:
Originally Posted by baneado View Post
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.
Just use Ham_Weapon_PrimaryAttack with Pre and Post hooks.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 06-22-2017 , 10:56   Re: TraceAttack & TakeDamage weapons overpass teammates
Reply With Quote #9

Quote:
Originally Posted by PRoSToTeM@ View Post
Just use Ham_Weapon_PrimaryAttack with Pre and Post hooks.
That's the final solution. Working great

I'm using get_user_aiming on Pre, any other way?

Last edited by baneado; 06-22-2017 at 10:58.
baneado is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 06-22-2017 , 13:09   Re: TraceAttack & TakeDamage weapons overpass teammates
Reply With Quote #10

Quote:
Originally Posted by baneado View Post
I'm using get_user_aiming on Pre, any other way?
get_user_aiming can hit only 1 teammate, the other way is to make all your teammates non-solid (via get_players and for loop).
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
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 01:05.


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