Raised This Month: $ Target: $400
 0% 

menu geht users problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-13-2009 , 14:38   menu geht users problem
Reply With Quote #1

PHP Code:
public knife_fight(id)
{

    new 
menu menu_create("\yChoose you'r enemy""cts_menu");
    new 
players[32], pnum
    
new szName[32], szTempid[10];
    
get_players(playerspnum);
    for( new 
ii<pnum;i++ )
    {
        if(
get_user_team(i) == && is_user_alive(i))
        {
            
tempid players[i];
            
get_user_name(tempidszName31);
            
num_to_str(tempidszTempid9);
        }
        
menu_additem(menuszNameszTempid0);
    }
    
menu_display(idmenu0);
    

i just want to show all alive CTs in menu
Attached Thumbnails
Click image for larger version

Name:	1.JPG
Views:	111
Size:	74.7 KB
ID:	51611  
__________________

Last edited by One; 10-13-2009 at 14:41.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-13-2009 , 14:41   Re: menu geht users problem
Reply With Quote #2

PHP Code:
public knife_fight(id)
{

    new 
menu menu_create("\yChoose you'r enemy""cts_menu");
    new 
players[32], pnum
    
new szName[32], szTempid[10];
    
get_players(playerspnum);
    for( new 
ii<pnum;i++ )
    {
        if(
get_user_team(i) == && is_user_alive(i))
        {
            
tempid players[i];
            
// maybe here players[i] -> i
            //if(get_user_team(i) == 2)
            //{
            
get_user_name(tempidszName31);
            
num_to_str(tempidszTempid9);
            
menu_additem(menuszNameszTempid0);
        }
        
//}

    
}
    
menu_display(idmenu0);
    

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-13-2009 , 14:42   Re: menu geht users problem
Reply With Quote #3

First: use cs_get_user_team and stop using random numbers instead of the actual enums.
Second: rofl.
vitorrd is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-13-2009 , 14:45   Re: menu geht users problem
Reply With Quote #4

ty exolent but so i just get the 1 name
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-13-2009 , 14:47   Re: menu geht users problem
Reply With Quote #5

Quote:
Originally Posted by One View Post
ty exolent but so i just get the 1 name
With his code you'll get the names of all alive players from that team.
vitorrd is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-13-2009 , 14:49   Re: menu geht users problem
Reply With Quote #6

Quote:
Originally Posted by vitorrd View Post
With his code you'll get the names of all alive players from that team.
Attached Thumbnails
Click image for larger version

Name:	1.JPG
Views:	77
Size:	58.0 KB
ID:	51613  
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-13-2009 , 14:53   Re: menu geht users problem
Reply With Quote #7

Exolent[jNr], shame on you for missing this:
PHP Code:
public knife_fight(id)
{

    new 
menu menu_create("\yChoose you'r enemy""cts_menu");
    new 
players[32], pnum
    
new szName[32], szTempid[10];
    
get_players(playerspnum);
    for( new 
ii<pnum;i++ )
    {
        
tempid players[i];
        if(
get_user_team(tempid) == && is_user_alive(tempid))
        {
            
// maybe here players[i] -> i
            //if(get_user_team(i) == 2)
            //{
            
get_user_name(tempidszName31);
            
num_to_str(tempidszTempid9);
            
menu_additem(menuszNameszTempid0);
        }
        
//}

    
}
    
menu_display(idmenu0);
    

Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-13-2009 , 14:56   Re: menu geht users problem
Reply With Quote #8

Shame on us, actually.
Open your eyes, Exolent!
vitorrd is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-13-2009 , 14:58   Re: menu geht users problem
Reply With Quote #9

Here is what I would do:
Code:
#include < amxmodx > #include < amxmisc > #include < cstrike > enum ( <<= 1 ) {     BIT_UNASSIGNED = 1,     BIT_T,     BIT_CT,     BIT_SPECTATOR }; // szFlags is the flags for get_players( ) // // iTeamBits is a bitsum of the team numbers. // // Example: // T team only = BIT_T // CT team only = BIT_CT // T team and Spec team ( BIT_T | BIT_SPECTATOR ) ShowPlayerMenu( client, szFlags[ ]="a", iTeamBits ) {     if( !iTeamBits ) {         return 0;     }         new hMenu = menu_create( "Players Menu", "MenuPlayers" );         new iPlayers[ 32 ], iNum, iCount;     get_players( iPlayers, iNum, szFlags );         new iPlayer, szName[ 32 ], szAuthid[ 35 ];     for( new i = 0; i < iNum; i++ ) {         iPlayer = iPlayers[ i ];         if( ( 1 << _:cs_get_user_team( iPlayer ) ) & iTeamBits ) {             get_user_name( iPlayer, szName, 31 );             get_user_authid( iPlayer, szAuthid, 34 );                         menu_additem( hMenu, szName, szAuthid );             iCount++;         }     }         if( !iCount ) {         menu_destroy( hMenu );         return 0;     }         menu_display( client, hMenu );     return 1; } public MenuPlayers( client, hMenu, iItem ) {     if( iItem == MENU_EXIT ) {         menu_destroy( hMenu );         return;     }         new iAccess, szAuthid[ 35 ], hCallback;     menu_item_getinfo( hMenu, iItem, szAuthid, 34, _, _, hCallback );     menu_destroy( hMenu );         new iPlayer = find_player( "c", szAuthid );     if( is_user_connected( iPlayer ) ) {         // you chose iPlayer     } }

EDIT:

Quote:
Originally Posted by Emp` View Post
Exolent[jNr], shame on you for missing this:
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-13-2009 , 14:59   Re: menu geht users problem
Reply With Quote #10

ty. shame on me not exolent & not anyone else
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 05:46.


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