Raised This Month: $ Target: $400
 0% 

Invisiblity by SchlumPF*


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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