Raised This Month: $ Target: $400
 0% 

Only Terrorist To Be Visible


Post New Thread Reply   
 
Thread Tools Display Modes
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
fireattack
Senior Member
Join Date: Jul 2008
Old 01-12-2011 , 13:23   Re: Only Terrorist To Be Visible
Reply With Quote #2

PHP Code:
 
if( cs_get_user_teamid ) == CS_TEAM_T 
fireattack is offline
ASUS_BG
Junior Member
Join Date: Jun 2010
Old 01-12-2011 , 15:30   Re: Only Terrorist To Be Visible
Reply With Quote #3

pls make it. I don't know how
ASUS_BG is offline
fireattack
Senior Member
Join Date: Jul 2008
Old 01-14-2011 , 10:01   Re: Only Terrorist To Be Visible
Reply With Quote #4

Please learn, It's easy. If you learn you'll can make that for all plugins you want, If I do that for you, you'll probably ask here for the same.

A example ;)

PHP Code:
 
public menuInvisDisplayplr )
{
     if( 
cs_get_user_teamplr ) = CS_TEAM_CT 
          return 
PLUGIN_HANDLED
 
     
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;

fireattack is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 01-14-2011 , 10:14   Re: Only Terrorist To Be Visible
Reply With Quote #5

Quote:
Originally Posted by fireattack View Post
PHP Code:
 
public menuInvisDisplayplr )
{
     if( 
cs_get_user_teamplr ) = CS_TEAM_CT 
          return 
PLUGIN_HANDLED 

You meaning

PHP Code:
if( cs_get_user_teamplr )  ==  CS_TEAM_CT 
?
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
fireattack
Senior Member
Join Date: Jul 2008
Old 01-14-2011 , 10:34   Re: Only Terrorist To Be Visible
Reply With Quote #6

Yep, I forget a "="
fireattack is offline
ASUS_BG
Junior Member
Join Date: Jun 2010
Old 01-15-2011 , 05:14   Re: Only Terrorist To Be Visible
Reply With Quote #7

it's not working

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "cs_get_user_team" on line 80
Error: Undefined symbol "CS_TEAM_CT" on line 80
Error: Number of arguments does not match definition on line 80
Error: Too many error messages on one line on line 80

Compilation aborted.
4 Errors.
Could not locate output file C:\Documents and Settings\ASUS\Desktop\Untitled.amx (compile failed).

Last edited by ASUS_BG; 01-15-2011 at 05:23.
ASUS_BG is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 01-15-2011 , 05:53   Re: Only Terrorist To Be Visible
Reply With Quote #8

Add
PHP Code:
#include <cstrike> 
to the top.
Elusive138 is offline
ASUS_BG
Junior Member
Join Date: Jun 2010
Old 01-16-2011 , 07:00   Re: Only Terrorist To Be Visible
Reply With Quote #9

sorry it's me again Look this

Error: Expected token: ";", but found "static" on line 84
Warning: Loose indentation on line 84
ASUS_BG is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 01-16-2011 , 07:40   Re: Only Terrorist To Be Visible
Reply With Quote #10

If line 84 is "static menu[2048];", add a semicolon after PLUGIN_HANDLED above it.
or remove "#pragma semicolon 1"
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 02:08.


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