Hy, i try to make a AntiWallbang plugin.
So far it works but it should be possible to shot thrue wooden textures.
EngFunc_TraceTexture gives me only "NoTexture".
what do i wrong?
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new const Version[] = "1.0";
#define MAX_PLAYERS 32
#define IsPlayer(%1) ( 1 <= %1 <= MAX_PLAYERS )
public plugin_init()
{
register_plugin( "Anti_Wallbang" , Version , "AimniX" );
RegisterHam( Ham_TraceAttack , "player" , "Player_TraceAttack" );
}
public Player_TraceAttack( iEnt , iAttacker , Float:flDamage , Float:fDir[ 3 ] , ptr , iDamageType )
{
if( IsPlayer( iAttacker ) )
{
if ( iDamageType & DMG_BULLET )
{
new Float:fEnd[ 3 ];
get_tr2( ptr , TR_vecEndPos , fEnd);
if(bool:!ExecuteHam( Ham_FVecVisible , iAttacker , fEnd )!= false)
{
new startOrigin[3]
get_user_origin(iAttacker, startOrigin , 1);
new endOrigin[3]
get_user_origin(iAttacker, endOrigin , 4);
new texture_name[64],texture_type
engfunc(EngFunc_TraceTexture, 0, startOrigin , endOrigin, texture_name, charsmax(texture_name))
texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)
client_print( 0, print_chat, "This is the Texture: %s",texture_type)
return HAM_SUPERCEDE
}
}
else
{
return HAM_IGNORED
}
}
return HAM_IGNORED
}