this is the best and most efficient way to semiclip:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "Hobo Semi Clip Lite"
#define AUTHOR "hoboman313"
#define VERSION "1.0"
#define MAX_PLAYERS 32
#define SEMI_CLIP_DISTANCE 100.0
new sclippedPlayer[MAX_PLAYERS+1], maxplayers
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
maxplayers = get_maxplayers()
register_forward( FM_ShouldCollide, "make_unsolid" )
register_forward( FM_PlayerPreThink, "make_solid" )
}
public make_unsolid( entTouched, entOther )
{
if( is_user_alive(entOther) && is_user_alive(entTouched) && close_enough(entTouched, entOther ) )
{
if( !sclippedPlayer[entOther] )
{
set_pev( entOther, pev_solid, SOLID_NOT )
sclippedPlayer[entOther]=true
}
if( !sclippedPlayer[entTouched] )
{
set_pev( entTouched, pev_solid, SOLID_NOT )
sclippedPlayer[entTouched]=true
}
}
}
public make_solid( id )
{
if( sclippedPlayer[id] && is_user_alive(id) )
{
for( new i=1; i<=maxplayers; i++ )
{
if( is_user_alive(i) && i!=id && close_enough(i, id) )
{
return
}
}
sclippedPlayer[id]=false
set_pev( id, pev_solid, SOLID_BBOX )
}
}
public bool:close_enough(ent1, ent2)
{
new Float:origin[3], Float:origin2[3]
pev(ent1, pev_origin, origin )
pev(ent2, pev_origin, origin2 )
if( get_distance_f( origin, origin2 ) <= SEMI_CLIP_DISTANCE )
return true
return false
}
I was gonna release it as a new plugin, but now I have given up ( and quite honestly I am sick of this plugin, lol ) because if two players are sitting inside each other they are SOLID_NOT and cannot be shot
__________________