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

No shoot through wall


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ykaru
Member
Join Date: Aug 2019
Old 07-17-2020 , 18:39   No shoot through wall
Reply With Quote #1

Hi, I need a plugin that won't let you shoot through the glass.
I searched a lot but I cant find one.
Thank you
Ykaru is offline
MagNNusS
Member
Join Date: May 2018
Location: World of Bushi
Old 07-18-2020 , 14:10   Re: No shoot through wall
Reply With Quote #2

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_user_hitzones(attacker00)
        return 
HAM_SUPERCEDE
    
}

    return 
HAM_HANDLED

Or you can use this one, but it supports walls, glass etc.
__________________
Just an impractical signature
nothing to see here.

Last edited by MagNNusS; 07-19-2020 at 07:04. Reason: Plug-in update
MagNNusS is offline
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
MagNNusS
Member
Join Date: May 2018
Location: World of Bushi
Old 07-19-2020 , 06:17   Re: No shoot through wall
Reply With Quote #4

Check the code, now I've realized my mistake.
__________________
Just an impractical signature
nothing to see here.

Last edited by MagNNusS; 07-19-2020 at 07:04. Reason: Being a bozo
MagNNusS is offline
Reply


Thread Tools
Display Modes

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 11:38.


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