| Exolent[jNr] |
07-25-2011 10:18 |
Re: I want (Can not see the teammates's plugins)
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#pragma semicolon 1
// set your true/false default values here
new bool:g_bPlayerInvisible = true;
new bool:g_bWaterInvisible = true;
new bool:g_bWaterEntity[1386], bool:g_bWaterFound;
new g_iSpectatedId[33];
public plugin_init( )
{
register_plugin( "Invis", "1.4", "SchlumPF");
register_forward( FM_PlayerPreThink, "fwdPlayerPreThink_Pre", 0 );
register_forward( FM_AddToFullPack, "fwdAddToFullPack_Post", 1 );
RegisterHam( Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
}
public plugin_cfg( )
{
// find all water entitys to make AddToFullPack use less cpu
new ent = engfunc( EngFunc_FindEntityByString, -1, "classname", "func_water" );
while( ent )
{
if( !g_bWaterFound )
{
g_bWaterFound = true;
}
g_bWaterEntity[ent] = true;
ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_water" );
}
}
public fwdPlayerPreThink_Pre( plr )
{
if( !is_user_alive( plr ) )
{
g_iSpectatedId[plr] = pev( plr, pev_iuser2 );
}
}
public fwdAddToFullPack_Post( es_handle, e, ent, host, hostflags, player, pset )
{
if( player )
{
if( g_bPlayerInvisible && host != ent )
{
if( ent != g_iSpectatedId[host] && cs_get_user_team( host ) == cs_get_user_team( ent ) )
{
set_es( es_handle, ES_Origin, { 999999999.0, 999999999.0, 999999999.0 } );
set_es( es_handle, ES_RenderMode, kRenderTransAlpha );
set_es( es_handle, ES_RenderAmt, 0 );
}
}
}
else if( g_bWaterInvisible )
{
if( g_bWaterEntity[ent] )
{
set_es( es_handle, ES_Effects, EF_NODRAW );
}
}
}
public hamSpawnPlayer_Post( plr )
{
g_iSpectatedId[plr] = 0;
}
public client_connect( plr )
{
g_iSpectatedId[plr] = 0;
}
|