Raised This Month: $ Target: $400
 0% 

one Item max per team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CS-A-Roland
Member
Join Date: Jul 2009
Old 07-13-2012 , 13:11   one Item max per team
Reply With Quote #1

Hey guy's im new in scripting with amxmodx plugins. My Question is easy, i want to restrict an item to the best player in a tream, but it dint work.
There are at the player start not realy a "best" player so i think thers the bug and so can more than one player run with this item.

How i can restrict it to "one" item only per team and then also for the last player wich is alife?!

Work it with:
Code:
if( g_iCurrentRound == 0 )
return ITEM_DISABLED;
if i turn it to:
Code:
if( g_iCurrentRound == 1 )
return ITEM_DISABLED;
Or means iCurrentRound the first round in the game?!
By the way thanks for help!
__________________
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
CS-A-Roland is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-13-2012 , 14:03   Re: one Item max per team
Reply With Quote #2

Can you show your code ? please
__________________
Pawn ? Useless
Aooka is offline
CS-A-Roland
Member
Join Date: Jul 2009
Old 07-13-2012 , 14:34   Re: one Item max per team
Reply With Quote #3

this is it i think...

Code:
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;
        
    }
And at the moment it works to the beginning for all, if they change to another item it dosent work... but if they get a weapon of an player wich have the laser it works again...
It just sould be for the best and later in the round for the last player...
__________________
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-13-2012 at 14:37.
CS-A-Roland 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 15:06.


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