Щит и автомат одновременно

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
15
Реакции
1
Ошибка
Игроки имеющие VIP привилегии покупают щит, затем через випменю берут оружие (АК или М4) и могут одновременно использовать щит с основным оружием.
ОС
Linux
Билд
ReHLDS version: 3.4.0.639-dev
Build date: 15:17:35 Feb 27 2018 (1417)
Build from: https://github.com/dreamstalker/rehlds/commit/822df9a
ReGamedll
ReGameDLL version: 5.7.0.295-dev
Build date: 15:10:22 Feb 19 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/aa329db
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 5] WHBlocker RUN - whblocker_mm_i386.so v1.5.695 ini Chlvl ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 7] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 8] Rechecker RUN - rechecker_mm_i386.so v2.4 ini Chlvl ANY
[ 9] AMX Mod X RUN - amxmodx_mm_i386.so v1.8.3-dev+5154 ini Start ANY
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.8.3-dev+5154 pl9 ANY ANY
[11] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.3-dev+5154 pl9 ANY ANY
[12] MySQL RUN - mysql_amxx_i386.so v1.8.3-dev+5154 pl9 ANY ANY
[13] ReAPI RUN - reapi_amxx_i386.so v5.5.0.150-dev pl9 ANY Never
[14] CStrike RUN - cstrike_amxx_i386.so v1.8.3-dev+5154 pl9 ANY ANY
[15] Fun RUN - fun_amxx_i386.so v1.8.3-dev+5154 pl9 ANY ANY
[16] CSX RUN - csx_amxx_i386.so v1.8.3-dev+5154 pl9 ANY ANY
[17] Engine RUN - engine_amxx_i386.so v1.8.3-dev+5154 pl9 ANY ANY
[18] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl9 ANY Never
18 plugins, 18 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] DopBan 3.0.3b kanagava dop_ban303_.amx running
[ 2] Admin Loader 3.2 neygomon admin_loader.am running
[ 3] FreshBans 1.3.9b kanagava fresh_bans_139_ running
[ 4] Last man bets 0.9.4 JGHG lastmanbets.amx running
[ 5] Admin Commands 1.8.3-dev+ AMXX Dev Team admincmd.amxx running
[ 6] Admin Help 1.8.3-dev+ AMXX Dev Team adminhelp.amxx running
[ 7] Slots Reservation 1.8.3-dev+ AMXX Dev Team adminslots.amxx running
[ 8] Multi-Lingual System 1.8.3-dev+ AMXX Dev Team multilingual.am running
[ 9] Menus Front-End 1.5 neugomon menufront_end.a running
[ 10] Commands Menu 1.8.3-dev+ AMXX Dev Team cmdmenu.amxx running
[ 11] Players Menu 1.8.3-dev+ AMXX Dev Team plmenu.amxx running
[ 12] Maps Menu 1.8.3-dev+ AMXX Dev Team mapsmenu.amxx running
[ 13] Plugin Menu 1.8.3-dev+ AMXX Dev Team pluginmenu.amxx running
[ 14] Admin Chat 1.8.3-dev+ AMXX Dev Team adminchat.amxx running
[ 15] Anti Flood 1.8.3-dev+ AMXX Dev Team antiflood.amxx running
[ 16] Admin Votes 1.8.3-dev+ AMXX Dev Team adminvote.amxx running
[ 17] Map Manager 2.5.61 Mistrick mapmanager.amxx running
[ 18] Nextmap Chooser 1.8.3-dev+ AMXX Dev Team mapchooser.amxx stopped
[ 19] Pause Plugins 1.8.3-dev+ AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.8.3-dev+ AMXX Dev Team statscfg.amxx running
[ 21] Restrict Weapons 1.8.3-dev+ AMXX Dev Team restmenu.amxx running
[ 22] StatsX 1.8.3-dev+ AMXX Dev Team statsx.amxx running
[ 23] Ultimate Chats Control 4.1 neygomon ucc.amxx running
[ 24] [ReVIP] Menu 2.5 full pUzzlik re_vip_menu.amx running
[ 25] [ReVIP] System Core 2.5 full pUzzlik re_vip_core.amx running
[ 26] [ReVIP] Tab Info 2.5 full pUzzlik re_vip_tab_info running
[ 27] Silly C4 1.1 Cheap_Suit sillyc4.amxx running
[ 28] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 29] High Ping Kicker 1.0 Shadow/Bo0m! amx_hpk.amxx running
[ 30] Map Spawns Editor 1.0.16 iG_os map_spawns_edit running
[ 31] CS AFK Manager 1.0.6 (amx Freeman afk_manager_1-8 running
[ 32] Damager 1.0 Prayer damager.amxx running
[ 33] Auto Demo Recorder 2.2.1 F@nt0M demo_recorder.a running
[ 34] Admin ESP 0.3 Kost & miRror | admin_esp_mini. running
[ 35] [ReAPI] No Team Flash 0.0.2 Vaqtincha no_team_flash.a running
[ 36] Anti DD Scroll 1.0 Empower anti_dd_scroll_ running
[ 37] Anti DD Scroll 1.0 Empower anti_dd_scroll_ running
[ 38] Anti DD Scroll 1.0 Empower anti_dd_scroll_ running
[ 39] Top Awards 0.11c Safety1st top_awards.amxx running
[ 40] Advanced Experience Sy 0.5 Vega serfreeman1337 aes_main.amxx running
[ 41] AES: CStrike Addon 0.5 Vega serfreeman1337 aes_exp_cstrike running
[ 42] AES: Informer 0.5 Vega serfreeman1337 aes_informer.am running
[ 43] AES: Admin Tools 0.5 Vega serfreeman1337 aes_exp_editor. running
[ 44] AES: Bonus System 0.5 Vega serfreeman1337 aes_bonus_syste running
[ 45] AES: Bonus CSTRIKE 0.5 Vega serfreeman1337 aes_bonus_cstri running
45 plugins, 44 running
Исходный код
#include <amxmodx>
#include <reapi>
#include <vip_system>

#define ADMIN_LOADER // Compatible with Admin Loader from neugomon (https://www.neugomon.ru/threads/486/)

#pragma semicolon 1
new const MenuKey = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<9);

enum _:cvars {
AUTO_MENU,
GIVE_ITEMS,
WEAPONSRND,
AWPM249RND,
SHOP,
SHOP_RND
};

new iPistol[MAX_CLIENTS+1], bool:g_bUsePistol, bool:g_bUseWeapon[MAX_CLIENTS+1];

static sItems[10];
new pCvar[cvars], pCvarCfg[cvars];
new g_iRound;

public plugin_init() {
register_plugin("[ReVIP] Menu", VIP_SYSTEM_VERSION, "pUzzlik");
register_dictionary("vip_system.txt");

// auto open vip menu 1 - on, 0 - off
pCvar[AUTO_MENU] = register_cvar("open_menu_spawn", "0");
/*
flags items
a - armor
d - defuse
f - flashbang
h - hegranade
p - pistol
s - smoke
*/
pCvar[GIVE_ITEMS] = register_cvar("give_items", "adfhps");
// which is available with a round primary weapons
pCvar[WEAPONSRND] = register_cvar("primary_weapons_rnd", "2");
// which is available with a round primary weapons
pCvar[AWPM249RND] = register_cvar("heavy_weapons_rnd", "4");
// if you want to use a custom shop, (1 - enable)
pCvar[SHOP] = register_cvar("use_custom_shop", "1");
// with round displayed shop menu
pCvar[SHOP_RND] = register_cvar("custom_shop_block_rnd", "2");

register_clcmd("vipmenu", "ShowMenu");
register_clcmd("say /vipmenu", "ShowMenu");
register_clcmd("say_team /vipmenu", "ShowMenu");

register_clcmd("say", "hook_say");
register_clcmd("say_team", "hook_say");

register_menucmd(register_menuid("Vip Menu"), MenuKey, "MenuHandler");
}

public plugin_cfg() {
get_pcvar_string(pCvar[GIVE_ITEMS],sItems,charsmax(sItems)); trim(sItems);
pCvarCfg[WEAPONSRND] = get_pcvar_num(pCvar[WEAPONSRND]);
pCvarCfg[AWPM249RND] = get_pcvar_num(pCvar[AWPM249RND]);
pCvarCfg[AUTO_MENU] = get_pcvar_num(pCvar[AUTO_MENU]);
pCvarCfg[SHOP] = get_pcvar_num(pCvar[SHOP]);
pCvarCfg[SHOP_RND] = get_pcvar_num(pCvar[SHOP_RND]);
}

public vip_core_restart_round(round) {
arrayset(g_bUseWeapon, false, sizeof(g_bUseWeapon));
g_iRound = round;
}

public vip_core_player_spawn(const id) {
if(core_is_bonus_spawn(id)) {
for(new i, str_len = strlen(sItems); i < str_len ; i++) {
switch(sItems[i]){
case 'a': rg_set_user_armor(id, 100, ARMOR_VESTHELM);
case 'd': {
new TeamName:team = get_member(id, m_iTeam);
if(team == TEAM_CT) rg_give_defusekit (id, true);
}
case 'f': {
rg_give_item(id, "weapon_flashbang", GT_APPEND);
rg_give_item(id, "weapon_flashbang", GT_APPEND);
}
case 'h': rg_give_item(id, "weapon_hegrenade", GT_APPEND);
case 'p': {
switch(iPistol[id]) {
case 0: { rg_give_item(id, "weapon_deagle", GT_REPLACE); rg_set_user_bpammo(id, WEAPON_DEAGLE, 35); }
case 1: { rg_give_item(id, "weapon_usp", GT_REPLACE); rg_set_user_bpammo(id, WEAPON_USP, 100); }
case 2: { rg_give_item(id, "weapon_glock18", GT_REPLACE); rg_set_user_bpammo(id, WEAPON_GLOCK18, 120); }
}
g_bUsePistol = true;
}
case 's': rg_give_item(id, "weapon_smokegrenade", GT_APPEND);
}
}

if(pCvarCfg[AUTO_MENU] && g_iRound >= pCvarCfg[WEAPONSRND]) ShowMenu(id);
}
}

public hook_say(id) {
static szMsg[32]; read_args(szMsg, charsmax(szMsg)); remove_quotes(szMsg);
static const szChoosedWP[][] = { "/ak47", "/m4a1", "/famas", "/awp", "/b51" };

for(new a; a < sizeof szChoosedWP; a++) {
if(!strcmp(szMsg, szChoosedWP[a])) {
if(!core_is_allow_use(id)) break;
return MenuHandler(id, a);
}
}
return PLUGIN_CONTINUE;
}

public ShowMenu(id) {
if(!core_is_allow_use(id)) return PLUGIN_HANDLED;

new szMenu[512], key; key = MENU_KEY_0;
new iLen, szName[16]; get_entvar(id, var_netname, szName, charsmax(szName));

iLen = formatex(szMenu, charsmax(szMenu), "\r%L \w[\d%L\w]^n\w%L^n", LANG_SERVER, "MENU_NAME", LANG_SERVER, "NAME_SERVER", LANG_SERVER, "WELCOME", szName);

#if defined ADMIN_LOADER
new exp = admin_expired(id);
if(exp > 0) {
new sys = get_systime();
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L^n^n", LANG_SERVER, "VIP_EXPIRED", LANG_SERVER, ((exp - sys) / 86400 > 0) ? "VIP_DAYS" : "VIP_DAY", (exp - sys) / 86400);
} else if(exp == 0) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L^n^n", LANG_SERVER, "VIP_EXPIRED_PRMANENT");
#else
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n");
#endif

new szUseWpn[2]; formatex(szUseWpn, charsmax(szUseWpn), "%s", g_bUseWeapon[id] ? "d" : "w");

if(g_iRound < pCvarCfg[WEAPONSRND])
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r1. \d%L \r%L^n\r2. \d%L \r%L^n\r3. \d%L \r%L^n", LANG_SERVER, "AK47", LANG_SERVER, "ROUND", pCvarCfg[WEAPONSRND], LANG_SERVER, "M4A1", LANG_SERVER, "ROUND", pCvarCfg[WEAPONSRND], LANG_SERVER, "FAMAS", LANG_SERVER, "ROUND", pCvarCfg[WEAPONSRND]);
else {
key |= MENU_KEY_1|MENU_KEY_2|MENU_KEY_3;
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r1. \%s%L^n\r2. \%s%L^n\r3. \%s%L^n", szUseWpn, LANG_SERVER, "AK47", szUseWpn, LANG_SERVER, "M4A1", szUseWpn, LANG_SERVER, "FAMAS");
}

if(g_iRound < pCvarCfg[AWPM249RND])
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r4. \d%L \r%L^n\r5. \d%L \r%L^n^n", LANG_SERVER, "AWP", LANG_SERVER, "ROUND", pCvarCfg[AWPM249RND], LANG_SERVER, "M249", LANG_SERVER, "ROUND", pCvarCfg[AWPM249RND]);
else {
key |= MENU_KEY_4|MENU_KEY_5;
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r4. \%s%L^n\r5. \%s%L^n^n", szUseWpn, LANG_SERVER, "AWP", szUseWpn, LANG_SERVER, "M249");
}

if(g_bUsePistol) {
key |= MENU_KEY_6;
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r6. %L \r[\w%s\r]^n", LANG_SERVER, "PISTOL", iPistol[id] == 0 ? "Deagle" : iPistol[id] == 1 ? "USP" : "Glock");
}
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\r0. %L", LANG_SERVER, "EXIT");

set_member(id, m_iMenu, Menu_OFF);
return show_menu(id, key, szMenu, -1, "Vip Menu");
}

public MenuHandler(id, key) {
if(key <= 4) {
/*** Защита от дурака ***/
if(g_iRound < pCvarCfg[WEAPONSRND]) return client_print_color(id, 0, "%L %L", LANG_SERVER, "CHAT_TAG", LANG_SERVER, "PISTOLS_ROUND");
/*** End ***/
if(g_bUseWeapon[id]) return client_print_color(id, 0, "%L %L", LANG_SERVER, "CHAT_TAG", LANG_SERVER, "ALREDY_WEAPON_RND");
g_bUseWeapon[id] = true;

static const szChoosedBP[] = { 90, 90, 90, 30, 250 };
static const szChoosedWP[][] = { "weapon_ak47", "weapon_m4a1", "weapon_famas", "weapon_awp", "weapon_m249" };

return rg_give_items(id, szChoosedWP[key], szChoosedBP[key]);
}
else if (key == 5) GivePistol(id);
return PLUGIN_HANDLED;
}

public GivePistol(id) {
iPistol[id] >= 2 ? (iPistol[id] = 0) : iPistol[id]++;
ShowMenu(id);
return PLUGIN_HANDLED;
}

stock rg_give_items(id, currWeaponName[], ammoAmount) {
rg_drop_items_by_slot(id, PRIMARY_WEAPON_SLOT);

rg_give_item(id, currWeaponName, GT_APPEND);
rg_set_user_bpammo(id, rg_get_weapon_info(currWeaponName, WI_ID), ammoAmount);

engclient_cmd(id, currWeaponName);
return PLUGIN_HANDLED;
}
Игроки имеющие VIP привилегии покупают щит, затем через випменю берут оружие (АК или М4) и могут одновременно использовать щит с основным оружием. Кто сталкивался с такой проблемой?
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
198
Реакции
273
Помог
5 раз(а)
Вообще довольно странно.
Побуду кепом: если это действительно происходит, то тогда нужно сделать выбрасывание щита, если выдают автомат. https://vk.com/images/emoji/D83EDD14.png
 
Сообщения
2,491
Реакции
2,794
Помог
61 раз(а)
Пробуйте
Код:
stock rg_give_items(id, currWeaponName[], ammoAmount) {
    rg_drop_items_by_slot(id, PRIMARY_WEAPON_SLOT);

    if (get_member(id, m_bOwnsShield)) {
        rg_drop_item(id, "weapon_shield");
    }

    rg_give_item(id, currWeaponName, GT_APPEND);
    rg_set_user_bpammo(id, rg_get_weapon_info(currWeaponName, WI_ID), ammoAmount);

    engclient_cmd(id, currWeaponName);
    return PLUGIN_HANDLED;
}
 
Сообщения
15
Реакции
1
fantom, к сожалению не помогает
18 Июн 2018
При нажатии на цифру 1 выбирается автомат, при нажатии на 2 выбирается щит с пистолетом.
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу