Raised This Month: $ Target: $400
 0% 

How can i get steamid of this menu?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-25-2018 , 07:43   Re: How can i get steamid of this menu?
Reply With Quote #2

The least you could do was indent the code and remove blank lines, which you can do with NotePad++ in 5 seconds.

Here's a better looking code:
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_clcmd("say !ban""AwesomeMenu");
}

public 
AwesomeMenuid )
{
    new 
menu menu_create"Ban players""menu_handler" )
    new 
rgPlayers[32], szPlayerName[32], szPlayerId[3], iPlayersCountpevPlayer;
    
get_players(rgPlayersiPlayersCount"ch");
    for (new 
0iPlayersCounti++)
    {
        
pevPlayer rgPlayers[i];
        
get_user_name(pevPlayerszPlayerNamecharsmax(szPlayerName));
        
num_to_str(pevPlayerszPlayerIdcharsmax(szPlayerId));
        
menu_additem(menuszPlayerNameszPlayerId);
    }
    
menu_displayidmenu);
}

public 
menu_handleridmenuitem )
{
    switch( 
item )
    {
    case 
0:
        {
            
SubMenuid );
        }
    case 
1:
        {
            
//Send them to the submenu
            
SubMenuid );
        }
    case 
MENU_EXIT:
        {
            
//Do nothing?
        
}
    }
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;
}

SubMenuid )
{
    
//Note that we will be using a different menu handler
    
new menu menu_create"Player BANMENU""submenu_handler" )
    
menu_addtext2menu"Selected Player: PLAYER NAME GOES HERE");
    
menu_addtext2menu"Selected Player STEAMID: PLAYER STEAMID GOES HERE");
    
menu_additemmenu"Banned for cheating""");
    
menu_additemmenu"Banned for camping""");
    
menu_displayidmenu);
}

public 
submenu_handleridmenuitem )
{
    switch( 
item )
    {
    case 
2:
        {
            
client_cmdid"say Selected reason: Banned for cheating. Player steamid: PLAYER STEAMID GOES HERE" );
        }
    case 
3:
        {
            
client_cmdid"say Selected reason: Banned for camping. Player steamid: PLAYER STEAMID GOES HERE" );
        }
    case 
MENU_EXIT:
        {
            
//If they are still connected
            
if ( is_user_connectedid ) )
            
//Lets send them back to the top menu
            
AwesomeMenuid );
        }
    }
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;

So you want the player name and SteamID to go into another (new) menu, or just into another menu item? These are 2 different things.
__________________
edon1337 is offline
 



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 12:47.


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