Raised This Month: $ Target: $400
 0% 

Solved Players List Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 08-20-2022 , 04:27   Re: Players List Menu
Reply With Quote #1

Quote:
Originally Posted by Grey83 View Post
PHP Code:
public void OnPluginStart()
{
    
RegConsoleCmd("sm_bot"Cmd_ShowBotsMenu"Show Bots Menu.");
}

public 
Action Cmd_ShowBotsMenu(int clientint args)
{
    if(!
client || !IsClientInGame(client))
        return 
Plugin_Handled;

    
PrintToChat(client"Menu Opened");
    
Menu menu = new Menu(BotsList);
    
menu.SetTitle("Select A Bot:");

    
char uid[8], sName[MAX_NAME_LENGTH];
    for(
int i 1<= MaxClientsi++)
        if(
IsClientInGame(i) && IsFakeClient(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
        {
            
GetClientName(isNamesizeof(sName));
            
FormatEx(uidsizeof(uid), "%i"GetClientUserId(i));
            
menu.AddItem(uidsName);
        }

    if(!
menu.ItemCountmenu.AddItem("""Bots not found"ITEMDRAW_DISABLED);
    
menu.Display(clientMENU_TIME_FOREVER);

    return 
Plugin_Handled;
}

public 
int BotsList(Menu menuMenuAction actionint clientint param)
{
    switch(
action)
    {
        case 
MenuAction_Select:
        {
            
char sInfo[8];
            
menu.GetItem(paramsInfosizeof(sInfo));
            
int target StringToInt(sInfo);
            if(
target && (target GetClientUserId(target)))
                
PrintToChatAll("%N has selected %N."clienttarget);
            else 
Cmd_ShowBotsMenu(client0);
        }
        case 
MenuAction_Enddelete menu;
    }

    return 
0;

Awwww, Excellent Grey83
__________________
alasfourom is offline
Reply


Thread Tools
Display Modes

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