Raised This Month: $51 Target: $400
 12% 

List CT's players in menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 02-13-2014 , 15:14   List CT's players in menu
Reply With Quote #1

Good evening,

i serch for a code snipe to list only CT's in a menu,
and would like to continue work with the client id after selection.

i look around the Wiki and forum, but found no ideas.

Can someone tell me how i can realize it?

Thanks for the effort.
__________________



Sorry for my very bad english
Greetings HSFighter
HSFighter is offline
Send a message via ICQ to HSFighter
xerox8521
Senior Member
Join Date: Sep 2011
Old 02-13-2014 , 16:55   Re: List CT's players in menu
Reply With Quote #2

This should do. You just need to create the MenuHandler for it and extract the id there
PHP Code:
stock ShowCTS(client)
{
    new 
Handle:menu CreateMenu(MenuHandler);
    
SetMenuTitle(menu,"Counter-Terrorists");
    
decl String:CTID[4];
    
decl String:Name[32];
    for(new 
i=1i<MaxClientsi++)
    {
        if(
IsClientConnected(i))
        {
            if(
IsClientInGame(i))
            {
                if(
GetClientTeam(i) == 3// CT is 3
                
{
                    
Format(CTID,sizeof(CTID),"%d",i);
                    
Format(Name,sizeof(Name),"%N",i);
                    
AddMenuItem(menu,CTID,Name);
                }
            }
        }
    }
    
SetMenuExitBackButton(menu,true);
    
DisplayMenu(menu,client,MENU_TIME_FOREVER);


Last edited by xerox8521; 02-13-2014 at 16:56.
xerox8521 is offline
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 02-13-2014 , 17:13   Re: List CT's players in menu
Reply With Quote #3

Thank you very much xerox8521
Here some for you.
__________________



Sorry for my very bad english
Greetings HSFighter

Last edited by HSFighter; 02-13-2014 at 17:13.
HSFighter is offline
Send a message via ICQ to HSFighter
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:36.


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