Raised This Month: $ Target: $400
 0% 

Only Terrorist To Be Visible


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ASUS_BG
Junior Member
Join Date: Jun 2010
Old 01-12-2011 , 09:05   Only Terrorist To Be Visible
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#pragma semicolon 1

new bool:g_bPlayerInvisible[33], bool:g_bWaterInvisible[33];
new 
bool:g_bWaterEntity[1386], bool:g_bWaterFound;

new 
g_iSpectatedId[33];

public 
plugin_init( )
{
    
register_plugin"Invis""1.4""SchlumPF");
    
    
register_clcmd"say /invis""menuInvisDisplay" );
    
register_menucmdregister_menuid"\rMax FPS^n^n" ), 1023"menuInvisAction" );
    
    
register_forwardFM_PlayerPreThink"fwdPlayerPreThink_Pre");
    
register_forwardFM_AddToFullPack"fwdAddToFullPack_Post");
    
    
RegisterHamHam_Spawn"player""hamSpawnPlayer_Post");
}

public 
plugin_cfg( )
{
    
// find all water entitys to make AddToFullPack use less cpu
    
new ent engfuncEngFunc_FindEntityByString, -1"classname""func_water" );
    while( 
ent )
    {
        if( !
g_bWaterFound )
        {
            
g_bWaterFound true;
        }

        
g_bWaterEntity[ent] = true;
        
        
ent engfuncEngFunc_FindEntityByStringent"classname""func_water" );
    }
}

public 
fwdPlayerPreThink_Preplr )
{
    if( !
is_user_aliveplr ) )
    {
        
g_iSpectatedId[plr] = pevplrpev_iuser2 );
    }
}

public 
fwdAddToFullPack_Postes_handleeenthosthostflagsplayerpset )
{
    if( 
player )
    {
        if( 
g_bPlayerInvisible[host] && host != ent )
        {
            if( 
ent != g_iSpectatedId[host] )
            {
                
set_eses_handleES_Origin, { 999999999.0999999999.0999999999.0 } );
                
set_eses_handleES_RenderModekRenderTransAlpha );
                
set_eses_handleES_RenderAmt);
            }
        }
    }
    else if( 
g_bWaterInvisible[host] )
    {
        if( 
g_bWaterEntity[ent] )
        {
            
set_eses_handleES_EffectsEF_NODRAW );
        }
    }
}

public 
hamSpawnPlayer_Postplr )
{
    
g_iSpectatedId[plr] = 0;
}

public 
menuInvisDisplayplr )
{
    static 
menu[2048];

    new 
len formatmenusizeof menu 1"\rMax FPS^n^n" );
    
    
len += formatmenu[len], sizeof menu len"\r1. Players: %s^n"g_bPlayerInvisible[plr] ? "invisible" "visible" );
    
len += formatmenu[len], sizeof menu len"\r2. Water: %s^n^n"g_bWaterFound ? ( g_bWaterInvisible[plr] ? "invisible" "visible" ) : "there is no water" );
 
    
len += formatmenu[len], sizeof menu len"\r0. \wExit" );
    
    
show_menuplr, ( 1<<1<<1<<), menu, -);
        
    return 
PLUGIN_HANDLED;
}

public 
menuInvisActionplrkey )
{
    switch( 
key )
    {
        case 
0:
        {
            
g_bPlayerInvisible[plr] = !g_bPlayerInvisible[plr];
            
menuInvisDisplayplr );
        }
        case 
1:
        {
            
g_bWaterInvisible[plr] = !g_bWaterInvisible[plr];
            
menuInvisDisplayplr );
        }
        case 
9show_menuplr0"" );
    }
}

public 
client_connectplr )
{
    
g_bPlayerInvisible[plr] = false;
    
g_bWaterInvisible[plr] = false;
    
g_iSpectatedId[plr] = 0;


Last edited by ASUS_BG; 01-12-2011 at 18:29.
ASUS_BG is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode