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=1; i<MaxClients; i++)
{
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);
}