Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with 3rd plg(or drm?) #12

Open
raiz0x opened this issue Mar 25, 2020 · 1 comment
Open

Compatibility with 3rd plg(or drm?) #12

raiz0x opened this issue Mar 25, 2020 · 1 comment

Comments

@raiz0x
Copy link

raiz0x commented Mar 25, 2020

for drm(or not?) integration with this plugin isn't work!(for all types of amxx/metamod/engine)

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

#define DENUMIRE ""

//i couldn't find them again..SRRY
#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""//some edits..

#define MAX_ENTITYS 900+15*32
new bool:g_bPlayerInvisible[33],bool:g_bWaterInvisible[33],bool:g_bWaterEntity[MAX_ENTITYS],bool:g_bWaterFound,g_iSpectatedId[33];
new mf[125]

public plugin_init() {
    register_clcmd( "say /invis", "menuInvisDisplay" );
    register_clcmd( "say_team /invis", "menuInvisDisplay" );
    formatex(mf,charsmax(mf),"\r[\y%s\r] \w- Invizibilitate \y[\rFPS\y]^n^n",DENUMIRE)
    register_menucmd( register_menuid( mf ), 1023, "menuInvisAction" );
    register_forward( FM_AddToFullPack, "fwdAddToFullPack_Post", 1 );
    register_event( "SpecHealth2", "eventSpecHealth2", "bd" );
    RegisterHam(Ham_Spawn, "player", "fwdPlayerSpawnPost", 1);
}
public plugin_cfg( )
{//ss
    new ent = -1;
    while( ( ent = find_ent_by_class( ent, "func_water" ) ) != 0 )
    {
//       pev( ent, pev_skin ) ==  CONTENTS_WATER is also true on func_water entities
        
        if( !g_bWaterFound )	g_bWaterFound = true;

        g_bWaterEntity[ent] = true;
    }

    ent = -1;
    while( ( ent = find_ent_by_class( ent, "func_illusionary" ) ) != 0 )
    {
        if( pev( ent, pev_skin ) ==  CONTENTS_WATER )
        {
            if( !g_bWaterFound )	g_bWaterFound = true;
    
            g_bWaterEntity[ent] = true;
        }
    }
    
    ent = -1;
    while( ( ent = find_ent_by_class( ent, "func_conveyor" ) ) != 0 )
    {
        if( pev( ent, pev_spawnflags ) == 3 )
        {
            if( !g_bWaterFound )	g_bWaterFound = true;
    
            g_bWaterEntity[ent] = true;
        }
    }
}

public client_putinserver ( id )
{
	if(!is_user_connected(id)||is_user_bot(id)||is_user_hltv(id))	return

	set_task ( 7.5 , "menuInvisDisplay" , id );

	g_bPlayerInvisible [ id ] = false;
	g_bWaterInvisible [ id ] = false;
	g_iSpectatedId [ id ] = 0;
}

public fwdPlayerSpawnPost(iClient)	g_iSpectatedId[iClient] = 0;

public fwdAddToFullPack_Post( es_handle, e, ent, host, hostflags, player, pset )
{
    if( player && g_bPlayerInvisible[host] && host != ent && ent != g_iSpectatedId[host] && get_user_team(host) == get_user_team(ent) )
    {
        static const Float:corner[8][3] = 
        {
            { -4096.0, -4096.0, -4096.0 },
            { -4096.0, -4096.0, 4096.0 },
            { -4096.0, 4096.0, -4096.0 },
            { -4096.0, 4096.0, 4096.0 },
            { 4096.0, -4096.0, -4096.0 },
            { 4096.0, -4096.0, 4096.0 },
            { 4096.0, 4096.0, -4096.0 },
            { 4096.0, 4096.0, 4096.0 }
        };

        static const Float:map_distance = 7094.480108;
        
        static Float:origin[3];
        get_es( es_handle, ES_Origin, origin );
        
        static i;
        while( get_distance_f( origin, corner[i] ) > map_distance )	if( ++i >= sizeof( corner ) )	 i = 0;
        
        set_es( es_handle, ES_Origin, corner[i] );
        set_es( es_handle, ES_Effects, get_es( es_handle, ES_Effects ) | EF_NODRAW );
    }
    else if( g_bWaterInvisible[host] && g_bWaterEntity[ent])	 set_es( es_handle, ES_Effects, get_es( es_handle, ES_Effects ) | EF_NODRAW );
}
public eventSpecHealth2( id )	g_iSpectatedId[id] = read_data( 2 );
public menuInvisDisplay( id )
{
    static menu[256];
    new len = formatex( menu, charsmax(menu), "\r[\y%s\r] \w- Invizibilitate \y[\rFPS\y]^n^n",DENUMIRE );
    
    len += formatex( menu[len], charsmax(menu) - len, "\r1. \yCoechipieri: \w%s^n", g_bPlayerInvisible[id] ? "invizibili" : "vizibili" );
    
    if( g_bWaterFound )	len += formatex( menu[len], charsmax(menu) - len, "\r2. \yApa: \w%s^n", g_bWaterInvisible[id] ? "invizibila" : "vizibila" );
    else	len += formatex( menu[len], charsmax(menu) - len, "\r2. \yApa: \rNu exista pe aceasta mapa \w!^n" );

    len += formatex( menu[len], charsmax(menu) - len, "^n\r0. \yIesire" );
    
    show_menu( id, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );
        
    return PLUGIN_HANDLED;
}
public menuInvisAction( id, key )
{
    switch( key )
    {
        case 0:
        {
            g_bPlayerInvisible[id] = !g_bPlayerInvisible[id];
            menuInvisDisplay( id );
        }
        case 1:
        {
            if( g_bWaterFound )	g_bWaterInvisible[id] = !g_bWaterInvisible[id];
            
            menuInvisDisplay( id );
        }
        case 9: show_menu( id, 0, "" );
    }
}
@Vakos321575
Copy link

I confirm. I also have a problem with this.
It would be good to fix this bug.

@raiz0x raiz0x changed the title Compatibility with 3d plg(or drm?) Compatibility with 3rd plg(or drm?) May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants