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 AwesomeMenu( id )
{
new menu = menu_create( "Ban players", "menu_handler" )
new rgPlayers[32], szPlayerName[32], szPlayerId[3], iPlayersCount, pevPlayer;
get_players(rgPlayers, iPlayersCount, "ch");
for (new i = 0; i < iPlayersCount; i++)
{
pevPlayer = rgPlayers[i];
get_user_name(pevPlayer, szPlayerName, charsmax(szPlayerName));
num_to_str(pevPlayer, szPlayerId, charsmax(szPlayerId));
menu_additem(menu, szPlayerName, szPlayerId);
}
menu_display( id, menu, 0 );
}
public menu_handler( id, menu, item )
{
switch( item )
{
case 0:
{
SubMenu( id );
}
case 1:
{
//Send them to the submenu
SubMenu( id );
}
case MENU_EXIT:
{
//Do nothing?
}
}
menu_destroy( menu );
return PLUGIN_HANDLED;
}
SubMenu( id )
{
//Note that we will be using a different menu handler
new menu = menu_create( "Player BANMENU", "submenu_handler" )
menu_addtext2( menu, "Selected Player: PLAYER NAME GOES HERE");
menu_addtext2( menu, "Selected Player STEAMID: PLAYER STEAMID GOES HERE");
menu_additem( menu, "Banned for cheating", "", 0 );
menu_additem( menu, "Banned for camping", "", 0 );
menu_display( id, menu, 0 );
}
public submenu_handler( id, menu, item )
{
switch( item )
{
case 2:
{
client_cmd( id, "say Selected reason: Banned for cheating. Player steamid: PLAYER STEAMID GOES HERE" );
}
case 3:
{
client_cmd( id, "say Selected reason: Banned for camping. Player steamid: PLAYER STEAMID GOES HERE" );
}
case MENU_EXIT:
{
//If they are still connected
if ( is_user_connected( id ) )
//Lets send them back to the top menu
AwesomeMenu( id );
}
}
menu_destroy( menu );
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.
__________________