That one Devil259 posted is actually working good, does someone know how to make it a Team Semiclip? Cuz I tried putting in each public a check if cs_get_user_team of the 2 player is equal then do the semiclip, but things mess up and they still can get into each other, I want them to block each other and not just be able to hit:
PHP Code:
#include < amxmodx >
#include < engine >
#include < fakemeta >
#include < hamsandwich >
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
new const g_szAliveFlags[ ] = "a";
new g_iPlayers[ 32 ], g_iNum, g_iPlayer, g_iMaxPlayers, i;
public plugin_init( )
{
register_plugin( "Semiclip", "1.0", "ConnorMcLeod / xPaw" );
register_forward( FM_ShouldCollide, "FwdShouldCollide" );
register_forward( FM_AddToFullPack, "FwdAddToFullPack", true );
RegisterHam( Ham_Player_PreThink, "player", "FwdHamPlayerPreThink", true );
RegisterHam( Ham_Killed, "player", "FwdHamPlayerKilled", true );
g_iMaxPlayers = get_maxplayers( );
}
public FwdAddToFullPack( es, e, iEnt, id, hostflags, player, pSet )
{
if( player && id != iEnt && get_orig_retval( ) )
{
set_es( es, ES_Solid, SOLID_NOT );
static Float:flDistance;
flDistance = entity_range( id, iEnt );
if( flDistance < 512.0 )
{
set_es( es, ES_RenderMode, kRenderTransAlpha )
set_es( es, ES_RenderAmt, floatround( flDistance ) / 2 );
}
}
}
public FwdShouldCollide( const iTouched, const iOther )
{
if( IsPlayer( iTouched ) && IsPlayer( iOther ) )
{
forward_return( FMV_CELL, 0 );
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public FwdHamPlayerKilled( )
{
get_players( g_iPlayers, g_iNum, g_szAliveFlags );
for( i = 0; i < g_iNum; i++ )
{
entity_set_int( g_iPlayers[ i ], EV_INT_solid, SOLID_SLIDEBOX );
}
}
public FwdHamPlayerPreThink( const id )
Semiclip( id, SOLID_NOT );
public client_PostThink( id )
Semiclip( id, SOLID_SLIDEBOX );
Semiclip( const id, const iSolid )
{
if( !is_user_alive( id ) )
return;
get_players( g_iPlayers, g_iNum, g_szAliveFlags );
for( i = 0; i < g_iNum; i++ )
{
g_iPlayer = g_iPlayers[ i ];
if( id != g_iPlayer )
entity_set_int( g_iPlayer, EV_INT_solid, iSolid );
}
}
__________________