Raised This Month: $ Target: $400
 0% 

Solved Players List Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-19-2022 , 22:04   Re: [Issue] Players List Menu
Reply With Quote #1

https://wiki.alliedmods.net/Format_C...mat_Specifiers

You add player name, two times. %N
Try %i

*edit
If you want make it more correctly, you should use player UserId. With this you can try search client index, is player still in game.
But try client index first.

Code:
    for (int i = 1; i <= MaxClients; i++)
    {
        if (!IsClientInGame(i) || !IsFakeClient(i) || !IsPlayerAlive(i) || GetClientTeam(i) != 2)
            continue;
        
        char sID[32];
        char sName[64];
        
        GetClientName(i, sName, sizeof(sName));
        Format(sID, sizeof(sID), "%N", i);
        
        menu.AddItem(sID, sName);
    }
    menu.Display(client, MENU_TIME_FOREVER);
__________________
Do not Private Message @me

Last edited by Bacardi; 08-19-2022 at 22:07.
Bacardi is offline
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 08-20-2022 , 02:07   Re: [Issue] Players List Menu
Reply With Quote #2

Thank You Bacardi,

I was finally able to detect them with their "GetClientOfUserId",

Thanks a lot
__________________
alasfourom 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 01:00.


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