Raised This Month: $ Target: $400
 0% 

Invisiblity by SchlumPF*


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FiFiX
Senior Member
Join Date: May 2008
Location: Poland
Old 07-29-2010 , 07:13   Invisiblity by SchlumPF*
Reply With Quote #1

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

#pragma semicolon 1

new bool:g_bPlayerInvisible[33], bool:g_bWaterInvisible[33];

public plugin_init( )
{
    register_plugin( "Invisible", "1.3", "SchlumPF*" );

    register_clcmd( "say /invis", "menuInvisDisplay" );

    register_forward( FM_AddToFullPack, "fwdAddToFullPack", 1 );

    register_menucmd( register_menuid( "\rInvisibility - SchlumPF^n^n" ), 1023, "menuInvisAction" );
}

public fwdAddToFullPack( es_handle, e, ent, host, hostflags, player, pset )
{
    if( is_user_alive( ent ) && is_user_alive( host ) )
        if( g_bPlayerInvisible[host] )
            set_es( es_handle, ES_Effects, EF_NODRAW );
    
    if( pev_valid( ent ) )
    {
        static classname[32];
        pev( ent, pev_classname, classname, sizeof classname - 1 );

        // need to remove the string comapring here to save much cpu
        if( equali( classname, "func_water" ) )
            if( g_bWaterInvisible[host] )
                set_es( es_handle, ES_Effects, EF_NODRAW );
    }
    
    return PLUGIN_HANDLED;
}

public menuInvisDisplay( plr )
{
    static menu[2048];
    new keys = ( 1<<0 | 1<<1 | 1<<9 );
    
    new player[3], water[3];
    format( player, sizeof player - 1, "%s", g_bPlayerInvisible[plr] ? "\d" : "\w" );
    format( water, sizeof water - 1, "%s", g_bWaterInvisible[plr] ? "\d" : "\w" );
    
    new len = format( menu, sizeof menu - 1, "\rInvisibility - SchlumPF^n^n" );
    
    len += format( menu[len], sizeof menu - len, "\r01. %sPlayers^n", player );
    len += format( menu[len], sizeof menu - len, "\r02. %sWater^n^n", water );
    len += format( menu[len], sizeof menu - len, "\r00. \wExit" );
    
    show_menu( plr, keys, menu, -1 );
    
    return PLUGIN_HANDLED;
}

public menuInvisAction( plr, key )
{
    static message[192];
    
    switch( key )
    {
        case 0:
        {
            g_bPlayerInvisible[plr] = g_bPlayerInvisible[plr] ? false : true;
            
            message[0] = 0x04;
            
            format( message[1], sizeof message - 2, "[XJ] ^x01All players are now %s.", g_bPlayerInvisible[plr] ? "visible" : "invisible" );
            
            menuInvisDisplay( plr );
        }
        case 1:
        {
            g_bWaterInvisible[plr] = g_bWaterInvisible[plr] ? false : true;
            
            message[0] = 0x04;
            format( message[1], sizeof message - 2, "[XJ] ^x01Water is now %s.", g_bWaterInvisible[plr] ? "visible" : "invisible" );
            
            menuInvisDisplay( plr );
        }
        case 9: show_menu( plr, 0, "" );
    }
    
    return PLUGIN_HANDLED;
}

public client_connect( plr )
{
    g_bPlayerInvisible[plr] = false;
    g_bWaterInvisible[plr] = false;
}
Is it possible to make that Terro will see CT and CT wil see Terro? But CT still wouldn't see another CT?
FiFiX is offline
Send a message via Skype™ to FiFiX
FiFiX
Senior Member
Join Date: May 2008
Location: Poland
Old 08-05-2010 , 07:47   Re: Invisiblity by SchlumPF*
Reply With Quote #2

Bump. ANyone?
FiFiX is offline
Send a message via Skype™ to FiFiX
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-05-2010 , 07:59   Re: Invisiblity by SchlumPF*
Reply With Quote #3

Quote:
Originally Posted by FiFiX View Post
Is it possible to make that Terro will see CT and CT wil see Terro? But CT still wouldn't see another CT?
Yes, possible.
__________________
xPaw is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-05-2010 , 08:01   Re: Invisiblity by SchlumPF*
Reply With Quote #4

xPaw can you tell us how, please?
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
FiFiX
Senior Member
Join Date: May 2008
Location: Poland
Old 08-05-2010 , 08:23   Re: Invisiblity by SchlumPF*
Reply With Quote #5

In public fdwAddToFullPack check the 'host^'s' team, and if it is TT make return PLUGIN_HANDLED?
FiFiX is offline
Send a message via Skype™ to FiFiX
karceWZROKIEM
Junior Member
Join Date: Sep 2008
Location: Poland
Old 08-05-2010 , 12:06   Re: Invisiblity by SchlumPF*
Reply With Quote #6

public fwdAddToFullPack( es_handle, e, ent, host, hostflags, player, pset )
{
if( is_user_alive( ent ) && is_user_alive( host ) )
if( YOUR_COMPLEX_CONDITION )
set_es( es_handle, ES_Effects, EF_NODRAW );

return PLUGIN_HANDLED;
}
__________________
"Smoking" or Drinking - THE Choice is Yours
I don't drink
karceWZROKIEM 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 00:17.


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