AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Only Terrorist To Be Visible (https://forums.alliedmods.net/showthread.php?t=147668)

ASUS_BG 01-12-2011 09:05

Only Terrorist To Be Visible
 
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;



fireattack 01-12-2011 13:23

Re: Only Terrorist To Be Visible
 
PHP Code:

 
if( cs_get_user_teamid ) == CS_TEAM_T 


ASUS_BG 01-12-2011 15:30

Re: Only Terrorist To Be Visible
 
pls make it. I don't know how :(

fireattack 01-14-2011 10:01

Re: Only Terrorist To Be Visible
 
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;



Flipper_SPb 01-14-2011 10:14

Re: Only Terrorist To Be Visible
 
Quote:

Originally Posted by fireattack (Post 1393371)
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 

?

fireattack 01-14-2011 10:34

Re: Only Terrorist To Be Visible
 
Yep, I forget a "="

ASUS_BG 01-15-2011 05:14

Re: Only Terrorist To Be Visible
 
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).

Elusive138 01-15-2011 05:53

Re: Only Terrorist To Be Visible
 
Add
PHP Code:

#include <cstrike> 

to the top.

ASUS_BG 01-16-2011 07:00

Re: Only Terrorist To Be Visible
 
sorry it's me again :) Look this

Error: Expected token: ";", but found "static" on line 84
Warning: Loose indentation on line 84

drekes 01-16-2011 07:40

Re: Only Terrorist To Be Visible
 
If line 84 is "static menu[2048];", add a semicolon after PLUGIN_HANDLED above it.
or remove "#pragma semicolon 1"


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

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