|
Member
|
07-18-2020
, 15:04
Re: No shoot through wall
|
#3
|
Quote:
Originally Posted by MagNNusS
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(ent, attacker, float:damage, Float:direction[3], trace, bits)
{
if(!is_user_alive(attacker) || ~bits & DMG_BULLET)
return HAM_IGNORED
if(pev(ent, pev_rendermode) != kRenderNormal)
{
set_tr(TR_vecEndPos, Float:{ 4096.0, 4096.0, 4096.0 })
set_tr(TR_pHit, 0)
set_tr(TR_iHitgroup, 0)
set_tr(TR_flFraction, 1.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.
|
|
|
|