View Single Post
Ykaru
Member
Join Date: Aug 2019
Old 07-18-2020 , 15:04   Re: No shoot through wall
Reply With Quote #3

Quote:
Originally Posted by MagNNusS View Post
PHP Code:
/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
// #include <amxmisc>
// #include <cstrike>
// #include <engine>
#include <fakemeta>
#include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <dhudmessage>

new const PluginAuthority[][] =
{
    
"No damage through glasses",
    
"0.0.1",
    
"SayWhat?!"
}

public 
plugin_init()
{
    
register_plugin(PluginAuthority[0], PluginAuthority[1], PluginAuthority[2])
    
RegisterHam(Ham_TraceAttack"func_wall""Ham_PlayerTraceAttackPre"false)
}

public 
Ham_PlayerTraceAttackPre(entattackerfloat:damageFloat:direction[3], tracebits)
{
    if(!
is_user_alive(attacker) || ~bits DMG_BULLET)
        return 
HAM_IGNORED

    
if(pev(entpev_rendermode) != kRenderNormal)
    {
        
set_tr(TR_vecEndPosFloat:{ 4096.04096.04096.0 })
        
set_tr(TR_pHit0)
        
set_tr(TR_iHitgroup0)
        
set_tr(TR_flFraction1.0)
        return 
HAM_SUPERCEDE
    
}

    return 
HAM_HANDLED

Or you can use this one, but it supports walls, glass etc.
The one you gave me causes the server to crash when I shoot a bullet.
And the one on the link doesn't work.
Ykaru is offline