Raised This Month: $ Target: $400
 0% 

NC-Laser code snippet


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
CS-A-Roland
Member
Join Date: Jul 2009
Old 07-15-2012 , 13:42   Re: NC-Laser code snippet
Reply With Quote #4

the buggy code is there, that this laser just the "best" the "first" and the "last" player became... But it dont work as it should!
If the players connect and the item menu pops up, they got it all...
if they turn later to another item then its disabled for "this time", but if you take a weapon of a teammate wich have it you got both items...

dont understand me wrong, if you wan to use it, do it but you should know it dont works like it should so there can come complications later if the server iss full maybe!
I also looking for this problem, because it should work in the right way... without any bugs

By the way... i think you have not all what you need...
Code:
        enum _:ItemsInfo
        {
            ITEM_LASER, // Done
            ITEM_SUICIDE, // Done
            ITEM_POISON, // Done
            ITEM_ADRENALINE, // Done
            ITEM_MEDKIT // Done
        };

//and later.....

g_hItemsMenu = menu_create( "Choose an Item:", "ItemsMenu_Handler" );
        
        for( new i = 0; i < ItemsInfo; i++ )
        {
            num_to_str( i, szInfo, charsmax( szInfo ) );
            
            if( i == ITEM_LASER )
            {
                menu_additem( g_hItemsMenu, g_szItemNames[ i ], szInfo, _, menu_makecallback( "LaserItem_Callback" ) );
            }
            
            else menu_additem( g_hItemsMenu, g_szItemNames[ i ], szInfo );
        }
    }    
    
    public LaserItem_Callback( id, hMenu, iItem )
    {
        if( g_iCurrentRound == 0 )
            return ITEM_DISABLED;
            
        new iFrags = get_user_frags( id );
        new iDeaths = get_user_deaths( id );

        new iPlayerFrags;
        
        new iPlayers[ 32 ], iNum;
        get_players( iPlayers, iNum, "ae", "CT" );
        
        if( iNum == 1 )
            return ITEM_DISABLED;
            
        for( new i = 0, iPlayer; i < iNum; i++ )
        {
            iPlayer = iPlayers[ i ];
            
            if( !is_user_alive( iPlayer ) || iPlayer == id )
                continue;
                
            iPlayerFrags = get_user_frags( iPlayer );
            
            if( iPlayerFrags > iFrags )
                return ITEM_DISABLED;
                
            else if( iPlayerFrags == iFrags )
            {
                if( get_user_deaths( iPlayer ) < iDeaths )
                    return ITEM_DISABLED;
            }
        }
        
        return ITEM_ENABLED;
        
    }
Look at the "Laser" functions and lock them out of the item menu if you dont want use items... but dont ask me how, i'm new at this...
__________________
oOOOoooh it's www.Cs-Attack.de
New World of Warcraft Mod Beta 0.5(based on WC3FT 3.5)
Counterstrike 1.6 SERVER:
Server IP: 193.192.58.154:27200

CONDITION ZERO SERVER:
Server IP: 193.192.58.154:27016

Last edited by CS-A-Roland; 07-15-2012 at 13:52.
CS-A-Roland is offline
 



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 15:16.


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