Участник
Пользователь
- Сообщения
- 22
- Реакции
- 8
Основная информация
Проблема: Некорректно работает плагин Vipmenu
Ошибка:
Amx Mod X: ReAMXX
Билд:
ReGamedll:
Список модулей:
Список плагинов:
Список метамодулей:
Исходник:
Комментарий:
Доброго времени суток всем! Помогите пожалуйста подправить работу плагина.
Проблема заключается в том, что когда игрок использует в меню только пистолет, то он может брать его бесконечное количество раз за раунд, а вместе с ним броню и гранаты все. Причем квар отвечающий за ограничение открытия меню не работает.
Проблема: Некорректно работает плагин Vipmenu
Ошибка:
Дополнительная информацияНекорректная выдача снаряжения плагином
Amx Mod X: ReAMXX
Билд:
Код:
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.0.0.566-dev
Build date: 15:33:38 May 13 2017 (1127)
Build from: https://github.com/dreamstalker/rehlds/commit/5981a4c
ReGamedll:
Код:
ReGameDLL version: 5.2.0.196-dev
Build date: 18:42:15 May 6 2017
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/d0587ee
Список модулей:
PHP:
[ 1] ReAimDetector 0.1.6 ReHLDS Team running
[ 2] ReParachute 1.1 Beta the_hunter running
[ 3] ReAPI 5.1.0.110- Asmodai & s1lent running
[ 4] MySQL 1.8.3-Re AMX Mod X Dev Team running
[ 5] Engine 1.8.3-Re AMX Mod X Dev Team running
[ 6] FakeMeta 1.8.3-Re AMX Mod X Dev Team running
[ 7] Ham Sandwich 1.8.3-Re AMX Mod X Dev Team running
[ 8] CSX 1.8.3-Re AMX Mod X Dev Team running
[ 9] CStrike 1.8.3-Re AMX Mod X Dev Team running
[10] Sockets2 1.8.1.3746 HLSW Dev Team running
[11] RegEx 1.8.3-Re AMX Mod X Dev Team running
11 modules, 11 correct
Список плагинов:
HTML:
[ 1] Admin Loader 2.6.2 neygomon admin_loader.am running
[ 2] WebHS 0.1 kanagava fb_web_online.a running
[ 3] Lite Bans 1.0 rev 26 neugomon bpb_182.amxx running
[ 4] unknown unknown unknown adminfreelook.a running
[ 5] Top Award RBS 15.07.15 SKAJIbnEJIb topaward_rbs.am running
[ 6] [ReApi] Voice Control 1.0 Stimul / di.alya voice_control1. running
[ 7] New Kick Menu 1.2.8 Radius newkickmenu.amx running
[ 8] VoiceControl by CsStat 1.3[FakeMe neygomon voice_control_b running
[ 9] Night VIPs Private Racoon night_vips.amxx running
[ 10] ReAimDetector API 0.1.6 ReHLDS Team reaimdetector.a running
[ 11] Map Manager 2.5.61 Mistrick mapmanager.amxx running
[ 12] unknown unknown unknown LastRound.amxx running
[ 13] Maps Menu 1.8.3-dev+ AMXX Dev Team mapsmenu.amxx running
[ 14] AFK Control 1.4.1 [Rnd neygomon afk_control.amx running
[ 15] Advert Messages 1.22 neygomon adverts.amxx running
[ 16] Advanced Gag 1.4.2 neygomon amx_gag.amxx running
[ 17] Admin Commands 1.8.3-dev+ AMXX Dev Team admincmd.amxx running
[ 18] Admin Chat RBS 16.11.25 183 SKAJIbnEJIb adminchat_rbs.a running
[ 19] Menus Front-End 1.4 neugomon menufront_end.a running
[ 20] Players Menu 1.7 neugomon players_menu.am running
[ 21] Items Restrict 1.0 s1lent items_restrict. running
[ 22] CsStats MySQL 15.07.15 SKAJIbnEJIb csstats_mysql.a running
[ 23] Stats Configuration 15.07.15 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 24] StatsX RBS 15.07.24 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 25] Skill ELO 15.07.22 SKAJIbnEJIb skill_elo.amxx running
[ 26] Ping Control 1.31 neygomon Ping_Control.am running
[ 27] [ReAPI] Ideal VIp 0.0.1 di.alyabev ReApi_Vip.amxx running
[ 28] Team Balancer 15.07.20 Sanlerus team_balancer.a running
[ 29] AutoRestart 1.0 neygomon auto_rr.amxx running
[ 30] resetscore(ReAPI) 1.0 Phantom resetscore.amxx running
[ 31] Rock to Ban 1.02 Safety1st rock2ban.amxx running
[ 32] [ReAPI] Admin Models 0.0.2 Vaqtincha reapi_admin_mod running
[ 33] Block grande info 1.0 neygomon BlockGrenadeInf running
[ 34] Demo Recorder RBS 15.07.15 SKAJIbnEJIb demorecorder_rb running
[ 35] Money For Steam 1.1 neygomon money_for_steam running
[ 36] ESP RBS 15.09.30 SKAJIbnEJIb & Ko esp_rbs.amxx running
[ 37] Models Replacement 0.0.2 ConnorMcLeod | V models_replacem running
[ 38] Nice Killer 1.7 Got Milk? / HoHo nice_killer.amx running
[ 39] [ReAPI] Flasher Punish 0.0.2b Vaqtincha reapi_flasher_p running
[ 40] Fake Ping 1.0 MeRcyLeZZ/gyxoBk FakePing.amxx running
[ 41] Block Advert 1.4 neygomon block_advert.am running
[ 42] FlashBang DynLight 1.2 [REAPI neugomon flashbang_dynli running
[ 43] GameName Changer 1.0 neugomon gamename_change running
[ 44] Back Weapons RBS 15.07.15 hoboman313/cheap backweapons_rbs running
[ 45] Spect Bot 15.07.15 SKAJIbnEJIb & Bo SpectBot.amxx running
[ 46] FunGun Updater 16.10.24 183 SKAJIbnEJIb FunGunUpdater.a stopped
[ 47] Lite Translit 2.8 neygomon lite_translit.a running
[ 48] Advanced Experience Sy 0.4.1 serfreeman1337 aes_main.amxx running
[ 49] AES: Exp CSTRIKE 0.3 serfreeman1337 aes_exp_cstrike running
[ 50] AES: Informer 0.2 serfreeman1337 aes_informer.am running
50 plugins, 49 running
Список метамодулей:
PHP:
[ 1] AMX Mod X RUN - amxmodx_mm_i386. v1.8.3-R ini Start ANY
[ 2] Reunion RUN - reunion_mm_i386. v0.1.75 ini Start Never
[ 3] Revoice RUN - revoice_mm_i386. v0.1.26 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i38 v2.3 ini Chlvl ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 6] WHBlocker RUN - whblocker_mm_i38 v1.5.692 ini Chlvl ANY
[ 7] Ultimate Unprec RUN - ultimate_unpreca v0.3 Alp ini ANY ANY
[ 8] ReAimDetector RUN - reaimdetector_am v0.1.6 pl1 ANY Never
[ 9] ReParachute RUN - parachute_amxx_i v1.1 Bet pl1 ANY ANY
[10] ReAPI RUN - reapi_amxx_i386. v5.1.0.1 pl1 ANY Never
[11] MySQL RUN - mysql_amxx_i386. v1.8.3-R pl1 ANY ANY
[12] Engine RUN - engine_amxx_i386 v1.8.3-R pl1 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx_i3 v1.8.3-R pl1 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx v1.8.3-R pl1 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.8.3-R pl1 ANY ANY
[16] CStrike RUN - cstrike_amxx_i38 v1.8.3-R pl1 ANY ANY
16 plugins, 16 running
Исходник:
Код:
#include <amxmodx>
#include <reapi>
#include <colorchat>
#define PLUGIN_NAME "[ReAPI] Ideal VIp"
#define PLUGIN_VERSION "0.0.1"
#define PLUGIN_AUTHOR "di.alyabev"
#define MAX_CLIENTS 32
#define MAX_TEXT_LENGTH 200
#define SECONDS_IN_DAY 86400
#define is_has_access(%0) (get_user_flags(%0) & ADMIN_LEVEL_H)
//#define ADMIN_SAY_LOG // Раскомментировать для отображения кто что взял в вип меню.
#define ADMIN_LOADER_INTEGRATION // Раскомментировать для отображения срока привелегии.
#define VIPMENU_USE 2 // Сколько раз за раунд можно использовать меню.
#define VIPMENU_LIMIT 2 // Раунд с которого будет доступно вип меню
#define ROUND_LIMIT 3 // Раунд с которого будет доступно AWP и M249
#define BONUS_MONEY 200 // Бонус к деньгам за убийство противника
#define BONUS_HS_MONEY 300 // Бонус к деньгам за убийство противника в голову
#define BONUS_MAX_MONEY 16000 //Максимальное количество денег, для серверов с разблокированным лимитом денег
#if defined ADMIN_LOADER_INTEGRATION
native admin_expired(index);
#endif
new bool:g_bBlockMap;
new g_countUserVip, g_iMaxPlayers, g_iHudSync, g_iHudSync2, g_numRound;
new g_iUserWeapon[MAX_CLIENTS+1], g_countMenuOpen[MAX_CLIENTS+1], g_iDamageMode[MAX_CLIENTS+1], g_iCircleAttacker[MAX_CLIENTS+1], g_iCircleVictim[MAX_CLIENTS+1], bool:g_iChoseWeapon[MAX_CLIENTS+1];
public plugin_precache() {
if(IsBlockMap()) {
g_bBlockMap = true;
return;
}
}
public plugin_init() {
register_dictionary("ideal_vip.txt");
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
Event_Init()
Message_Init()
ReAPI_Init()
Clcmd_Init()
g_iMaxPlayers = get_maxplayers();
g_iHudSync = CreateHudSyncObj();
g_iHudSync2 = CreateHudSyncObj();
}
Event_Init() {
register_event("HLTV", "EventHook_HLTV", "a", "1=0", "2=0");
register_event("Damage", "EventHook_Damage", "b", "2>0", "3=0", "4!0");
register_logevent("LogEventHook_RestartGame", 2, "1=Game_Commencing", "1&Restart_Round_");
}
Message_Init()
register_message(get_user_msgid("ScoreAttrib"), "Message_ScoreAttrib");
ReAPI_Init() {
RegisterHookChain(RG_CBasePlayer_Spawn, "HC_CBasePlayer_Spawn_Post", true);
RegisterHookChain(RG_CBasePlayer_Killed, "HC_CBasePlayer_Killed_Post", true);
}
Clcmd_Init() {
register_clcmd("vip", "Clcmd_Vip_Menu");
register_clcmd("vipmenu", "Clcmd_Vip_Menu");
register_clcmd("vip_menu", "Clcmd_Vip_Menu");
register_clcmd("say /pistol", "Clcmd_Pistol_Menu");
register_clcmd("say /vips", "Clcmd_Vips");
}
public EventHook_HLTV() g_numRound++;
public LogEventHook_RestartGame() g_numRound = 0;
public client_putinserver(id) {
g_iChoseWeapon[id] = false;
g_iDamageMode[id] = 1;
g_iUserWeapon[id] = 0;
}
public client_disconnected(id) {
g_iChoseWeapon[id] = false;
g_iUserWeapon[id] = 0;
}
public HC_CBasePlayer_Spawn_Post(const id) {
if(!is_user_alive(id) || !is_has_access(id)) {
return HC_CONTINUE;
}
g_countMenuOpen[id] = 0;
g_iCircleVictim[id] = 0;
g_iCircleAttacker[id] = 0;
if(!g_bBlockMap) {
if(g_numRound >= 2)
give_vip_equip(id)
if(!g_iChoseWeapon[id])
Clcmd_Pistol_Menu(id);
else
GiveDefaultItems(id, g_iUserWeapon[id])
}
return HC_CONTINUE;
}
GiveDefaultItems(id, secondary_weapon) {
switch(secondary_weapon) {
case 0: {
Clcmd_Pistol_Menu(id);
}
case 1: {
rg_give_item(id, "weapon_deagle", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_DEAGLE, 35);
}
case 2: {
rg_give_item(id, "weapon_glock18", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_GLOCK18, 120);
}
case 3: {
rg_give_item(id, "weapon_usp", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_USP, 100);
}
}
}
public HC_CBasePlayer_Killed_Post(const iVictim, const iAttacker) {
if(!is_user_alive(iVictim) || !is_has_access(iVictim) || !is_has_access(iAttacker))
return HC_CONTINUE;
if(get_member(iVictim, m_bHeadshotKilled))
rg_add_account(iAttacker, BONUS_HS_MONEY, AS_ADD, true);
else
rg_add_account(iAttacker, BONUS_MONEY, AS_ADD, true);
return HC_CONTINUE;
}
give_vip_equip(id) {
rg_give_item(id, "weapon_knife", GT_REPLACE);
rg_give_item(id, "item_thighpack");
rg_give_item(id, "weapon_hegrenade");
rg_give_item(id, "weapon_flashbang");
rg_give_item(id, "weapon_flashbang");
rg_give_item(id, "weapon_smokegrenade");
rg_give_item(id, "item_assaultsuit", GT_REPLACE);
}
public EventHook_Damage(iVictim) {
new iAttacker = get_user_attacker(iVictim);
if(iVictim == iAttacker || !is_user_connected(iAttacker))
return PLUGIN_CONTINUE;
static damage, Float: xa, Float: ya, Float: xv, Float: yv;
static const Float: x_pos_attacker[] = {0.60, 0.575, 0.50, 0.425, 0.35};
static const Float: y_pos_attacker[] = {0.50, 0.60, 0.625, 0.60, 0.50};
static const Float: x_pos_victim[] = {0.30, 0.425, 0.50, 0.575, 0.70};
static const Float: y_pos_victim[] = {0.45, 0.35, 0.30, 0.35, 0.45};
damage = read_data(2);
xv = x_pos_victim[g_iCircleVictim[iVictim]];
yv = y_pos_victim[g_iCircleVictim[iVictim]];
xa = x_pos_attacker[g_iCircleAttacker[iAttacker]];
ya = y_pos_attacker[g_iCircleAttacker[iAttacker]];
if(++g_iCircleAttacker[iAttacker] == sizeof x_pos_attacker) g_iCircleAttacker[iAttacker] = 0;
if(++g_iCircleVictim[iVictim] == sizeof x_pos_victim) g_iCircleVictim[iVictim] = 0;
if(is_has_access(iVictim) && g_iDamageMode[iVictim]) {
set_hudmessage(255, 0, 0, xv, yv, 0, 0.0, 5.0, 0.0, 0.0, 1);
ShowSyncHudMsg(iVictim, g_iHudSync, "%d", damage);
}
if(is_has_access(iAttacker) && g_iDamageMode[iAttacker]) {
set_hudmessage(0, 100, 255, xa, ya, 0, 0.0, 5.0, 0.0, 0.0, 2);
ShowSyncHudMsg(iAttacker, g_iHudSync2, "%d", damage);
}
return PLUGIN_CONTINUE;
}
public Message_ScoreAttrib(const MsgId, const MsgType, const MsgDest) {
if(is_has_access(get_msg_arg_int(1)))
set_msg_arg_int(2, ARG_BYTE, get_msg_arg_int (2) | (1<<2));
}
public Clcmd_Vip_Menu(id) {
if(g_bBlockMap) {
client_print_color(id, print_team_default, "%L", id, "IV_BAD_MAP_WARNING");
return PLUGIN_HANDLED;
}
if(!is_has_access(id)) {
client_print_color(id, print_team_default, "%L", id, "IV_NOT_ACCESS_WARNING");
return PLUGIN_HANDLED;
}
if(!is_user_alive(id)) {
client_print_color(id, print_team_default, "%L", id, "IV_FOR_ALIVE_WARNING");
return PLUGIN_HANDLED;
}
if(g_numRound < VIPMENU_LIMIT) {
client_print_color(id, print_team_default, "%L", id, "IV_ROUND_LIMIT_WARNING", VIPMENU_LIMIT);
return PLUGIN_HANDLED;
}
if(g_countMenuOpen[id] >= VIPMENU_USE) {
client_print_color(id, print_team_default, "%L", id, "IV_MAX_USAGE_WARNING");
return PLUGIN_HANDLED;
}
new item_name[128], title_name[128], szName[32]; get_user_name(id, szName, charsmax(szName));
formatex(title_name, charsmax(title_name), "%L", id, "IV_TITLE_NAME", szName);
#if defined ADMIN_LOADER_INTEGRATION
new seconds_left = clamp(admin_expired(id) - get_systime(), 0, cellmax);
if(seconds_left) {
if(seconds_left / SECONDS_IN_DAY > 0)
formatex(title_name, charsmax(title_name), "%L", id, "IV_TITLE_NAME_AL", szName, (seconds_left / SECONDS_IN_DAY));
else
formatex(title_name, charsmax(title_name), "%L", id, "IV_TITLE_NAME_AL_LAST_DAY", szName);
}
else
formatex(title_name, charsmax(title_name), "%L", id, "IV_TITLE_NAME_AL_UNLIM", szName);
#else
formatex(title_name, charsmax(title_name), "%L", id, "IV_TITLE_NAME", szName);
#endif
new menu = menu_create(title_name, "Vip_Menu_Handler", 1);
formatex(item_name, charsmax(item_name), "%L", id, "IV_ITEM_NAME1");
menu_additem(menu, item_name, "1", 0);
formatex(item_name, charsmax(item_name), "%L", id, "IV_ITEM_NAME2");
menu_additem(menu, item_name, "2", 0);
formatex(item_name, charsmax(item_name), "%L", id, "IV_ITEM_NAME3");
menu_additem(menu, item_name, "3", 0);
formatex(item_name, charsmax(item_name), "%L", id, "IV_ITEM_NAME4");
menu_additem(menu, item_name, "4", 0);
formatex(item_name, charsmax(item_name), "%L", id, "IV_ITEM_NAME5");
menu_additem(menu, item_name, "5", 0);
formatex(item_name, charsmax(item_name), "%L", id, "IV_ITEM_NAME6");
menu_additem(menu, item_name, "6", 0);
formatex(item_name, charsmax(item_name), "%L", id, "IV_ITEM_NAME7");
menu_additem(menu, item_name, "7", 0);
if(g_iDamageMode[id]) formatex(item_name, charsmax(item_name),"%L", id, "IV_ITEM_NAME8_ENABLED");
else formatex(item_name, charsmax(item_name),"%L", id, "IV_ITEM_NAME8_DISABLED");
menu_additem(menu, item_name, "8", 0);
menu_addblank(menu, 1)
formatex(item_name, charsmax(item_name),"%L", id, "IV_ITEM_EXIT");
menu_additem(menu, item_name, "0", 0)
menu_setprop(menu, MPROP_PERPAGE, 0)
menu_display(id, menu)
return PLUGIN_HANDLED;
}
public Vip_Menu_Handler(id, iMenu, item){
if(item == MENU_EXIT) {
menu_destroy(iMenu);
return PLUGIN_HANDLED;
}
new szName[60], szData[6], iAccess, iCallback;
menu_item_getinfo(iMenu, item, iAccess, szData, charsmax(szData), szName, charsmax(szName), iCallback);
get_user_name(id, szName, charsmax(szName));
new iKey = str_to_num(szData);
GiveDefaultItems(id, g_iUserWeapon[id]);
switch(iKey) {
case 1: {
rg_give_item(id, "weapon_ak47", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_AK47, 90);
#if defined ADMIN_SAY_LOG
client_print_color(0, print_team_default, "%L", id, "IV_AK47", szName);
#endif
g_countMenuOpen[id]++;
}
case 2: {
rg_give_item(id, "weapon_m4a1", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_M4A1, 90);
#if defined ADMIN_SAY_LOG
client_print_color(0, print_team_default, "%L", id, "IV_M4A1", szName);
#endif
g_countMenuOpen[id]++;
}
case 3: {
rg_give_item(id, "weapon_sg552", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_SG552, 90);
#if defined ADMIN_SAY_LOG
client_print_color(0, print_team_default, "%L", id, "IV_SG552", szName);
#endif
g_countMenuOpen[id]++;
}
case 4: {
rg_give_item(id, "weapon_aug", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_AUG, 90);
#if defined ADMIN_SAY_LOG
client_print_color(0, print_team_default, "%L", id, "IV_AUG", szName);
#endif
g_countMenuOpen[id]++;
}
case 5: {
if(g_numRound < ROUND_LIMIT) {
client_print_color(id, print_team_default, "%L", id, "IV_ROUND_LIMIT_WARNING", ROUND_LIMIT);
return PLUGIN_HANDLED;
}
rg_give_item(id, "weapon_awp", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_AWP, 30);
#if defined ADMIN_SAY_LOG
client_print_color(0, print_team_default, "%L", id, "IV_AWP", szName);
#endif
g_countMenuOpen[id]++;
}
case 6: {
if(g_numRound < ROUND_LIMIT) {
client_print_color(id, print_team_default, "%L", id, "IV_ROUND_LIMIT_WARNING", ROUND_LIMIT);
return PLUGIN_HANDLED;
}
rg_give_item(id, "weapon_m249", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_M249, 200);
#if defined ADMIN_SAY_LOG
client_print_color(0, print_team_default, "%L", id, "IV_M249", szName);
#endif
g_countMenuOpen[id]++;
}
case 7: Clcmd_Pistol_Menu(id);
case 8: {
if(g_iDamageMode[id]) {
g_iDamageMode[id] = 0;
client_print_color(id, print_team_default, "%L", id, "IV_DAMAGER_DISABLED_CHAT_MSG");
}
else {
g_iDamageMode[id] = 1;
client_print_color(id, print_team_default, "%L", id, "IV_DAMAGER_ENABLED_CHAT_MSG");
}
Clcmd_Vip_Menu(id);
}
}
menu_destroy(iMenu);
return PLUGIN_HANDLED;
}
public Clcmd_Pistol_Menu(id) {
if(g_bBlockMap) {
client_print_color(id, print_team_default, "%L", id, "IV_BAD_MAP_WARNING");
return PLUGIN_HANDLED;
}
if(!is_user_connected(id))
return PLUGIN_HANDLED;
if(!is_has_access(id)) {
client_print_color(id, print_team_default, "%L", id, "IV_NOT_ACCESS_WARNING");
return PLUGIN_HANDLED;
}
new item_name[128], title_name[128], szName[32]; get_user_name(id, szName, charsmax(szName));
formatex(title_name, charsmax(title_name), "%L", id, "IV_TITLE_NAME", szName);
#if defined ADMIN_LOADER_INTEGRATION
new seconds_left = clamp(admin_expired(id) - get_systime(), 0, cellmax);
if(seconds_left) {
if(seconds_left / SECONDS_IN_DAY > 0)
formatex(title_name, charsmax(title_name), "%L", id, "IV_TITLE_NAME_AL", szName, (seconds_left / SECONDS_IN_DAY));
else
formatex(title_name, charsmax(title_name), "%L", id, "IV_TITLE_NAME_AL_LAST_DAY", szName);
}
else
formatex(title_name, charsmax(title_name), "%L", id, "IV_TITLE_NAME_AL_UNLIM", szName);
#else
formatex(title_name, charsmax(title_name), "%L", id, "IV_TITLE_NAME", szName);
#endif
new menu = menu_create(title_name, "Pistol_Menu_Handler", 1);
formatex(item_name, charsmax(item_name), "%L", id, "IV_PITEM_NAME1");
menu_additem(menu, item_name, "1", 0);
formatex(item_name, charsmax(item_name), "%L", id, "IV_PITEM_NAME2");
menu_additem(menu, item_name, "2", 0);
formatex(item_name, charsmax(item_name), "%L", id, "IV_PITEM_NAME3");
menu_additem(menu, item_name, "3", 0);
formatex(item_name, charsmax(item_name),"%L", id, "IV_ITEM_EXIT");
menu_setprop(menu, MPROP_EXITNAME, item_name);
menu_display(id, menu);
return PLUGIN_HANDLED;
}
public Pistol_Menu_Handler(id, iMenu, item) {
if(item == MENU_EXIT) {
menu_destroy(iMenu);
return PLUGIN_HANDLED;
}
new szData[6], szName[60], iAccess, iCallback;
menu_item_getinfo(iMenu, item, iAccess, szData, charsmax(szData), szName, charsmax(szName), iCallback);
new iKey = str_to_num(szData);
g_iUserWeapon[id] = iKey;
g_iChoseWeapon[id] = true
if(!is_user_alive(id)) {
menu_destroy(iMenu);
return PLUGIN_HANDLED;
}
switch(iKey) {
case 1: {
rg_give_item(id, "weapon_deagle", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_DEAGLE, 35);
#if defined ADMIN_SAY_LOG
client_print_color(id, print_team_default, "%L", id, "IV_DEAGLE", szName);
#endif
}
case 2: {
rg_give_item(id, "weapon_glock18", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_GLOCK18, 120);
#if defined ADMIN_SAY_LOG
client_print_color(id, print_team_default, "%L", id, "IV_GLOCK", szName);
#endif
}
case 3: {
rg_give_item(id, "weapon_usp", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_USP, 100);
#if defined ADMIN_SAY_LOG
client_print_color(id, print_team_default, "%L", id, "IV_USP", szName);
#endif
}
}
menu_destroy(iMenu);
return PLUGIN_CONTINUE;
}
public Clcmd_Vips(id) {
static szName[32], pos, msg[191]; pos = g_countUserVip = 0;
for(new i = 1; i <= g_iMaxPlayers; i++) {
if(is_user_connected(i) && is_has_access(i)) {
get_user_name(i, szName, charsmax(szName));
if(++g_countUserVip == 1)
pos = copy(msg, charsmax(msg), szName);
else
pos += format(msg[pos], charsmax(msg) - pos, ", %s", szName);
}
}
if(g_countUserVip)
client_print_color(id, print_team_default, "%L", id, "IV_ONLINE_LIST", msg);
else
client_print_color(id, print_team_default, "%L", id, "IV_ONLINE_LIST_EMPTY");
return PLUGIN_HANDLED;
}
stock IsBlockMap() {
new got_line, line_num, len;
new cfgdir[MAX_TEXT_LENGTH];
new cfgpath[MAX_TEXT_LENGTH];
new mapname[MAX_CLIENTS];
new txt[MAX_TEXT_LENGTH];
get_localinfo("amxx_configsdir", cfgdir, charsmax(cfgdir));
get_mapname(mapname, MAX_CLIENTS-1);
format(cfgpath, MAX_TEXT_LENGTH, "%s/ideal_block_maps.ini", cfgdir);
if(file_exists(cfgpath)) {
got_line = read_file(cfgpath, line_num, txt, MAX_TEXT_LENGTH-1, len);
while (got_line>0) {
if (equali(txt, mapname)) return 1;
line_num++;
got_line = read_file(cfgpath, line_num, txt, MAX_TEXT_LENGTH-1, len);
}
}
return 0;
}
Комментарий:
Доброго времени суток всем! Помогите пожалуйста подправить работу плагина.
Проблема заключается в том, что когда игрок использует в меню только пистолет, то он может брать его бесконечное количество раз за раунд, а вместе с ним броню и гранаты все. Причем квар отвечающий за ограничение открытия меню не работает.
В этой теме было размещено решение! Перейти к решению.
Вложения
-
15.6 KB Просмотры: 581