Good for all.
What happens is I search the best way to do this code
not what you think if you could improve or if they stay well.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /lr", "ShowMenuLR")
}
public ShowMenuLR(id)
{
new menu = menu_create("last request", "CmdMenuLR")
menu_additem(menu, "Duel Knife", "1")
menu_additem(menu, "Duel Scouts", "2")
menu_display(id, menu)
}
public CmdMenuLR(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED;
}
switch(item)
{
case 0: ShowListCT(id)
case 1: ShowListCT(id)
}
return PLUGIN_HANDLED;
}
public ShowListCT(id)
{
new menu = menu_create("go to fight", "CmdListCT")
new iPlayers[32], pnum, tempid
new iName[32], szTempid[10]
get_players(iPlayers, pnum, "aeh", "CT")
for(new i = 0; i < pnum; i++)
{
tempid = iPlayers[i]
get_user_name(tempid, iName, charsmax(iName))
num_to_str(tempid, szTempid, charsmax(szTempid))
menu_additem(menu, iName, szTempid)
}
menu_display(id, menu)
return PLUGIN_HANDLED;
}
public CmdListCT(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data, charsmax(data), iName, charsmax(iName), callback)
// bla bla
}
The plugin is a menu of modes all have a list of players to fight with each mode is different but not if they could do any better Thank you.