- Ошибка
-
Не работает меню amxmodmenu
- ОС
- Linux
- Amx Mod X
-
1.9.0
- Билд
-
ReHLDS version: 3.13.0.788-dev
Build date: 07:36:33 Jul 12 2023 (3378)
- ReGamedll
-
ReGameDLL version: 5.21.0.546-dev
- Версия Metamod
-
Metamod v1.21p37 2013/05/30 (5:13)
- Список метамодулей
-
[ 1] Reunion RUN - reunion_mm_i386. v0.1.92d ini Start Never
[ 2] AMX Mod X RUN - amxmodx_mm_i386. v1.9.0-d ini Start ANY
[ 3] Rechecker RUN - rechecker_mm_i38 v2.3 ini Chlvl ANY
[ 4] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 5] VoiceTranscoder RUN - VoiceTranscoder. v2017RC5 ini ANY ANY
[ 6] badf load resrdetector_mm_ v - ini - -
[ 7] ReAPI RUN - reapi_amxx_i386. v5.22.0. pl2 ANY Never
[ 8] ReAimDetector RUN - reaimdetector_am v0.2.2 pl2 ANY Never
[ 9] Engine RUN - engine_amxx_i386 v1.9.0-d pl2 ANY ANY
[10] Fun RUN - fun_amxx_i386.so v1.9.0-d pl2 ANY ANY
[11] CStrike RUN - cstrike_amxx_i38 v1.9.0-d pl2 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx v1.9.0-d pl2 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx_i3 v1.9.0-d pl2 ANY ANY
[14] MySQL RUN - mysql_amxx_i386. v1.9.0-d pl2 ANY ANY
14 plugins, 13 running
- Список плагинов
-
[ 1] Admin Spectator ESP 1.3 KoST admin_spec_esp. running
[ 2] VIP Menu [CS RAIN] 0.15 Leo_[BH] vip_girl.amxx running
[ 3] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 4] VIP System (exclusive 2.3.0 Emma Jule vip_system.amxx running
[ 5] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 6] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 7] [Customizable] AmxModM 0.0.5 Albertio amxmodmenu.amxx running
[ 8] Lite VoteBan 1.4 neygomon lite_voteban.am running
[ 9] ReParachute 1.0 PurposeLess reparachute.amx running
[ 10] ResetScore 1.0 Leo_[BH] resetscore_reap running
[ 11] GameCMS_MapManager 1.1 zhorzh78 gamecms_mapmana running
[ 12] Custom Player Models A 0.2.1 F@nt0M & BlackSi custom_player_m running
[ 13] Custom Player Models C 0.2.2 BlackSignature custom_player_m running
[ 14] Custom Player Models T 0.2.1 BlackSignature custom_player_m running
[ 15] Simple Damager 2.1.0 fl0wer simple_damager. running
[ 16] Server Menu [INI] 1.0 server_menu.amx running
[ 17] [ReAPI] Healthnade 0.0.4f F@nt0M + mx?! reapi_healthnad running
[ 18] Molotov Grenade 1.0.3 medusa molotov_grenade running
[ 19] Autoresponder/Advertis 0.5 MaximusBrood ad_manager.amxx running
[ 20] mute menu 1.0 cheap_suit Mute_Menu.amxx running
[ 21] dhudinfo 0.1 BoB4uk Fix Opo4u cso_dhudinfo.am running
[ 22] FreshBans 1.4.0b kanagava fresh_bans.amxx running
[ 23] Admin Loader 2.9 neygomon admin_loader.am running
[ 24] CS Revo: Camera New 1.0 Nani | Wilian M. csrevo_camera_n running
[ 25] UpdateHint 1.3 Lev updatehint.amxx running
[ 26] reunion testing 1 reu_test.amxx running
[ 27] ReAPI Test 1.0 s1lent reapi_test.amxx running
[ 28] Admin Commands 1.9.0-dev+ AMXX Dev Team admincmd.amxx running
[ 29] Slots Reservation 1.9.0-dev+ AMXX Dev Team adminslots.amxx running
[ 30] Multi-Lingual System 1.9.0-dev+ AMXX Dev Team multilingual.am running
[ 31] Commands Menu 1.9.0-dev+ AMXX Dev Team cmdmenu.amxx running
[ 32] Players Menu 1.9.0-dev+ AMXX Dev Team plmenu.amxx running
[ 33] Maps Menu 1.9.0-dev+ AMXX Dev Team mapsmenu.amxx running
[ 34] Admin Chat 1.9.0-dev+ AMXX Dev Team adminchat.amxx running
[ 35] Anti Flood 1.9.0-dev+ AMXX Dev Team antiflood.amxx running
[ 36] Admin Votes 1.9.0-dev+ AMXX Dev Team adminvote.amxx running
[ 37] NextMap 1.9.0-dev+ AMXX Dev Team nextmap.amxx running
[ 38] Nextmap Chooser 1.9.0-dev+ AMXX Dev Team mapchooser.amxx running
[ 39] TimeLeft 1.9.0-dev+ AMXX Dev Team timeleft.amxx running
[ 40] Pause Plugins 1.9.0-dev+ AMXX Dev Team pausecfg.amxx running
[ 41] Stats Configuration 1.9.0-dev+ AMXX Dev Team statscfg.amxx running
[ 42] Restrict Weapons 1.9.0-dev+ AMXX Dev Team restmenu.amxx running
[ 43] AES: Bonus CSTRIKE 0.5.9 [REA serfreeman1337/s aes_bonus_cstri running
[ 44] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 45] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 46] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 47] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 48] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 49] AES: StatsX 0.5.9 [REA serfreeman1337/s aes_statsx_cstr running
[ 50] CSStatsX SQL 0.7.4+1 serfreeman1337 csstatsx_sql.am running
50 plugins, 50 running
- Автор плагина
- Albertio
- Версия плагина
- 0.0.5
- Исходный код
-
#include <amxmodx>
//#tryinclude <gamecms5> // Срок админки GameCMS(раскомментировать, если надо).
#define SECONDS_IN_DAY 86400 // Не трогать!
enum _:MenuData
{
ItemName[64],
ItemCmd[32],
ItemFlag
};
new Array:g_eMenuData;
enum _:MenuSettings
{
MenuName[64],
MenuCmd[32],
MenuPage[4],
MenuFlag
};
new g_eMenuSettings[MenuSettings];
new g_iMenusNum;
new g_iMenuPos[MAX_PLAYERS + 1];
public plugin_precache()
{
new szPath[128], iLen = get_localinfo("amxx_configsdir", szPath, charsmax(szPath));
formatex(szPath[iLen], charsmax(szPath) - iLen, "/amxmodmenu/amxmodmenu.ini");
new hFile = fopen(szPath, "rt");
if(!hFile)
{
set_fail_state("Can't %s '%s'", file_exists(szPath) ? "read" : "find", szPath);
return;
}
g_eMenuData = ArrayCreate(MenuData);
new szLine[128], szType[24], szName[64], szCmd[32], szFlag[4], szMenuData[MenuData];
while(!feof(hFile))
{
fgets(hFile, szLine, charsmax(szLine));
Str_RemoveComment(szLine);
trim(szLine);
if(parse(szLine, szType, charsmax(szType), szCmd, charsmax(szCmd)) == 2)
{
if(szType[0] == EOS)
{
continue;
}
if(equali(szType, "display_menu_page"))
{
copy(g_eMenuSettings[MenuPage], charsmax(g_eMenuSettings[MenuPage]), szCmd);
continue;
}
}
if(parse(szLine, szType, charsmax(szType), szName, charsmax(szName), szCmd, charsmax(szCmd), szFlag, charsmax(szFlag)) == 4)
{
if(szType[0] == EOS)
{
continue;
}
replace_all(szName, charsmax(szName), "^^n", "^n");
replace_all(szName, charsmax(szName), "^^t", "^t");
if(equali(szType, "reg_main_menu"))
{
copy(g_eMenuSettings[MenuName], charsmax(g_eMenuSettings[MenuName]), szName);
copy(g_eMenuSettings[MenuCmd], charsmax(g_eMenuSettings[MenuCmd]), szCmd);
g_eMenuSettings[MenuFlag] = read_flags(szFlag);
}
else if(equali(szType, "add_menu_item"))
{
copy(szMenuData[ItemName], charsmax(szMenuData[ItemName]), szName);
copy(szMenuData[ItemCmd], charsmax(szMenuData[ItemCmd]), szCmd);
szMenuData[ItemFlag] = read_flags(szFlag);
ArrayPushArray(g_eMenuData, szMenuData);
}
}
}
fclose(hFile);
g_iMenusNum = ArraySize(g_eMenuData);
}
public plugin_init()
{
register_plugin("[Customizable] AmxModMenu", "0.0.5", "Albertio");
register_concmd(g_eMenuSettings[MenuCmd], "AmxModMenu_Cmd", g_eMenuSettings[MenuFlag]);
register_menucmd(register_menuid("AmxModMenu"), 1023, "AmxModMenu_Handler");
}
public AmxModMenu_Cmd(id, iFlag)
{
if(~get_user_flags(id) & iFlag)
{
console_print(id, "У вас недостаточно прав для использования этой команды");
return PLUGIN_HANDLED;
}
AmxModMenu_Display(id, g_iMenuPos[id] = 0);
return PLUGIN_HANDLED;
}
public AmxModMenu_Display(id, iPos)
{
if(iPos < 0)
{
return PLUGIN_HANDLED;
}
new szMenu[MAX_MENU_LENGTH], iLen;
#if defined _gamecms5_included
new iExpTime = cmsapi_service_timeleft(id), iSysTime = get_systime();
if(iExpTime - iSysTime > 0)
{
new iFinalTime = (iExpTime - iSysTime) / SECONDS_IN_DAY;
if(iFinalTime > 0)
{
if(g_eMenuSettings[MenuPage][0] == '1')
{
iLen = formatex(szMenu, charsmax(szMenu), "%s\R\y%d/%d^n\wОсталось \r%d \wдней^n^n", g_eMenuSettings[MenuName],
iPos + 1, (g_iMenusNum / 8) + (((g_iMenusNum % 8) > 0) ? 1 : 0), iFinalTime);
}
else
{
iLen = formatex(szMenu, charsmax(szMenu), "%s^n\wОсталось \r%d \wдней^n^n", g_eMenuSettings[MenuName], iFinalTime);
}
}
else
{
if(g_eMenuSettings[MenuPage][0] == '1')
{
iLen = formatex(szMenu, charsmax(szMenu), "%s\R\y%d/%d^n\rПоследний \wдень^n^n",
g_eMenuSettings[MenuName], iPos + 1, (g_iMenusNum / 8) + (((g_iMenusNum % 8) > 0) ? 1 : 0));
}
else
{
iLen = formatex(szMenu, charsmax(szMenu), "%s^n\rПоследний \wдень^n^n", g_eMenuSettings[MenuName]);
}
}
}
else if(iExpTime == 0)
{
if(g_eMenuSettings[MenuPage][0] == '1')
{
iLen = formatex(szMenu, charsmax(szMenu), "%s\R\y%d/%d^n\wПрава \yне ограничены^n^n",
g_eMenuSettings[MenuName], iPos + 1, (g_iMenusNum / 8) + (((g_iMenusNum % 8) > 0) ? 1 : 0));
}
else
{
iLen = formatex(szMenu, charsmax(szMenu), "%s^n\wПрава \yне ограничены^n^n", g_eMenuSettings[MenuName]);
}
}
#else
if(g_eMenuSettings[MenuPage][0] == '1')
{
iLen = formatex(szMenu, charsmax(szMenu), "%s\R\y%d/%d^n^n", g_eMenuSettings[MenuName],
iPos + 1, (g_iMenusNum / 8) + (((g_iMenusNum % 8) > 0) ? 1 : 0));
}
else
{
iLen = formatex(szMenu, charsmax(szMenu), "%s^n^n", g_eMenuSettings[MenuName]);
}
#endif
new iKeys = MENU_KEY_0, iStart = iPos * 8, iEnd = min(iStart + 8, g_iMenusNum), iNum, szMenuData[MenuData];
if(iStart >= g_iMenusNum)
{
iStart = iPos = g_iMenuPos[id] = 0;
}
for(new i = iStart, iFlags = get_user_flags(id); i < iEnd; i++)
{
ArrayGetArray(g_eMenuData, i, szMenuData);
if(iFlags & szMenuData[ItemFlag])
{
iKeys |= (1<<iNum);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r%d. \w%s^n", ++iNum, szMenuData[ItemName]);
}
else
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d%d. %s^n", ++iNum, szMenuData[ItemName]);
}
}
if(iEnd != g_iMenusNum)
{
iKeys |= MENU_KEY_9
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\r9. \wДалее^n\r0. \w%s", iPos ? "Назад" : "Выход");
}
else
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\r0. \w%s", iPos ? "Назад" : "Выход");
}
return show_menu(id, iKeys, szMenu, -1, "AmxModMenu");
}
public AmxModMenu_Handler(id, key)
{
switch(key)
{
case 8:
{
AmxModMenu_Display(id, ++g_iMenuPos[id]);
}
case 9:
{
AmxModMenu_Display(id, --g_iMenuPos[id]);
}
default:
{
new szMenuData[MenuData];
ArrayGetArray(g_eMenuData, g_iMenuPos[id] * 8 + key, szMenuData);
new szMenuCmd[32];
copy(szMenuCmd, charsmax(szMenuCmd), szMenuData[ItemCmd]);
if(szMenuCmd[0] == 's' && szMenuCmd[1] == 'v' && szMenuCmd[2] == '_')
{
server_cmd(szMenuCmd);
}
else
{
client_cmd(id, szMenuCmd);
}
}
}
return PLUGIN_HANDLED;
}
stock Str_RemoveComment(str[])
{
new i;
while(str[i] != EOS)
{
if(str[i] == ';')
{
str[i] = EOS;
break;
}
i++;
}
}
Здраствуйте, Мне не доступно меню без флага u. У меня в кфг стоит на флаг c, но он не работает. В чем проблема и как решить?
Я ставил другие флаги, та самая ситуация. Только нужно иметь флаг u, тогда работает. Но у меня флаг u для Гл. Админа.
Я ставил другие флаги, та самая ситуация. Только нужно иметь флаг u, тогда работает. Но у меня флаг u для Гл. Админа.
В этой теме было размещено решение! Перейти к решению.
Вложения
-
1.5 KB Просмотры: 74