Участник
Пользователь
- Сообщения
- 43
- Реакции
- 7
Есть такой вариант отлова бай меню , но хотелось еще вариантов? более лучшее
Код:
#include <amxmodx>
new const g_szBuyCommands[][] =
{
"usp", "glock", "deagle", "p228", "elites",
"fn57", "m3", "xm1014", "mp5", "tmp", "p90",
"mac10", "ump45", "ak47", "galil", "famas",
"sg552", "m4a1", "aug", "scout", "awp", "g3sg1",
"sg550", "m249", "vest", "vesthelm", "flash",
"hegren", "sgren", "defuser", "nvgs", "shield",
"primammo", "secammo", "km45", "9x19mm", "nighthawk",
"228compact", "fiveseven", "12gauge", "autoshotgun",
"mp", "c90", "cv47", "defender", "clarion", "krieg552",
"bullpup", "magnum", "d3au1", "krieg550",
"buy", "buyequip", "cl_autobuy",
"cl_rebuy", "cl_setautobuy", "cl_setrebuy", "client_buy_open"
};
enum _:MESSAGES
{
BuyClose = 0
};
new g_MsgID[MESSAGES];
public plugin_init()
{
g_MsgID[BuyClose] = get_user_msgid("BuyClose");
new iBuyCommands;
for (iBuyCommands = 0; iBuyCommands < sizeof g_szBuyCommands; iBuyCommands++)
{
register_clcmd(g_szBuyCommands[iBuyCommands], "Command_BuyMenu");
}
}
public Command_BuyMenu(id)
{
if (!is_user_alive(id))
{
return PLUGIN_CONTINUE;
}
Show_Menu(id);
return PLUGIN_HANDLED;
}
public Show_Menu(id)
{
if (!is_user_alive(id))
{
return PLUGIN_HANDLED;
}
// Закрываем вгю меню
message_begin(MSG_ONE, g_MsgID[BuyClose], _, id);
message_end();
// здесь мой меню
return PLUGIN_HANDLED;
}