Raised This Month: $51 Target: $400
 12% 

Plugin /invis to hide only teammates


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BR@IN
Member
Join Date: Nov 2010
Old 11-02-2010 , 16:40   Plugin /invis to hide only teammates
Reply With Quote #1

I need the plugin /invis to hide only teammates
Example:When ct`s say /invis hides only ct`s and they can see the t`s
The same goes for the t`s hope you understood me
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"\rInvisibility - SchlumPF^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"\rInvisibility - SchlumPF^n^n" );
    
    
len += formatmenu[len], sizeof menu len"\r01. Players: %s^n"g_bPlayerInvisible[plr] ? "invisible" "visible" );
    
len += formatmenu[len], sizeof menu len"\r02. Water: %s^n^n"g_bWaterFound ? ( g_bWaterInvisible[plr] ? "invisible" "visible" ) : "there is no water" );
 
    
len += formatmenu[len], sizeof menu len"\r00. \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;

BR@IN is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-02-2010 , 16:43   Re: Plugin /invis to hide only teammates
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
#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"\rInvisibility - SchlumPF^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] && cs_get_user_teamhost ) == cs_get_user_teament ) )
            {
                
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"\rInvisibility - SchlumPF^n^n" );
    
    
len += formatmenu[len], sizeof menu len"\r01. Players: %s^n"g_bPlayerInvisible[plr] ? "invisible" "visible" );
    
len += formatmenu[len], sizeof menu len"\r02. Water: %s^n^n"g_bWaterFound ? ( g_bWaterInvisible[plr] ? "invisible" "visible" ) : "there is no water" );
 
    
len += formatmenu[len], sizeof menu len"\r00. \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;

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 11-02-2010 at 17:07.
Exolent[jNr] is offline
BR@IN
Member
Join Date: Nov 2010
Old 11-02-2010 , 16:56   Re: Plugin /invis to hide only teammates
Reply With Quote #3

can`t compile
error 017: undefined symbol "cs_get_user_team"
;(
BR@IN is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-02-2010 , 17:07   Re: Plugin /invis to hide only teammates
Reply With Quote #4

Sorry. Should compile now.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
BR@IN
Member
Join Date: Nov 2010
Old 11-02-2010 , 17:14   Re: Plugin /invis to hide only teammates
Reply With Quote #5

It compiled
I will test it now and edit my post for results
edit:Everything works thanks
Exolent[jNr] for president xD

Last edited by BR@IN; 11-02-2010 at 17:21.
BR@IN is offline
Mr.sceR
Member
Join Date: Jan 2011
Location: Bulgaria
Old 01-09-2011 , 16:42   Re: Plugin /invis to hide only teammates
Reply With Quote #6

can you do instead to become visible in a dark font and if it can be. SMA
Mr.sceR is offline
Send a message via Skype™ to Mr.sceR
deathwizard5
Member
Join Date: May 2010
Old 12-03-2011 , 08:09   Re: Plugin /invis to hide only teammates
Reply With Quote #7

can you make it to write every 2 rounds a message on chat like "If you have lag/fps problems type /invis and disable water and players"

EDIT:Forget it i made it alone

PHP Code:
#include <amxmodx>
#include <cstrike>
#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"\rInvisibility by SchlumPF^n^n" ), 1023"menuInvisAction" );
    
    
register_forwardFM_PlayerPreThink"fwdPlayerPreThink_Pre");
    
register_forwardFM_AddToFullPack"fwdAddToFullPack_Post");
    
    
RegisterHamHam_Spawn"player""hamSpawnPlayer_Post");
    
set_task(150.0"Information",0,"",0,"b");
}

public 
Information() {
    
client_print(0,print_chat"[ Deathrun ] If you have Lag/FPS Problems write /invis in chat and remove Players and Water.");
}
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] && cs_get_user_teamhost ) == cs_get_user_teament ) )
            {
                
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"\rInvisibility by SchlumPF^n^n" );
    
    
len += formatmenu[len], sizeof menu len"\r01. Players: %s^n"g_bPlayerInvisible[plr] ? "Invisible" "Visible" );
    
len += formatmenu[len], sizeof menu len"\r02. Water: %s^n^n"g_bWaterFound ? ( g_bWaterInvisible[plr] ? "Invisible" "Visible" ) : "There is no water in map" );
 
    
len += formatmenu[len], sizeof menu len"\r00. \rExit" );
    
    
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;

for newbies you can change the time that the message appears on set_task from 150sec to whatever you like,dont ask me on how to put colors,i dont know how to do it(i am not a plugin maker )
__________________


Last edited by deathwizard5; 12-05-2011 at 13:58.
deathwizard5 is offline
deathwizard5
Member
Join Date: May 2010
Old 12-11-2011 , 13:39   Re: Plugin /invis to hide only teammates
Reply With Quote #8

sorry for doubleposting but i had this idea to make this plugin much better.!
can someone make it so that it detects weather effects like snow,rain etc and adding it the menu,i know you will tell me use cl_weather 0 but do you know how many people don't know this?
__________________

deathwizard5 is offline
AvaStIn
Senior Member
Join Date: Feb 2013
Location: Algeria
Old 04-27-2013 , 06:11   Re: Plugin /invis to hide only teammates
Reply With Quote #9

awesome plugin ,just wondering I saw it in speedrun server
and when the player connects ,the menu show automatic don't need to say /invis
(can still use the command /invis)
AvaStIn is offline
AvaStIn
Senior Member
Join Date: Feb 2013
Location: Algeria
Old 06-27-2013 , 15:30   Re: Plugin /invis to hide only teammates
Reply With Quote #10

well can someone add another feature??? like removing sky (dark sky on/off)
__________________
Project : Speedrun / Fastrun / CrazySpeed & [FPS CATEGORY]

o [
||||||||||||||||||||] - 95%

Project : Upgraded Drshop To V6.0

o [||||||||||||||||||||]- 100%
AvaStIn is offline
Reply



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 11:55.


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