@Code_0xABC,так же не открывает в меню меню устройств
9 Апр 2024
Dmitryikrsk24rus,
#include <AmxModX>
// Native
native get_setnry_count(iPlayer);
native get_user_lasermine(iPlayer);
native get_dispenser_count(iPlayer);
native get_sentry_team(sentry)
public plugin_init() {
register_plugin("[ReCSDM] Menu: Ustr", "0.1", "Immortal-");
register_clcmd("menu_str", "ShowMenu");
register_dictionary("csdm_core/menu_ustr.txt");
}
public ShowMenu(iPlayer) {
new iMenu = menu_create(fmt("%L", LANG_PLAYER, "MENU_USTR_TITLE"), "Menu_Handler");
menu_additem(iMenu, fmt("%L", LANG_PLAYER, "MENU_TUREL", get_setnry_count(iPlayer), get_cvar_num("sentry_limit")), "1");
menu_additem(iMenu, fmt("%L", LANG_PLAYER, "MENU_LASER", get_user_lasermine(iPlayer), get_user_flags(iPlayer) & ADMIN_LEVEL_H ? get_cvar_num("tm_max_mine_vip") : get_cvar_num("tm_max_mine")), "2");
menu_additem(iMenu, fmt("%L", LANG_PLAYER, "MENU_DISPE", get_dispenser_count(iPlayer), get_user_flags(iPlayer) & ADMIN_LEVEL_H ? get_cvar_num("disp_max_vip") : get_cvar_num("disp_max_user")), "3");
menu_additem(iMenu, fmt("%L", LANG_PLAYER, "MENU_Tesla", get_sentry_team(sentry), g_cvar_TEsla_destone;
menu_setprop(iMenu, MPROP_EXITNAME, "Выход");
menu_setprop(iMenu, MPROP_NUMBER_COLOR, "\y");
menu_display(iPlayer, iMenu);
return PLUGIN_HANDLED;
}
public Menu_Handler(iPlayer, iMenu, iItem) {
if(iItem == MENU_EXIT)
return menu_destroy(iMenu);
new szData[64], iKey;
menu_item_getinfo(iMenu, iItem, .info = szData, .infolen = charsmax(szData));
menu_destroy(iMenu);
iKey = str_to_num(szData);
switch(iKey) {
case 1: client_cmd(iPlayer, "sentry_build");
case 2: client_cmd(iPlayer, "+setlaser");
case 3: client_cmd(iPlayer, "build_dispenser");
case 4: client_cmd(iPlayer, "build_tesla", "CommandTeslaBuild" );
}
return PLUGIN_HANDLED;
}