Участник
Пользователь
- Сообщения
- 702
- Реакции
- 54
- Ошибка
-
https://pastenow.ru/fa54df2d9ffc0fd39c5e3dacda7d6fca
Первый пункт почему-то создаётся неправильно, как пустой..
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.9.0.5263 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Oct 27 2019 16:23:31
Built from: https://github.com/alliedmodders/amxmodx/commit/15a14a0
Build ID: 5263:15a14a0
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.695-dev
Build date: 14:15:13 Apr 6 2020 (2186)
Build from: https://github.com/dreamstalker/rehlds/commit/7513e71
- ReGamedll
-
ReGameDLL version: 5.16.0.460-dev
Build date: 10:11:49 May 2 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/4f72525
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 2] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 3] Reunion RUN - reunion_mm_i386.so v0.1.0.92c ini Start Never
[ 4] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 5] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5263 ini Start ANY
[ 6] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 7] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 8] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[ 9] ReAPI RUN - reapi_amxx_i386.so v5.12.0.192-dev pl5 ANY Never
[10] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl5 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[12] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
13 plugins, 13 running
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] Admin Loader 3.5 neygomon admin_loader.am running
[ 2] Lite Bans 2.2 neygomon lite_bans_off.a running
[ 3] ScreenMaker 1.1 neygomon screen_maker.am running
[ 4] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 5] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 6] Admin Commands 1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 7] Menus Front-End 1.4 neugomon menufront_end.a running
[ 8] Players Menu 1.9.0.5263 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.4.1 neugomon mapsmenu.amxx running
[ 10] Commands Menu 1.9.0.5263 AMXX Dev Team cmdmenu.amxx running
[ 11] Admin Chat 1.9.0.5263 AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.9.0.5263 AMXX Dev Team antiflood.amxx running
[ 13] Admin Votes 1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 14] NextMap 1.9.0.5263 AMXX Dev Team nextmap.amxx running
[ 15] Nextmap Chooser 1.9.0.5263 AMXX Dev Team mapchooser.amxx running
[ 16] TimeLeft 1.9.0.5263 AMXX Dev Team timeleft.amxx running
[ 17] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am running
[ 18] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 19] Stats Configuration 1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 20] Restrict Weapons 1.9.0.5263 AMXX Dev Team restmenu.amxx running
[ 21] StatsX 1.9.0.5263 AMXX Dev Team statsx.amxx running
[ 22] CS Stats Logging 1.9.0.5263 AMXX Dev Team stats_logging.a running
[ 23] [ReAPI] AdminFreeLook 1.0 ReHLDS Team adminfreelook.a running
[ 24] Lite Recoder 1.0.1 neygomon amx_demorec.amx running
[ 25] Instant AutoTeamBalanc 1.2.0 ConnorMcLeod autoteambalance running
[ 26] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 27] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 28] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 29] Advert Messages 1.2.2 neygomon adverts.amxx running
[ 30] [ReAPI] Reset Score 0.1 pUzzlik re_reset_score. running
[ 31] unknown unknown unknown music.amxx running
[ 32] Admin ESP 0.2 Kost & miRror admin_esp_mini. running
[ 33] Items Restrict 1.1 s1lent items_restrict. running
[ 34] Easy VIP 1.0 ThePhoenix VIP.amxx debug
[ 35] [ReAPI] AWPoff 1.3 PAffAEJIkA :3 awp_off.amxx running
[ 36] Super WeaponMenu 1.1 neygomon s_weaponmenu_re running
[ 37] Forbidden Names 0.0.3 Vaqtincha Forbidden_Names running
[ 38] AntiFlood Change Name 28.11.2018 sergrib protection.amxx running
[ 39] ReChecker Logging 1.0 custom rc_logging.amxx running
[ 40] Map Manager: Core 3.0.7 Mistrick map_manager_cor running
[ 41] Map Manager: Scheduler 0.1.5 Mistrick map_manager_sch running
[ 42] Map Manager: Rtv 0.1.1 Mistrick map_manager_rtv running
[ 43] Map Manager: Nominatio 0.1.2 Mistrick map_manager_nom running
[ 44] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 45] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 46] Map Manager: Effects 0.0.9 Mistrick map_manager_eff running
[ 47] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 48] Map Manager: Advanced 0.0.5 Mistrick map_manager_adv running
48 plugins, 48 running
- Автор плагина
- neugomon
- Версия плагина
- 1.1
- Исходный код
-
#include <amxmodx>
#include <reapi>
#define ACCESS ADMIN_MENU // Флаг доступа к меню. По умолчанию "u"
//#define NUM_OPEN 1 // Сколько раз можно открывать каждый из пунктов меню за 1 раунд
//#define ALLOW_ROUND 3 // С какого раунда можно пользоваться менюшкой
enum _:WEAP { NAME[32], AMMOUNT, TYPE }
new g_aEquipData[64][WEAP], g_iCount;
new g_sSelectedItem[33][32];
new g_MainMenu, g_PrimMenu, g_ScndMenu, g_ItemMenu;
new _access, sItemData[32], callback;
new g_iCountRound;
new g_iNumUseMenus[33][3];
public plugin_init()
{
#define VERSION "1.1"
register_plugin("Super WeaponMenu", VERSION, "neygomon"); // Edit by MakapoH.
register_cvar("s_weaponmenu", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
register_clcmd("weaponmenu", "CmdWeaponMenu");
RegisterHookChain(RG_CSGameRules_RestartRound, "CSGameRules_RestartRound_Pre");
}
#define PR_FILE "addons/amxmodx/configs/weaponmenu/primary.ini"
#define SR_FILE "addons/amxmodx/configs/weaponmenu/secondary.ini"
#define IT_FILE "addons/amxmodx/configs/weaponmenu/items.ini"
public plugin_cfg()
{
new i, fp, buffer[96], temp[3][32];
g_MainMenu = menu_create("\d[\rWeaponMenu\d] \yВыберите тип", "MainMenuHandler");
menu_setprop(g_MainMenu, MPROP_EXITNAME, "Выход");
if(file_exists(PR_FILE))
{
menu_additem(g_MainMenu, "Основное оружие", "0");
g_PrimMenu = menu_create("\d[\rWeaponMenu\d] \yВыберите оружие\w", "MenuHandler");
menu_setprop(g_PrimMenu, MPROP_NEXTNAME, "Далее");
menu_setprop(g_PrimMenu, MPROP_BACKNAME, "Назад");
menu_setprop(g_PrimMenu, MPROP_EXITNAME, "Выход");
fp = fopen(PR_FILE, "rt");
i = 0;
while(!feof(fp))
{
fgets(fp, buffer, charsmax(buffer));
if(buffer[0] && buffer[0] != ';' && parse(buffer, temp[0], charsmax(temp[]), temp[1], charsmax(temp[]), temp[2], charsmax(temp[])))
{
menu_additem(g_PrimMenu, temp[0], temp[1]);
copy(g_aEquipData[g_iCount][NAME], charsmax(g_aEquipData[][NAME]), temp[1]);
g_aEquipData[g_iCount][AMMOUNT] = str_to_num(temp[2]);
g_aEquipData[g_iCount++][TYPE] = 1;
i++;
}
}
fclose(fp);
if(i == 0) log_amx("WARN! File ^"%s^" is blank or invalid format! Repare please.", PR_FILE);
}
if(file_exists(SR_FILE))
{
menu_additem(g_MainMenu, "Второстепенное оружие", "1");
g_ScndMenu = menu_create("\d[\rWeaponMenu\d] \yВыберите оружие\w", "MenuHandler");
menu_setprop(g_ScndMenu, MPROP_NEXTNAME, "Далее");
menu_setprop(g_ScndMenu, MPROP_BACKNAME, "Назад");
menu_setprop(g_ScndMenu, MPROP_EXITNAME, "Выход");
fp = fopen(SR_FILE, "rt");
i = 0;
while(!feof(fp))
{
fgets(fp, buffer, charsmax(buffer));
if(buffer[0] && buffer[0] != ';' && parse(buffer, temp[0], charsmax(temp[]), temp[1], charsmax(temp[]), temp[2], charsmax(temp[])))
{
menu_additem(g_ScndMenu, temp[0], temp[1]);
copy(g_aEquipData[g_iCount][NAME], charsmax(g_aEquipData[][NAME]), temp[1]);
g_aEquipData[g_iCount][AMMOUNT] = str_to_num(temp[2]);
g_aEquipData[g_iCount++][TYPE] = 0;
i++;
}
}
fclose(fp);
if(i == 0) log_amx("WARN! File ^"%s^" is blank or invalid format! Repare please.", SR_FILE);
}
if(file_exists(IT_FILE))
{
menu_additem(g_MainMenu, "Обмундирование", "2");
g_ItemMenu = menu_create("\d[\rWeaponMenu\d] \yВыберите экипировку\w", "MenuHandler");
menu_setprop(g_ItemMenu, MPROP_NEXTNAME, "Далее");
menu_setprop(g_ItemMenu, MPROP_BACKNAME, "Назад");
menu_setprop(g_ItemMenu, MPROP_EXITNAME, "Выход");
fp = fopen(IT_FILE, "rt");
i = 0;
while(!feof(fp))
{
fgets(fp, buffer, charsmax(buffer));
if(buffer[0] && buffer[0] != ';' && parse(buffer, temp[0], charsmax(temp[]), temp[1], charsmax(temp[]), temp[2], charsmax(temp[])))
{
menu_additem(g_ItemMenu, temp[0], temp[1]);
copy(g_aEquipData[g_iCount][NAME], charsmax(g_aEquipData[][NAME]), temp[1]);
g_aEquipData[g_iCount][AMMOUNT] = (temp[1][0] == 'w' && temp[1][7] == 's') ? -1 : str_to_num(temp[2]);
g_aEquipData[g_iCount++][TYPE] = 2;
i++;
}
}
fclose(fp);
if(i == 0) log_amx("WARN! File ^"%s^" is blank or invalid format! Repare please.", IT_FILE);
}
}
public client_disconnected(id)
{
arrayset(g_iNumUseMenus[id], 0, 3);
g_sSelectedItem[id][0] = 0;
}
public CSGameRules_RestartRound_Pre()
{
if(get_member_game(m_bCompleteReset))
g_iCountRound = 0;
g_iCountRound++;
new iPlayers[MAX_CLIENTS], iPlayersNum;
get_players(iPlayers, iPlayersNum, "ch");
for(new id; id < iPlayersNum; id++)
arrayset(g_iNumUseMenus[id], 0, sizeof(g_iNumUseMenus));
}
public CmdWeaponMenu(id)
{
if(get_user_flags(id) & ACCESS)
{
//if(g_iCountRound < ALLOW_ROUND) client_print(id, print_chat, "* WeaponMenu доступно только с %d раунда!", ALLOW_ROUND);
//else
menu_display(id, g_MainMenu);
}
else client_print(id, print_notify, "* Доступ запрещен! Вы еще не насосали права к этому меню :)"); // Повеселиться хочется :D
return PLUGIN_HANDLED;
}
public MainMenuHandler(id, menu, item)
{
if(item != MENU_EXIT)
{
//if(g_iNumUseMenus[id][item] < NUM_OPEN)
//{
g_iNumUseMenus[id][item]++;
switch(item)
{
case 0: menu_display(id, g_PrimMenu);
case 1: menu_display(id, g_ScndMenu);
case 2: menu_display(id, g_ItemMenu);
}
//}
//else client_print(id, print_chat, "* В WeaponMenu каждым пунктом можно пользоваться только %d раз за раунд!", NUM_OPEN);
}
return PLUGIN_HANDLED;
}
public MenuHandler(id, menu, item)
{
if(item != MENU_EXIT)
{
menu_item_getinfo(menu, item, _access, sItemData, charsmax(sItemData), _, _, callback);
copy(g_sSelectedItem[id], charsmax(g_sSelectedItem[]), sItemData);
SelectPlayer(id);
}
return PLUGIN_HANDLED;
}
SelectPlayer(id)
{
new iPlayersMenu = menu_create("\d[\rWeaponMenu\d] \yВыберите игрока\w", "playersmenu_handler");
menu_setprop(iPlayersMenu, MPROP_NEXTNAME, "Далее");
menu_setprop(iPlayersMenu, MPROP_BACKNAME, "Назад");
menu_setprop(iPlayersMenu, MPROP_EXITNAME, "Выход");
new players[32], pnum, name[32], frmt[64], num[3];
get_entvar(id, var_netname, name, charsmax(name));
formatex(frmt, charsmax(frmt), "%s \d[\rВы\d]", name);
num_to_str(id, num, charsmax(num));
menu_additem(iPlayersMenu, frmt, num);
get_players(players, pnum, "h");
for(new i, playerId; i < pnum; i++)
{
playerId = players[i];
if(id == playerId) continue;
get_entvar(playerId, var_netname, name, charsmax(name));
num_to_str(playerId, num, charsmax(num));
menu_additem(iPlayersMenu, name, num);
}
return menu_display(id, iPlayersMenu, 0);
}
public playersmenu_handler(id, menu, item)
{
if(item != MENU_EXIT)
{
menu_item_getinfo(menu, item, _access, sItemData, charsmax(sItemData), _, _, callback);
new i = ReturnNumAmmount(g_sSelectedItem[id]);
new ammo = g_aEquipData[i][AMMOUNT];
new weap_type = g_aEquipData[i][TYPE];
new vic = str_to_num(sItemData);
if(ammo != -1 && weap_type != 2)
{
rg_give_item(vic, g_sSelectedItem[id], GT_REPLACE);
rg_set_user_bpammo(vic, rg_get_weapon_info(g_sSelectedItem[id], WI_ID), ammo);
}
else if(weap_type == 2)
{
new wp = (g_sSelectedItem[id][0] == 'w' && g_sSelectedItem[id][6] == '_') ? 1 : 0;
if(wp && g_sSelectedItem[id][7] == 's')
{
if(!get_member(vic, m_bOwnsShield))
rg_give_shield(vic);
}
else if(wp && ammo != -1)
{
rg_give_item(vic, g_sSelectedItem[id]);
rg_set_user_bpammo(vic, rg_get_weapon_info(g_sSelectedItem[id], WI_ID), ammo);
}
else
{
if(!strcmp(g_sSelectedItem[id], "kevlar"))
rg_set_user_armor(vic, ammo > 0 ? ammo : 0, ARMOR_KEVLAR);
else if(!strcmp(g_sSelectedItem[id], "kevlar_helmet"))
rg_set_user_armor(vic, ammo > 0 ? ammo : 0, ARMOR_VESTHELM);
else if(!strcmp(g_sSelectedItem[id], "nightvision"))
set_member(vic, m_bHasNightVision);
else if(!strcmp(g_sSelectedItem[id], "defuse_kit"))
rg_give_defusekit(vic);
}
}
}
g_sSelectedItem[id][0] = 0;
menu_display(id, g_MainMenu);
return PLUGIN_HANDLED;
}
stock ReturnNumAmmount(weapon[])
{
for(new i; i < g_iCount; i++)
{
if(!strcmp(g_aEquipData[i][NAME], weapon))
return i;
}
return -1;
}
В каждом меню (осн.оружие | второстепенное | экипировка) первый пункт пустой, он не прописан в файликах, в файликах прописано с 2 и по конечный, т.е 2 пункт должен был вместо первого, а не быть первый пункт пустой и начинаться со второго.
В этой теме было размещено решение! Перейти к решению.