Help Падение сервера при смене карты

Статус
В этой теме нельзя размещать новые ответы.

Top4ik

Пользователь
Регистрация
10 Фев 2020
Сообщения
54
Симпатии
4
OS
Linux
Amx Mod X
AMXX 1.9.0
Билд
8308
Metamod
v1.21p37
Meta модули
Код:
Currently running plugins:
[ 1] SafeNameAndChat, v1.1, 2017.02.01, by WPMG.PRoSToC0der, see http://snac.wpmg.ru/
[ 2] Reunion, v0.1.0.92, 2018-02-11, by The Legion, see
[ 3] ReAuthCheck, v0.1.6, 2017-03-08, by Adidasman, see Dedicated-Server.RU
[ 4] VoiceTranscoder, v2017RC3, 2017.02.12, by WPMG.PRoSToC0der, see http://vtc.wpmg.ru/
[ 5] AMX Mod X, v1.9.0.5249, Dec 18 2018, by AMX Mod X Dev Team, see AMX Mod X - Half-Life Scripting for Pros!
[ 6] Rechecker, v2.5, Oct 21 2017, by s1lent, see Dedicated-Server.RU
[ 7] WHBlocker, v1.5.696, 2018-11-04, by s1lent, see Серверы Half-Life 1 и Adrenaline Gamer, форум, статьи, трюки от профессионалов || Half-Life 1 & Adrenaline Gamer servers, forum, articles, game tricks from experts
[ 8] ReSemiclip, v2.3.9, 13/02/17, by s1lent & Adidasman, see Dedicated-Server.RU
[ 9] CStrike, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see AMX Mod X - Half-Life Scripting for Pros!
[ 10] CSX, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see AMX Mod X - Half-Life Scripting for Pros!
[ 11] MySQL, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see AMX Mod X - Half-Life Scripting for Pros!
[ 12] SQLite, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see AMX Mod X - Half-Life Scripting for Pros!
[ 13] Engine, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see AMX Mod X - Half-Life Scripting for Pros!
[ 14] ReAPI, v5.10.0.186-dev, 2019-08-29, by Asmodai & s1lent, see s1lentq/reapi
[ 15] ReAimDetector, v0.2.2, 2018-02-06, by ReHLDS Team, see Dedicated-Server.RU
[ 16] SxGeo, v2.2, May 13 2018, by s1lent, see s1lentq/sxgeo
[ 17] FakeMeta, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see AMX Mod X - Half-Life Scripting for Pros!
[ 18] Ham Sandwich, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see AMX Mod X - Half-Life Scripting for Pros!
[ 19] Fun, v1.9.0.5249, Sep 10 2018, by AMX Mod X Dev Team, see AMX Mod X - Half-Life Scripting for Pros!
19 plugins
Плагины
Код:
FreshBans 1.4.0b kanagava fresh_bans_1.4. running
Admin Base 1.9.0.5249 AMXX Dev Team admin.amxx running
Gag Me 2.3.4 Radius gag_me.amxx running
New Kick Menu 1.4.2 Radius newkickmenu.amx running
Admin Commands 1.9.0.5249 AMXX Dev Team admincmd.amxx running
Players Menu 1.7 neugomon players_menu.am running
Maps Menu 1.9.0.5249 AMXX Dev Team mapsmenu.amxx running
c4 timer 1.1 cheap_suit c4timer.amxx running
Stats Configurati 1.9.0.5249 AMXX Dev Team statscfg.amxx running
Say Me & Hp 1.0 Hypa_[KZ] say_me_and_hp.a running
Nice Killer 1.7 Got Milk? / HoHo nice_killer.amx running
Show Damage 1.0 neygomon damager.amxx running
Anti Flood 1.9.0.5249 AMXX Dev Team antiflood.amxx running
[#] CS:GO Main Mo 1.1 [FIX] x FR3NZYMOV x csgo_main_mode. running
[CS:GO MOD] BuyMe 2.0 Danakt Frost csgo_buymenu.am running
[CS:GO MOD] Kill 0.9 Spection csgo_killassist running
[CS:GO MOD] Team 1.0 neygomon csgo_teambalanc running
[CS:GO MOD] Fix S 1.0 xPaw, Justick csgo_fix_smoke. running
[CS:GO MOD] Drop 0.14 Avalanche csgo_dropgrenad running
[CS:GO MOD] BuyMe 0.2 Danakt Frost csgo_buyweapons running
[CS:GO MOD] Assau 1.6 hellmonja csgo_assault_sc running
[CS:GO MOD] Short 1.0 EFFx, HamletEagl csgo_throw_nade running
[CS:GO MOD] Weapo 1.2 ConnorMcLeod csgo_weapons.am running
[CS:GO MOD] Custo 1.3.2 neugomon csgo_players.am running
[CS:GO MOD] Ranks 1.0 kikizon / x FR3N csgo_ranks_syst running
[CS:GO MOD] Advan 1.4.1 neygomon csgo_gagmenu.am running
AK-47 | Asiimov 1.0.0 Vaqtincha AK47_Asiimov.am running
AK-47 | Fire Serp 1.0.0 Vaqtincha AK47_FireSerpen running
AK-47 | Blood Spo 1.0.0 Vaqtincha AK47_BloodSport running
AK-47 | Neon Revo 1.0.0 Vaqtincha AK47_NeonRevolu running
AWP | Medusa 1.0.0 Vaqtincha AWP_Medusa.amxx running
AWP | Neo-Noir 1.0.0 Vaqtincha AWP_NeoNoir.amx running
AWP | Fever Dream 1.0.0 Vaqtincha AWP_FeverDream. running
AWP | Dragon Lore 1.0.0 Vaqtincha AWP_DragonLore. running
Deagle | Blaze 1.0.0 Vaqtincha Deagle_Blaze.am running
Deagle | Code Red 1.0.0 Vaqtincha Deagle_CodeRed. running
Deagle | Crimson 1.0.0 Vaqtincha Deagle_Crimson. running
Deagle | Kumicho 1.0.0 Vaqtincha Deagle_Dragon.a running
M4A1 | Nightmare 1.0.0 Vaqtincha M4A1_Nightmare. running
M4A1 | Chantico F 1.0.0 Vaqtincha M4A1_ChanticoFi running
M4A1 | Hyper Beas 1.0.0 Vaqtincha M4A1_HyperBeast running
M4A1 | Decimator 1.0.0 Vaqtincha M4A1_Decimator. running
USP | Orion 1.0.0 Vaqtincha USP_Orion.amxx running
USP | Cortex 1.0.0 Vaqtincha USP_Cortex.amxx running
USP | Neo-Noir 1.0.0 Vaqtincha USP_NeoNoir.amx running
USP | Kill Confir 1.0.0 Vaqtincha USP_KillConfirm running
Glock-18 | Fade 1.0.0 Vaqtincha Glock18_Fade.am running
Glock-18 | Water 1.0.0 Vaqtincha Glock18_Water.a running
Glock-18 | Moonri 1.0.0 Vaqtincha Glock18_Moonris running
Glock-18 | Wastel 1.0.0 Vaqtincha Glock18_Wastela running
V.I.P Custom KNIF 1.0.0 Vaqtincha custom_knife.am running
V.I.P Custom DEAG 1.0.0 Vaqtincha custom_deagle.a running
V.I.P Custom M4A1 1.0.0 Vaqtincha custom_m4a1.amx running
V.I.P Custom AK-4 1.0.0 Vaqtincha custom_ak47.amx running
V.I.P Custom AWP 1.0.0 Vaqtincha custom_awp.amxx running
Всего 55 плагинов, из них 55 запущены
Amxx Модули
Код:
CStrike 1.9.0.5249 AMX Mod X Dev Team running
CSX 1.9.0.5249 AMX Mod X Dev Team running
nVault 1.9.0.5249 AMX Mod X Dev Team running
MySQL 1.9.0.5249 AMX Mod X Dev Team running
SQLite 1.9.0.5249 AMX Mod X Dev Team running
Engine 1.9.0.5249 AMX Mod X Dev Team running
ReAPI 5.10.0.186 Asmodai & s1lent running
Sockets 1.9.0.5249 AMX Mod X Dev Team running
ReAimDetector 0.2.2 ReHLDS Team running
SxGeo 2.2 s1lent running
FakeMeta 1.9.0.5249 AMX Mod X Dev Team running
Ham Sandwich 1.9.0.5249 AMX Mod X Dev Team running
RegEx 1.9.0.5249 AMX Mod X Dev Team running
Fun 1.9.0.5249 AMX Mod X Dev Team running
Всего 14 модулей
Ошибка
Код:
Server shutdown
L 04/05/2020 - 12:53:09: Log file closed
L 04/05/2020 - 12:53:09: [META] (debug:3) Calling cs.so:Sys_Error()
L 04/05/2020 - 12:53:09: FATAL ERROR (shutting down): Host_Error: PF_setmodel_I: no precache: models/w_backpack.mdl[/CODE]
[/SPOILER]
Когда меня карту,то периодически спустя n-ое время сервер падает с ошибкой
Код:
L 04/05/2020 - 12:53:09: Server shutdown
L 04/05/2020 - 12:53:09: Log file closed
L 04/05/2020 - 12:53:09: [META] (debug:3) Calling cs.so:Sys_Error()
L 04/05/2020 - 12:53:09: FATAL ERROR (shutting down): Host_Error: PF_setmodel_I: no precache: models/w_backpack.mdl
Пробовал отключать плагины по очереди,но без полезно!(буду честен,отключал не все,отключал только те которые писали на форумах) Не могу понять что такое?!
 

perfectblood0

Команда форума
Администратор
Регистрация
29 Окт 2017
Сообщения
2.578
Симпатии
914
Пол
Женский
Какой то плагин использует модель, которой нет
 

Top4ik

Пользователь
Регистрация
10 Фев 2020
Сообщения
54
Симпатии
4
Какой то плагин использует модель, которой нет
Да я тоже читал,я тоже встречал такой вариант,но не могу понять что это за плагин,ведь как я понимаю модель
это что то связанно с рюкзаком или что то в этом роде,но такого плагина у меня нету,не могу понять
 

perfectblood0

Команда форума
Администратор
Регистрация
29 Окт 2017
Сообщения
2.578
Симпатии
914
Пол
Женский
Csgomod скорее всего
 

Top4ik

Пользователь
Регистрация
10 Фев 2020
Сообщения
54
Симпатии
4
Csgomod скорее всего
Вот исходник,там не нашел "строчки с w_bacpack.mdl"
Код:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <engine>
#include <colorchat>
#include <hamsandwich>
#include <fakemeta_util>

#pragma tabsize 0

#define DEMONAME    "Public_CS_GO"

#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))
#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)

#define ADVERT_ALL        // Показывать всем. Для показа только мервым и спектаторам закомментируйте
#define REPEAT_TIME 20.0    // Время между сообщениями

new adMessages[256][192];
new ad_count, iMessgCount;

new bool:g_bAllowRecord[33];

const XoWeapon             = 4;
const XoPlayer                 = 5;
const m_pPlayer         = 41;
const m_flNextPrimaryAttack    = 46;
const m_flTimeWeaponIdle    = 48;
const m_fInSpecialReload     = 55;
const m_flNextAttack         = 83;
const m_pActiveItem         = 373;
const m_iId         = 43;

new const wpns_without_inspect = (1 << CSW_C4) | (1 << CSW_HEGRENADE) | (1 << CSW_FLASHBANG) | (1 << CSW_SMOKEGRENADE);
new const wpns_scoped = (1 << CSW_AUG) | (1 << CSW_AWP) | (1 << CSW_G3SG1) | (1 << CSW_SCOUT) | (1 << CSW_SG550) | (1 << CSW_SG552);

new Float:g_flOrigin[3], Float:g_flAngles[3], g_fwdSetModel

new g_deagle_overide[33];

new inspect_anim[] =
{
    0,    //null
    7,    //p228
    0,    //shield
    5,    //scout
    0,    //hegrenade
    7,    //xm1014
    0,    //c4
    6,    //mac10
    6,    //aug
    0,    //smoke grenade
    16,    //elites
    6,    //fiveseven
    6,    //ump45
    5,    //sg550
    6,    //galil
    6,    //famas
    16,    //usp
    13,    //glock
    6,    //awp
    6,    //mp5
    5,    //m249
    7,    //m3
    15,    //m4a1
    6,    //tmp
    6,    //g3sg1
    0,    //flashbang
    6,    //deagle
    6,    //sg552
    6,    //ak47
    8,    //knife
    6    //p90
}

new Float:idle_calltime[] =
{
    0.0,    //null
    6.5,    //p228
    0.0,    //shield
    5.3,    //scout
    0.0,    //hegrenade
    4.6,    //xm1014
    0.0,    //c4
    5.3,    //mac10
    4.4,    //aug
    0.0,    //smoke grenade
    4.6,    //elites
    6.5,    //fiveseven
    6.9,    //ump45
    5.3,    //sg550
    4.6,    //galil
    6.4,    //famas
    6.5,    //usp
    6.5,    //glock
    5.0,    //awp
    7.7,    //mp5
    6.9,    //m249
    5.6,    //m3
    5.1,    //m4a1
    7.4,    //tmp
    4.5,    //g3sg1
    0.0,    //flashbang
    5.7,    //deagle
    4.4,    //sg552
    4.6,    //ak47
    6.3,    //knife
    5.4    //p90
}
new weapon_classnames[][] =
{
    "weapon_p228",
    "weapon_elite",
    "weapon_fiveseven",
    "weapon_usp",
    "weapon_glock18",
    "weapon_deagle",
    "weapon_ak47",
    "weapon_m4a1",
    "weapon_awp",
    "weapon_mp5navy",
    "weapon_ump45",
    "weapon_galil",
    "weapon_famas",
    "weapon_sg552",
    "weapon_aug",
    "weapon_mac10",
    "weapon_tmp",
    "weapon_scout",
    "weapon_m3",
    "weapon_xm1014",
    "weapon_g3sg1",
    "weapon_sg550",
    "weapon_m249",
    "weapon_knife",
    "weapon_p90"
    
}

new keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
new KnifeId[33];

new Trie:g_tReplaceInfoMsg;

new KNIFE_V_MODEL1[] = "models/csgo/skins/knife/v_bayonet.mdl"
new KNIFE_V_MODEL2[] = "models/csgo/skins/knife/v_falchion.mdl"
new KNIFE_V_MODEL3[] = "models/csgo/skins/knife/v_gut.mdl"
new KNIFE_V_MODEL4[] = "models/csgo/skins/knife/v_karambit.mdl"
new KNIFE_V_MODEL5[] = "models/csgo/skins/knife/v_m9bayonet.mdl"
new KNIFE_V_MODEL6[] = "models/csgo/skins/knife/v_butterfly.mdl"
new KNIFE_V_MODEL7[] = "models/csgo/skins/knife/v_stiletto.mdl"
new KNIFE_V_MODEL8[] = "models/csgo/skins/knife/v_knives_ct.mdl"
new KNIFE_V_MODEL9[] = "models/csgo/skins/knife/v_knives_t.mdl"

new KNIFE_P_MODEL1[] = "models/csgo/skins/knife/p_bayonet.mdl"
new KNIFE_P_MODEL2[] = "models/csgo/skins/knife/p_falchion.mdl"
new KNIFE_P_MODEL3[] = "models/csgo/skins/knife/p_gut.mdl"
new KNIFE_P_MODEL4[] = "models/csgo/skins/knife/p_karambit.mdl"
new KNIFE_P_MODEL5[] = "models/csgo/skins/knife/p_m9bayonet.mdl"
new KNIFE_P_MODEL6[] = "models/csgo/skins/knife/p_butterfly.mdl"
new KNIFE_P_MODEL7[] = "models/csgo/skins/knife/p_stiletto.mdl"
new KNIFE_P_MODEL8[] = "models/csgo/skins/knife/p_knives_ct.mdl"
new KNIFE_P_MODEL9[] = "models/csgo/skins/knife/p_knives_t.mdl"

new W_BOMB_MODEL[] = "models/csgo/default/w_c4.mdl"

new g_Sounds[][] =
{
    // ak47 sounds
    "sound/weapons/csgo_mod/ak47/boltpull.wav",
    "sound/weapons/csgo_mod/ak47/clipin.wav",
    "sound/weapons/csgo_mod/ak47/clipout.wav",
    "sound/weapons/csgo_mod/ak47/draw.wav",
    
    // aug sounds
    "sound/weapons/csgo_mod/aug/boltpull.wav",
    "sound/weapons/csgo_mod/aug/boltrelease.wav",
    "sound/weapons/csgo_mod/aug/clipin.wav",
    "sound/weapons/csgo_mod/aug/clipout.wav",
    "sound/weapons/csgo_mod/aug/cliptap.wav",
    "sound/weapons/csgo_mod/aug/draw.wav",
    
    // awp sounds
    "sound/weapons/csgo_mod/awp/boltdown.wav",
    "sound/weapons/csgo_mod/awp/boltup.wav",
    "sound/weapons/csgo_mod/awp/clipin.wav",
    "sound/weapons/csgo_mod/awp/clipout.wav",
    "sound/weapons/csgo_mod/awp/cliptap.wav",
    "sound/weapons/csgo_mod/awp/draw.wav",
    
    // beretta sounds
    "sound/weapons/csgo_mod/berettas/slide.wav",
    "sound/weapons/csgo_mod/berettas/taunt_tap.wav",
    "sound/weapons/csgo_mod/berettas/clipin.wav",
    "sound/weapons/csgo_mod/berettas/clipout.wav",
    "sound/weapons/csgo_mod/berettas/hammer.wav",
    "sound/weapons/csgo_mod/berettas/draw.wav",
    
    // butterfly sounds
    "sound/weapons/csgo_mod/butterfly/backstab.wav",
    "sound/weapons/csgo_mod/butterfly/deploy_end.wav",
    "sound/weapons/csgo_mod/butterfly/deploy_start.wav",
    "sound/weapons/csgo_mod/butterfly/inspect_end.wav",
    "sound/weapons/csgo_mod/butterfly/inspect_flip1.wav",
    "sound/weapons/csgo_mod/butterfly/inspect_flip2.wav",
    "sound/weapons/csgo_mod/butterfly/inspect_flip3.wav",
    "sound/weapons/csgo_mod/butterfly/inspect_start.wav",
    
    // c4 bomb sounds
    "sound/weapons/csgo_mod/c4/disarmfinish.wav",
    "sound/weapons/csgo_mod/c4/disarmstart.wav",
    "sound/weapons/csgo_mod/c4/draw.wav",
    "sound/weapons/csgo_mod/c4/initiate.wav",
    "sound/weapons/csgo_mod/c4/plant_quiet.wav",
    "sound/weapons/csgo_mod/c4/press1.wav",
    "sound/weapons/csgo_mod/c4/press2.wav",
    "sound/weapons/csgo_mod/c4/press3.wav",
    "sound/weapons/csgo_mod/c4/press4.wav",
    "sound/weapons/csgo_mod/c4/press5.wav",
    "sound/weapons/csgo_mod/c4/press6.wav",
    "sound/weapons/csgo_mod/c4/press7.wav",
    
    // deagle sounds
    "sound/weapons/csgo_mod/deagle/slideback.wav",
    "sound/weapons/csgo_mod/deagle/slideforward.wav",
    "sound/weapons/csgo_mod/deagle/clipin.wav",
    "sound/weapons/csgo_mod/deagle/clipout.wav",
    "sound/weapons/csgo_mod/deagle/inspect_roll.wav",
    "sound/weapons/csgo_mod/deagle/draw.wav",
    
    // falchion sounds
    "sound/weapons/csgo_mod/falchion/catch.wav",
    "sound/weapons/csgo_mod/falchion/deploy_end.wav",
    "sound/weapons/csgo_mod/falchion/deploy_start.wav",
    "sound/weapons/csgo_mod/falchion/inspect_end.wav",
    "sound/weapons/csgo_mod/falchion/inspect_start.wav",
    
    // famas sounds
    "sound/weapons/csgo_mod/famas/boltback.wav",
    "sound/weapons/csgo_mod/famas/boltforward.wav",
    "sound/weapons/csgo_mod/famas/cliphit.wav",
    "sound/weapons/csgo_mod/famas/clipin.wav",
    "sound/weapons/csgo_mod/famas/clipout.wav",
    "sound/weapons/csgo_mod/famas/draw.wav",
    
    // fiveseven sounds
    "sound/weapons/csgo_mod/fiveseven/slideback.wav",
    "sound/weapons/csgo_mod/fiveseven/sliderelease.wav",
    "sound/weapons/csgo_mod/fiveseven/clipin.wav",
    "sound/weapons/csgo_mod/fiveseven/clipout.wav",
    "sound/weapons/csgo_mod/fiveseven/draw.wav",
    
    // g3sg1 sounds
    "sound/weapons/csgo_mod/g3sg1/slideback.wav",
    "sound/weapons/csgo_mod/g3sg1/slideforward.wav",
    "sound/weapons/csgo_mod/g3sg1/clipin.wav",
    "sound/weapons/csgo_mod/g3sg1/clipout.wav",
    "sound/weapons/csgo_mod/g3sg1/draw.wav",
    
    // galil sounds
    "sound/weapons/csgo_mod/galil/boltback.wav",
    "sound/weapons/csgo_mod/galil/boltrelease.wav",
    "sound/weapons/csgo_mod/galil/clipin.wav",
    "sound/weapons/csgo_mod/galil/clipout.wav",
    "sound/weapons/csgo_mod/galil/draw.wav",
    
    // glock18 sounds
    "sound/weapons/csgo_mod/glock18/slideback.wav",
    "sound/weapons/csgo_mod/glock18/sliderelease.wav",
    "sound/weapons/csgo_mod/glock18/clipin.wav",
    "sound/weapons/csgo_mod/glock18/clipout.wav",
    "sound/weapons/csgo_mod/glock18/draw.wav",
    
    // grenades sounds
    "sound/weapons/csgo_mod/grenades/draw.wav",
    "sound/weapons/csgo_mod/grenades/pinpull.wav",
    "sound/weapons/csgo_mod/grenades/throw.wav",
    
    // knife sounds
    "sound/weapons/csgo_mod/knife/deploy.wav",
    
    // m4a1-s sounds
    "sound/weapons/csgo_mod/m4a1s/boltback.wav",
    "sound/weapons/csgo_mod/m4a1s/boltforward.wav",
    "sound/weapons/csgo_mod/m4a1s/boltpull.wav",
    "sound/weapons/csgo_mod/m4a1s/clipin.wav",
    "sound/weapons/csgo_mod/m4a1s/clipout.wav",
    "sound/weapons/csgo_mod/m4a1s/m4a1_deploy.wav",
    "sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_1.wav",
    "sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_2.wav",
    "sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_3.wav",
    "sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_4.wav",
    "sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_5.wav",
    "sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_off_end.wav",
    "sound/weapons/csgo_mod/m4a1s/m4a1_silencer_screw_on_start.wav",
    
    // mac-10 sounds
    "sound/weapons/csgo_mod/mac10/boltback.wav",
    "sound/weapons/csgo_mod/mac10/boltforward.wav",
    "sound/weapons/csgo_mod/mac10/clipin.wav",
    "sound/weapons/csgo_mod/mac10/clipout.wav",
    "sound/weapons/csgo_mod/mac10/draw.wav",
    
    // mp5sd sounds
    "sound/weapons/csgo_mod/mp5/slideback.wav",
    "sound/weapons/csgo_mod/mp5/slideforward.wav",
    "sound/weapons/csgo_mod/mp5/clipin.wav",
    "sound/weapons/csgo_mod/mp5/clipout.wav",
    "sound/weapons/csgo_mod/mp5/draw.wav",
    
    // mp9 sounds
    "sound/weapons/csgo_mod/mp9/slideback.wav",
    "sound/weapons/csgo_mod/mp9/slideforward.wav",
    "sound/weapons/csgo_mod/mp9/clipin.wav",
    "sound/weapons/csgo_mod/mp9/clipout.wav",
    "sound/weapons/csgo_mod/mp9/draw.wav",
    
    // negev sounds
    "sound/weapons/csgo_mod/negev/chain.wav",
    "sound/weapons/csgo_mod/negev/coverup.wav",
    "sound/weapons/csgo_mod/negev/coverdown.wav",
    "sound/weapons/csgo_mod/negev/pump.wav",
    "sound/weapons/csgo_mod/negev/boxin.wav",
    "sound/weapons/csgo_mod/negev/boxout.wav",
    "sound/weapons/csgo_mod/negev/draw.wav",
    
    // nova sounds
    "sound/weapons/csgo_mod/nova/bolt.wav",
    "sound/weapons/csgo_mod/nova/draw.wav",
    "sound/weapons/csgo_mod/nova/insert.wav",
    
    // p90 sounds
    "sound/weapons/csgo_mod/p90/boltback.wav",
    "sound/weapons/csgo_mod/p90/boltrelease.wav",
    "sound/weapons/csgo_mod/p90/clipin.wav",
    "sound/weapons/csgo_mod/p90/clipout.wav",
    "sound/weapons/csgo_mod/p90/tap.wav",
    
    // p250 sounds
    "sound/weapons/csgo_mod/p250/slideback.wav",
    "sound/weapons/csgo_mod/p250/sliderelease.wav",
    "sound/weapons/csgo_mod/p250/clipin.wav",
    "sound/weapons/csgo_mod/p250/clipout.wav",
    "sound/weapons/csgo_mod/p250/draw.wav",
    
    // scar-20 sounds
    "sound/weapons/csgo_mod/scar20/boltback.wav",
    "sound/weapons/csgo_mod/scar20/boltforward.wav",
    "sound/weapons/csgo_mod/scar20/clipin.wav",
    "sound/weapons/csgo_mod/scar20/clipout.wav",
    
    // sg553 sounds
    "sound/weapons/csgo_mod/sg553/pull.wav",
    "sound/weapons/csgo_mod/sg553/release.wav",
    "sound/weapons/csgo_mod/sg553/clipin.wav",
    "sound/weapons/csgo_mod/sg553/clipout.wav",
    "sound/weapons/csgo_mod/sg553/draw.wav",
    
    // stiletto sounds
    "sound/weapons/csgo_mod/stiletto/deploy.wav",
    "sound/weapons/csgo_mod/stiletto/flip_1.wav",
    "sound/weapons/csgo_mod/stiletto/flip_2.wav",
    "sound/weapons/csgo_mod/stiletto/flip_3.wav",
    "sound/weapons/csgo_mod/stiletto/flip_4.wav",
    
    // ssg-08 sounds
    "sound/weapons/csgo_mod/ssg08/boltback.wav",
    "sound/weapons/csgo_mod/ssg08/boltrelease.wav",
    "sound/weapons/csgo_mod/ssg08/clipin.wav",
    "sound/weapons/csgo_mod/ssg08/clipout.wav",
    "sound/weapons/csgo_mod/ssg08/cliptap.wav",
    "sound/weapons/csgo_mod/ssg08/draw.wav",
    
    // ump45 sounds
    "sound/weapons/csgo_mod/ump45/boltslap.wav",
    "sound/weapons/csgo_mod/ump45/boltrelease.wav",
    "sound/weapons/csgo_mod/ump45/clipin.wav",
    "sound/weapons/csgo_mod/ump45/clipout.wav",
    "sound/weapons/csgo_mod/ump45/draw.wav",
    
    // usp sounds
    "sound/weapons/csgo_mod/usp/clipin.wav",
    "sound/weapons/csgo_mod/usp/clipout.wav",
    "sound/weapons/csgo_mod/usp/draw.wav",
    "sound/weapons/csgo_mod/usp/draw_slide.wav",
    "sound/weapons/csgo_mod/usp/silencer_screw1.wav",
    "sound/weapons/csgo_mod/usp/silencer_screw2.wav",
    "sound/weapons/csgo_mod/usp/silencer_screw3.wav",
    "sound/weapons/csgo_mod/usp/silencer_screw4.wav",
    "sound/weapons/csgo_mod/usp/silencer_screw5.wav",
    "sound/weapons/csgo_mod/usp/silencer_screw_off_end.wav",
    "sound/weapons/csgo_mod/usp/silencer_screw_on_start.wav",
    
    // xm1014 sounds
    "sound/weapons/csgo_mod/xm1014/draw.wav",
    "sound/weapons/csgo_mod/xm1014/insert.wav",
    "sound/weapons/csgo_mod/xm1014/movement1.wav"
}

public plugin_init()
{
    register_plugin("[#] CS:GO Main Mode", "1.1 [FIX]", "x FR3NZYMOV x");
    
    // server menu client commands
    register_clcmd("say /menu", "ClCmd_ServerMenu");
    register_clcmd("say_team /menu", "ClCmd_ServerMenu");
    register_clcmd("menu", "ClCmd_ServerMenu");
    register_clcmd("/menu", "ClCmd_ServerMenu");
    register_clcmd("chooseteam", "ClCmd_ServerMenu");
    
    // reset score client commands
    register_clcmd("say /rs", "ClCmd_ResetScore");
    register_clcmd("say /resetscore", "ClCmd_ResetScore");
    register_clcmd("say_team /rs", "ClCmd_ResetScore");
    register_clcmd("say_team /resetscore", "ClCmd_ResetScore");
    
    // price motd client commands
    register_clcmd("say /price","ClCmd_PriceMotd");
    register_clcmd("say_team /price","ClCmd_PriceMotd");
    
    // demo record client commands
    register_clcmd("joinclass", "ClCmd_StartDemo");
    register_clcmd("menuselect", "ClCmd_StartDemo");
    
    // hook radio menu's
    register_clcmd("radio1", "ClCmd_HookRadio");
    register_clcmd("radio2", "ClCmd_HookRadio");
    register_clcmd("radio3", "ClCmd_HookRadio");
    
    // hook spray button
    register_impulse(201, "Impulse_HookSpray");
    
    // task for adverts in chat
    set_task(REPEAT_TIME, "Msg_AdvertChat", .flags="b");

    // handles for menus
    register_menucmd(register_menuid("Show_KnifeMenu"), keys, "Handle_KnifeMenu");
    register_menucmd(register_menuid("Show_ServerMenu"), keys, "Handle_ServerMenu");
    register_menucmd(register_menuid("Show_PlayerMenu"), keys, "Handle_PlayerMenu");
    register_menucmd(register_menuid("Show_ShopMenu"), keys, "Handle_ShopMenu");
    register_menucmd(register_menuid("Show_AdminMenu"), keys, "Handle_AdminMenu");
    register_menucmd(register_menuid("Show_EliteMenu"), keys, "Handle_EliteMenu");
    register_menucmd(register_menuid("Show_StyleMenu"), keys, "Handle_StyleMenu");
    register_menucmd(register_menuid("Show_MafiozeMenu"), keys, "Handle_MafiozeMenu");
    register_menucmd(register_menuid("Show_BackroomMenu"), keys, "Handle_BackroomMenu");
    register_menucmd(register_menuid("Show_BackroomMenu"), keys, "Handle_BackroomMenu");
    
    register_event("CurWeapon", "give_item1", "be", "1=1");
    register_event("CurWeapon", "give_item2", "be", "1=1");
    register_event("CurWeapon", "give_item3", "be", "1=1");
    register_event("CurWeapon", "give_item4", "be", "1=1");
    register_event("CurWeapon", "give_item5", "be", "1=1");
    register_event("CurWeapon", "give_item6", "be", "1=1");
    register_event("CurWeapon", "give_item7", "be", "1=1");
    register_event("CurWeapon", "give_item8", "be", "1=1");

    // impulse for inspect weapon (button F)
    register_impulse(100, "Inspect_Weapon");
    
    for(new i = 0; i < sizeof weapon_classnames; i++)
    RegisterHam(Ham_Weapon_PrimaryAttack, weapon_classnames[i], "Fw_Weapon_PrimaryAttack", 1);

    // two anim inspect's for deagle
    RegisterHam(Ham_Item_Deploy, "weapon_deagle", "Fw_Deagle_Disable");
    RegisterHam(Ham_Weapon_Reload, "weapon_deagle", "Fw_Deagle_Disable");
    
    // not inspect weapons on scope
    RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_aug", "Fw_Weapon_SecondaryAttack");
    RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_awp", "Fw_Weapon_SecondaryAttack");
    RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_g3sg1", "Fw_Weapon_SecondaryAttack");
    RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_scout", "Fw_Weapon_SecondaryAttack");
    RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_sg550", "Fw_Weapon_SecondaryAttack");
    RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_sg552", "Fw_Weapon_SecondaryAttack");
    
    // detecting map with bomb
    if(fm_find_ent_by_class(FM_NULLENT, "info_bomb_target") || fm_find_ent_by_class(FM_NULLENT, "func_bomb_target"))
    {
    // event planting/defusing bomb
    register_event("BarTime", "Event_PlantBomb", "be", "1=3")
    register_event("BarTime", "Event_DefuseBomb", "be", "1=5", "1=10")

    // log event planting/defusing bomb
    register_logevent("LogEvent_RoundEnd",2,"1=Round_End")
    register_logevent("LogEvent_PlantBomb",3,"2=Defused_The_Bomb")
    register_logevent("LogEvent_DefuseBomb",3,"2=Planted_The_Bomb")
    }
    
    // replace message
    register_message(get_user_msgid("TextMsg"), "Msg_MessageText");
    
    g_tReplaceInfoMsg = TrieCreate();
    Msg_ReplaceMessage();
}

public plugin_precache()
{
    // precache knife v_ models
    precache_model(KNIFE_V_MODEL1)
    precache_model(KNIFE_V_MODEL2)
    precache_model(KNIFE_V_MODEL3)
    precache_model(KNIFE_V_MODEL4)
    precache_model(KNIFE_V_MODEL5)
    precache_model(KNIFE_V_MODEL6)
    precache_model(KNIFE_V_MODEL7)
    precache_model(KNIFE_V_MODEL8)
    precache_model(KNIFE_V_MODEL9)
    
    // precache knife p_ models
    precache_model(KNIFE_P_MODEL1)
    precache_model(KNIFE_P_MODEL2)
    precache_model(KNIFE_P_MODEL3)
    precache_model(KNIFE_P_MODEL4)
    precache_model(KNIFE_P_MODEL5)
    precache_model(KNIFE_P_MODEL6)
    precache_model(KNIFE_P_MODEL7)
    precache_model(KNIFE_P_MODEL8)
    precache_model(KNIFE_P_MODEL9)
    
    // precache c4 model
    precache_model(W_BOMB_MODEL)
    
    // precache sounds
    for(new i; i < sizeof(g_Sounds); i++)
    {
        precache_generic(g_Sounds[i]);
    }
}
public plugin_cfg()
{
    new configsdir[64], filename[64], file;
    get_localinfo("amxx_configsdir", configsdir,charsmax(configsdir));
    formatex(filename, charsmax(filename), "%s/csgo/csgo_adverts.ini",configsdir);

    file = fopen(filename,"r");

    if(file)
    {
        new string[512], message[192];
        while((ad_count < 256) && !feof(file))
        {
            fgets(file, string, charsmax(string));

            if((string[0] != ';') && (string[0] != '/') && parse(string, message, charsmax(message)))
            {
                format_color(message, charsmax(message));
                copy(adMessages[ad_count], 192, message);
                ad_count++;
            }
        }
        fclose(file);
    }
    else
        log_amx("* Файла ^"%s^" не существует *", filename);
}

public ClCmd_HookRadio(id)
{
    client_print(id, print_center, "* Радио сообщения недоступны *")
    return PLUGIN_HANDLED;
}

public Impulse_HookSpray(id)
{
    client_print(id, print_center, "* Рисование спрея недоступно *")
    return PLUGIN_HANDLED;
}

public Msg_AdvertChat()
{   
    if(!ad_count) return;
#if defined ADVERT_ALL
    client_print_color(0, 0, "%s", adMessages[iMessgCount == ad_count ? (iMessgCount = 0) : iMessgCount++]);
#else
    static players[32], pcount;
    get_players(players, pcount, "bch");
    for(new i; i < pcount; i++)
    {
        client_print_color(players[i], 0, "%s", adMessages[iMessgCount == ad_count ? (iMessgCount = 0) : iMessgCount++]);
    }
#endif   
}

public client_putinserver(id)
{
    // if player connected
    KnifeId[id] = 8
}

public ClCmd_StartDemo(id)
{
    // start rec demo
    if(g_bAllowRecord[id])
    {
        Msg_StartDemo(id);
        g_bAllowRecord[id] = false;
    }
}
public Msg_StartDemo(id)
{
    // chat message of rec demo
    if(!is_user_connected(id))
    return;
        
    client_cmd(id, "stop; record ^"%s^"", DEMONAME);   
    new datee[30];get_time("%d.%m.%Y | %H:%M:%S", datee, charsmax(datee));
    SendMsg(id, "* Идет запись демо %s.dem *", DEMONAME);
    SendMsg(id, "* Время записи: ^4%s^1 *", datee);
}
public Msg_ReplaceMessage()
{
    // replace messages
    TrieSetString(g_tReplaceInfoMsg, "#Game_Commencing",                    "* Игра началась *");
    TrieSetString(g_tReplaceInfoMsg, "#Game_will_restart_in",                "* Рестарт игры произойдет через %s секунд *");
    TrieSetString(g_tReplaceInfoMsg, "#CTs_Win",                        "* Контр-Террористы победили *");
    TrieSetString(g_tReplaceInfoMsg, "#Terrorists_Win",                    "* Террористы победили *");
    TrieSetString(g_tReplaceInfoMsg, "#Round_Draw",                        "* Раунд закончился вничью *");
    TrieSetString(g_tReplaceInfoMsg, "#Target_Bombed",                    "* Цель уничтожена *");
    TrieSetString(g_tReplaceInfoMsg, "#Target_Saved",                    "* Цель спасена *");
    TrieSetString(g_tReplaceInfoMsg, "#Hostages_Not_Rescued",                "* Не удалось спасти заложников *");
    TrieSetString(g_tReplaceInfoMsg, "#All_Hostages_Rescued",                "* Все заложники спасены *");
    TrieSetString(g_tReplaceInfoMsg, "#VIP_Escaped",                    "* VIP-игрок спасен *");
    TrieSetString(g_tReplaceInfoMsg, "#VIP_Assassinated",                    "* VIP-игрок убит *");
    TrieSetString(g_tReplaceInfoMsg, "#C4_Arming_Cancelled",                "* Бомба может быть установлена только в зоне установки бомбы *");
    TrieSetString(g_tReplaceInfoMsg, "#C4_Plant_Must_Be_On_Ground",                "* Для установки бобмы Вы должны находиться на земле *");
    TrieSetString(g_tReplaceInfoMsg, "#Defusing_Bomb_With_Defuse_Kit",            "* Обезвреживание бомбы с набором сапёра *");
    TrieSetString(g_tReplaceInfoMsg, "#Defusing_Bomb_Without_Defuse_Kit",            "* Обезвреживание бомбы без набора сапёра *");
    TrieSetString(g_tReplaceInfoMsg, "#Weapon_Cannot_Be_Dropped",                "* Нельзя выбросить данное оружие *");
    TrieSetString(g_tReplaceInfoMsg, "#C4_Plant_At_Bomb_Spot",                "* Бомба может быть установлена только в зоне установки бомбы *");
    TrieSetString(g_tReplaceInfoMsg, "#Cannot_Carry_Anymore",                "* Вы не можете взять больше *");
    TrieSetString(g_tReplaceInfoMsg, "#Already_Have_Kevlar",                "* У вас уже имеется бронежилет *");
    TrieSetString(g_tReplaceInfoMsg, "#Already_Have_Kevlar_Helmet",                "* У вас уже имеется бронежилет и шлем *");
    TrieSetString(g_tReplaceInfoMsg, "#Switch_To_BurstFire",                "* Переключен в режим пулеметного огня *");
    TrieSetString(g_tReplaceInfoMsg, "#Switch_To_FullAuto",                    "* Переключен в автоматический режим *");
    TrieSetString(g_tReplaceInfoMsg, "#Switch_To_SemiAuto",                    "* Переключен в полуавтоматический режим *");
    TrieSetString(g_tReplaceInfoMsg, "#Already_Own_Weapon",                    "* У вас уже имеется данное оружие *");
    TrieSetString(g_tReplaceInfoMsg, "#Command_Not_Available",                "* Данное действие недоступно в Вашем местонахождении *");
    TrieSetString(g_tReplaceInfoMsg, "#Got_bomb",                        "* Вы подобрали бомбу *");
    TrieSetString(g_tReplaceInfoMsg, "#Game_bomb_pickup",                    "* %s подобрал бомбу *");
    TrieSetString(g_tReplaceInfoMsg, "#Game_bomb_drop",                    "* %s выбросил бомбу *");
    TrieSetString(g_tReplaceInfoMsg, "#Bomb_Planted",                    "* Бомба установлена *");
    TrieSetString(g_tReplaceInfoMsg, "#Bomb_Defused",                    "* Бомба обезврежена *");
    TrieSetString(g_tReplaceInfoMsg, "#Cant_buy",                        "* %s секунд уже истекли.^rПокупка арсенала запрещена *");
    TrieSetString(g_tReplaceInfoMsg, "#Name_change_at_respawn",                "* Ваше имя будет изменено после следующего возрождения *");
    TrieSetString(g_tReplaceInfoMsg, "#Auto_Team_Balance_Next_Round",            "* Автоматический баланс команды наступит в следующем раунде *");
}

public Msg_MessageText()
{
    new szMsg[192], szArg3[32];
    get_msg_arg_string(2, szMsg, charsmax(szMsg));
    if(TrieGetString(g_tReplaceInfoMsg, szMsg, szMsg, charsmax(szMsg)))
    {
        if(get_msg_args() > 2)
        {
            get_msg_arg_string(3, szArg3, charsmax(szArg3));
            replace(szMsg, charsmax(szMsg), "%s", szArg3);
        }
        set_msg_arg_string(2, szMsg);
    }
}

public plugin_end()
{
    TrieDestroy(g_tReplaceInfoMsg);
}

public ClCmd_PriceMotd(id,level,cid)
{
    // price motd
    if (!cmd_access(id,level,cid,1))
    return PLUGIN_CONTINUE
    
    show_motd(id,"pricelist.txt","Покупка привилегий")
    return PLUGIN_CONTINUE   
}

public ClCmd_ResetScore(id)
{
    // reset score
    cs_set_user_deaths(id, 0)
    set_user_frags(id, 0)
    cs_set_user_deaths(id, 0)
    set_user_frags(id, 0)

    // chat message of reseting score
    client_print(id, print_chat, "* Вы обнулили свой счет! *")
    client_cmd(id,"spk buttons/bell1.wav")
}

// unregister fwd (save resourse & CPU)
public LogEvent_RoundEnd()
{
    if(g_fwdSetModel)
        unregister_forward(FM_SetModel, g_fwdSetModel, 0)
}

// register fwd
public Event_PlantBomb()
    g_fwdSetModel = register_forward(FM_SetModel, "fw_SetModel", 0)

// fix bomb angles by voed
public LogEvent_PlantBomb()
{
    new id = get_loguser_index()
    if(is_user_connected(id)) // fix error logs
    {
        new Float:flAngles[3], ent
        pev(id, pev_v_angle, flAngles)

        ent = fm_find_ent_by_model(FM_NULLENT, "grenade", W_BOMB_MODEL)
        if(pev_valid(ent))
        {
            flAngles[0]=0.0
            flAngles[1]+=90.0
            set_pev(ent, pev_angles, flAngles)
        }
    }
}

// find bomb save angles/origin
public Event_DefuseBomb()
{
    new ent = fm_find_ent_by_model(FM_NULLENT, "grenade", W_BOMB_MODEL)
    if(pev_valid(ent))
    {
        pev(ent, pev_origin, g_flOrigin)
        pev(ent, pev_angles, g_flAngles)
    }
}

// create bomb
public LogEvent_DefuseBomb()
{
    new ent = fm_create_entity("grenade")
    if(!pev_valid(ent))
        return

    set_pev(ent, pev_origin, g_flOrigin)
    set_pev(ent, pev_angles, g_flAngles)
    dllfunc(DLLFunc_Spawn, ent)

    engfunc(EngFunc_SetModel, ent, W_BOMB_MODEL)
    set_pev(ent, pev_skin, 1) // * spec model
    set_pev(ent, pev_movetype, MOVETYPE_NONE)
    set_pev(ent, pev_solid, SOLID_NOT)
    set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
}
public fw_SetModel(ent, const model[])
{
    if(!pev_valid(ent) || !equal(model, "models/w_c4.mdl"))
        return FMRES_IGNORED

    engfunc(EngFunc_SetModel, ent, W_BOMB_MODEL)
    set_pev(ent, pev_skin, 0)
    return FMRES_SUPERCEDE
}

public ClCmd_ServerMenu(id) return Show_ServerMenu(id);

Show_ServerMenu(id)
{
    // main server menu
    new szMenu[512]
    new iLen = 0
    iLen = format(szMenu[iLen], 511, "\yМеню Сервера^n^n");
    
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w Меню \yигрока^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w Магазин \yскинов^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w Сменить \yкоманду^n^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Топ-15 \yигроков сервера^n");
    if(get_user_flags(id) & ADMIN_RESERVATION)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w Меню \yадминистратора^n^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d Меню администратора^n^n");   
    }
    
    format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход");
    return show_menu(id, keys, szMenu, -1, "Show_ServerMenu");
}

public Handle_ServerMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
    return Show_PlayerMenu(id);
}
case 1:
{
    return Show_ShopMenu(id);
}
case 2:
{
    if(is_user_alive(id))
    {
        client_cmd(id, "jointeam");
        return PLUGIN_HANDLED;
    }
    else
    {
        client_print(id, print_chat, "* Только живые игроки могут менять команду! *");
        client_cmd(id, "spk buttons/blip2.wav");
        return PLUGIN_HANDLED;
    }
}
case 3:
{
    client_cmd(id, "say /top15");
    return PLUGIN_HANDLED;
}
case 4:
{
    if(get_user_flags(id) & ADMIN_RESERVATION)
    {
        return Show_AdminMenu(id);
    }
    else
    {
        client_print(id, print_chat, "* Только Администратор имеет доступ к меню! *");
        client_cmd(id, "spk buttons/blip2.wav");
        return PLUGIN_HANDLED;
    }
}
case 9:
{
    return PLUGIN_HANDLED;
    }
}
return Show_ServerMenu(id);
}

Show_PlayerMenu(id)
{
    // player menu
    new szMenu[512]
    new iLen = 0
    iLen = format(szMenu[iLen], 511, "\yМеню Игрока^n^n");
    
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w Обнулить \yсчёт^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w Забанить \yигрока^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w Заглушить \yигрока^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Цены на \yпривилегии^n^n");
    
    iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
    return show_menu(id, keys, szMenu, -1, "Show_PlayerMenu");
}

public Handle_PlayerMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
    client_cmd(id, "say /rs");
    return PLUGIN_HANDLED;
}
case 1:
{
    client_cmd(id, "say /voteban");
    return PLUGIN_HANDLED;
}
case 2:
{
    client_cmd(id, "say /mute");
    return PLUGIN_HANDLED;
}
case 3:
{
    client_cmd(id, "say /price");
    return PLUGIN_HANDLED;
}
case 8:
{
    return Show_ServerMenu(id);
}
case 9:
{
    return PLUGIN_HANDLED;
    }
}
return Show_PlayerMenu(id);
}

Show_ShopMenu(id)
{
    // block menu on awp_, aim_, fy_, 35hp_ maps
    new mapname[32];
    get_mapname(mapname, charsmax(mapname));   
    
    new maps[][] = { "awp", "aim", "35hp", "fy", "$" };
    for(new i; i < sizeof maps; i++)
    {
    if(containi(mapname, maps[i]) != -1)
    {
        client_print(id, print_chat, "* Меню не доступно на этой карте! *");   
        return PLUGIN_HANDLED
        }
    }
    // skins shop menu
    new szMenu[512]
    new iLen = 0
    iLen = format(szMenu[iLen], 511, "\yМагазин Скинов^n^n");
    if(get_user_flags(id) & ADMIN_LEVEL_A)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w Элитный \yнабор^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d Элитный набор \R\r[Не куплено]^n");
    }
    if(get_user_flags(id) & ADMIN_LEVEL_B)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w Стильный \yнабор^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d Стильный набор \R\r[Не куплено]^n");
    }
    if(get_user_flags(id) & ADMIN_LEVEL_C)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w Мафиозный \yнабор^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d Мафиозный набор \R\r[Не куплено]^n");
    }
    if(get_user_flags(id) & ADMIN_LEVEL_D)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Засекреченный \yнабор^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Засекреченный набор \R\r[Не куплено]^n");
    }
    if(get_user_flags(id) & ADMIN_LEVEL_E)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w Ножевой \yнабор скинов^n^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d Ножевой набор скинов \R\r[Не куплено]^n^n");
    }
    iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
    return show_menu(id, keys, szMenu, -1, "Show_ShopMenu");
}

public Handle_ShopMenu(id, iKey)
{
switch(iKey)
{
case 0:
{
    if(get_user_flags(id) & ADMIN_LEVEL_A)
    {
    if(!is_user_alive(id))
    {
        return PLUGIN_HANDLED;
    }
    return Show_EliteMenu(id);
}
else
{
    return PLUGIN_HANDLED;
    }
}
case 1:
{
    if(get_user_flags(id) & ADMIN_LEVEL_C)
    {
    if(!is_user_alive(id))
    {
        return PLUGIN_HANDLED;
    }
    return Show_StyleMenu(id);
}
else
{
    return PLUGIN_HANDLED;
    }
}
case 2:
{
    if(get_user_flags(id) & ADMIN_LEVEL_C)
    {
    if(!is_user_alive(id))
    {
        return PLUGIN_HANDLED;
    }
    return Show_MafiozeMenu(id);
}
else
{
    return PLUGIN_HANDLED;
    }
}
case 3:
{
    if(get_user_flags(id) & ADMIN_LEVEL_D)
    {
    if(!is_user_alive(id))
    {
        return PLUGIN_HANDLED;
    }
    return Show_BackroomMenu(id);
}
else
{
    return PLUGIN_HANDLED;
    }
}
case 4:
{
    if(get_user_flags(id) & ADMIN_LEVEL_E)
    {
    return Show_KnifeMenu(id);
}
else
{
    return PLUGIN_HANDLED;
    }
}
case 8:
{
    return Show_ServerMenu(id);
}
case 9:
{
    return PLUGIN_HANDLED;
    }
}
return Show_ShopMenu(id);
}

public Show_EliteMenu(id)
{
    // block menu on awp_, aim_, fy_, 35hp_ maps
    new mapname[32];
    get_mapname(mapname, charsmax(mapname));   
    
    new maps[][] = { "awp", "aim", "35hp", "fy", "$" };
    for(new i; i < sizeof maps; i++)
    {
    if(containi(mapname, maps[i]) != -1)
    {
        client_print(id, print_chat, "* Меню не доступно на этой карте! *");   
        return PLUGIN_HANDLED
        }
    }
    new szMenu[512]
    new iLen = 0
    iLen = format(szMenu[iLen], 511, "\yЭлитиный Набор Скинов:\R\rЦена:^n^n");
    if(cs_get_user_money(id) >= 4750)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w AWP Neo-Noir\R\r4750$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d AWP Neo-Noir\R\r4750$^n");
    }
    if(cs_get_user_money(id) >= 3100)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w M4A1-S Chantico Fire\R\r3100$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d M4A1-S Chantico Fire\R\r3100$^n");
    }
    if(cs_get_user_money(id) >= 2500)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w AK-47 Fire Serpent\R\r2500$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d AK-47 Fire Serpent\R\r2500$^n");
    }
    if(cs_get_user_money(id) >= 650)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Deagle Kumicho Dragon\R\r650$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Deagle Kumicho Dragon\R\r650$^n");
    }
    if(cs_get_user_money(id) >= 500)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w USP Orion\R\r500$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d USP Orion\R\r500$^n");
    }
    if(cs_get_user_money(id) >= 400)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Glock-18 Fade\R\r400$^n^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Glock-18 Fade\R\r400$^n^n");
    }
    iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
    return show_menu(id, keys, szMenu, -1, "Show_EliteMenu");
}

public Handle_EliteMenu(id, iKey)
{
switch(iKey)
{
    case 0:
    {   
    client_cmd(id, "awp_noir");
    return PLUGIN_HANDLED;
    }
    case 1:
    {   
    client_cmd(id, "m4a1_fire");
    return PLUGIN_HANDLED;
    }
    case 2:
    {   
    client_cmd(id, "ak47_fireserpent");
    return PLUGIN_HANDLED;
    }
    case 3:
    {
    client_cmd(id, "deagle_dragon");
    return PLUGIN_HANDLED;
    }
    case 4:
    {
    client_cmd(id, "usp_orion");
    return PLUGIN_HANDLED;
    }
    case 5:
    {
    client_cmd(id, "glock_fade");
    return PLUGIN_HANDLED;
    }
    case 8:
    {
    return Show_ShopMenu(id);
    }
    case 9:
    {
    return PLUGIN_HANDLED;
        }
    }
    return Show_EliteMenu(id);
    }

public Show_StyleMenu(id)
{
    // block menu on awp_, aim_, fy_, 35hp_ maps
    new mapname[32];
    get_mapname(mapname, charsmax(mapname));   
    
    new maps[][] = { "awp", "aim", "35hp", "fy", "$" };
    for(new i; i < sizeof maps; i++)
    {
    if(containi(mapname, maps[i]) != -1)
    {
        client_print(id, print_chat, "* Меню не доступно на этой карте! *");   
        return PLUGIN_HANDLED
        }
    }
    new szMenu[512]
    new iLen = 0
    iLen = format(szMenu[iLen], 511, "\yСтильный Набор Скинов:\R\rЦена:^n^n");
    if(cs_get_user_money(id) >= 4750)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w AWP Fever Dream\R\r4750$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d AWP Fever Dream\R\r4750$^n");
    }
    if(cs_get_user_money(id) >= 3100)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w M4A1-S Nightmare\R\r3100$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d M4A1-S Nightmare\R\r3100$^n");
    }
    if(cs_get_user_money(id) >= 2500)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w AK-47 Blood Sport\R\r2500$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d AK-47 Blood Sport\R\r2500$^n");
    }
    if(cs_get_user_money(id) >= 650)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Deagle Code Red\R\r650$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Deagle Code Red\R\r650$^n");
    }
    if(cs_get_user_money(id) >= 500)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w USP Cortex\R\r500$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d USP Cortex\R\r500$^n");
    }
    if(cs_get_user_money(id) >= 400)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Glock-18 Moonrise\R\r400$^n^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Glock-18 Moonrise\R\r400$^n^n");
    }
    iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
    return show_menu(id, keys, szMenu, -1, "Show_StyleMenu");
}

public Handle_StyleMenu(id, iKey)
{
switch(iKey)
{
    case 0:
    {   
    client_cmd(id, "awp_dream");
    return PLUGIN_HANDLED;
    }
    case 1:
    {   
    client_cmd(id, "m4a1_nightmare");
    return PLUGIN_HANDLED;
    }
    case 2:
    {
    client_cmd(id, "ak47_blood");
    return PLUGIN_HANDLED;
    }
    case 3:
    {
    client_cmd(id, "deagle_codered");
    return PLUGIN_HANDLED;
    }
    case 4:
    {
    client_cmd(id, "usp_cortex");
    return PLUGIN_HANDLED;
    }
    case 5:
    {   
    client_cmd(id, "glock_moon");
    return PLUGIN_HANDLED;
    }
    case 8:
    {
    return Show_ShopMenu(id);
    }
    case 9:
    {
    return PLUGIN_HANDLED;
        }
    }
    return Show_StyleMenu(id);
}
public Show_MafiozeMenu(id)
{
    // block menu on awp_, aim_, fy_, 35hp_ maps
    new mapname[32];
    get_mapname(mapname, charsmax(mapname));   
    
    new maps[][] = { "awp", "aim", "35hp", "fy", "$" };
    for(new i; i < sizeof maps; i++)
    {
    if(containi(mapname, maps[i]) != -1)
    {
        client_print(id, print_chat, "* Меню не доступно на этой карте! *");   
        return PLUGIN_HANDLED
        }
    }
    new szMenu[512]
    new iLen = 0
    iLen = format(szMenu[iLen], 511, "\yМафиозный Набор Скинов:\R\rЦена:^n^n");
    if(cs_get_user_money(id) >= 4750)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w AWP Dragon Lore\R\r4750$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d AWP Dragon Lore\R\r4750$^n");
    }
    if(cs_get_user_money(id) >= 3100)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w M4A1-S Hyper Beast\R\r3100$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d M4A1-S Hyper Beast\R\r3100$^n");
    }
    if(cs_get_user_money(id) >= 2500)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w AK-47 Neon Revolution\R\r2500$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d AK-47 Neon Revolution\R\r2500$^n");
    }
    if(cs_get_user_money(id) >= 650)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Deagle Blaze\R\r650$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Deagle Blaze\R\r650$^n");
    }
    if(cs_get_user_money(id) >= 500)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w USP Kill Confirmed\R\r500$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d USP Kill Confirmed\R\r500$^n");
    }
    if(cs_get_user_money(id) >= 400)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Glock-18 Wasteland Rebel\R\r400$^n^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Glock-18 Wasteland Rebel\R\r400$^n^n");
    }
    iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
    return show_menu(id, keys, szMenu, -1, "Show_MafiozeMenu");
}

public Handle_MafiozeMenu(id, iKey)
{
switch(iKey)
{
    case 0:
    {   
    client_cmd(id, "awp_lore");
    return PLUGIN_HANDLED;
    }
    case 1:
    {
    client_cmd(id, "m4a1_beast");
    return PLUGIN_HANDLED;
    }
    case 2:
    {   
    client_cmd(id, "ak47_neon");
    return PLUGIN_HANDLED;
    }
    case 3:
    {   
    client_cmd(id, "deagle_blaze");
    return PLUGIN_HANDLED;
    }
    case 4:
    {
    client_cmd(id, "usp_confirmed");
    return PLUGIN_HANDLED;
    }
    case 5:
    {
    client_cmd(id, "glock_wasteland");
    return PLUGIN_HANDLED;
    }
    case 8:
    {
    return Show_ShopMenu(id);
    }
    case 9:
    {
    return PLUGIN_HANDLED;
        }
    }
    return Show_MafiozeMenu(id);
}

public Show_BackroomMenu(id)
{
    // block menu on awp_, aim_, fy_, 35hp_ maps   
    new mapname[32];
    get_mapname(mapname, charsmax(mapname));   
    
    new maps[][] = { "awp", "aim", "35hp", "fy", "$" };
    for(new i; i < sizeof maps; i++)
    {
    if(containi(mapname, maps[i]) != -1)
    {
        client_print(id, print_chat, "* Меню не доступно на этой карте! *");   
        return PLUGIN_HANDLED
        }
    }
    new szMenu[512]
    new iLen = 0
    iLen = format(szMenu[iLen], 511, "\yЗасекреченный Набор Скинов:\R\rЦена:^n^n");
    if(cs_get_user_money(id) >= 4750)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w AWP Medusa\R\r4750$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d AWP Medusa\R\r4750$^n");
    }
    if(cs_get_user_money(id) >= 3100)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w M4A1-S Decimator\R\r3100$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d M4A1-S Decimator\R\r3100$^n");
    }
    if(cs_get_user_money(id) >= 2500)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w AK-47 Asiimov\R\r2500$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d AK-47 Asiimov\R\r2500$^n");
    }
    if(cs_get_user_money(id) >= 650)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Deagle Crimson Web\R\r650$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Deagle Crimson Web\R\r650$^n");
    }
    if(cs_get_user_money(id) >= 500)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w USP Neo-Noir\R\r500$^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d USP Neo-Noir\R\r500$^n");
    }
    if(cs_get_user_money(id) >= 400)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Glock-18 Water Elemental\R\r400$^n^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Glock-18 Water Elemental\R\r400$^n^n");
    }
    iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
    return show_menu(id, keys, szMenu, -1, "Show_BackroomMenu");
}

public Handle_BackroomMenu(id, iKey)
{
switch(iKey)
{
    case 0:
    {   
    client_cmd(id, "awp_medusa");
    return PLUGIN_HANDLED;
    }
    case 1:
    {   
    client_cmd(id, "m4a1_decimator");
    return PLUGIN_HANDLED;
    }
    case 2:
    {   
    client_cmd(id, "ak47_asiimov");
    return PLUGIN_HANDLED;
    }
    case 3:
    {
    client_cmd(id, "deagle_crimson");
    return PLUGIN_HANDLED;
    }
    case 4:
    {
    client_cmd(id, "usp_noir");
    return PLUGIN_HANDLED;
    }
    case 5:
    {
    client_cmd(id, "glock_water");
    return PLUGIN_HANDLED;
    }
    case 8:
    {
    return Show_ShopMenu(id);
    }
    case 9:
    {
    return PLUGIN_HANDLED;
        }
    }
    return Show_BackroomMenu(id);
}

public Show_AdminMenu(id)
{
    // main admin menu
    new szMenu[512]
    new iLen = 0
    iLen = format(szMenu[iLen], 511, "\yМеню Администратора^n^n");
    
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w Заглушить \yигрока^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w Кикнуть \yигрока^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w Забанить \yигрока^n^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Сменить \yкарту^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w Голосование за смену \yкарты^n");
    if(get_user_flags(id) & ADMIN_KICK)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Стукнуть/\wУбить \yигрока^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Стукнуть/Убить \yигрока^n");
    }
    if(get_user_flags(id) & ADMIN_KICK)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[7]\w Команда \yигрока^n^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[7]\d Команда \yигрока^n^n");
    }
    iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
    return show_menu(id, keys, szMenu, -1, "Show_AdminMenu");
}

public Handle_AdminMenu(id, iKey)
{
switch(iKey)
{
    case 0:
    {
    client_cmd(id, "amx_gagmenu");
    return PLUGIN_HANDLED;
    }
    case 1:
    {
    client_cmd(id, "amx_kickmenu");
    return PLUGIN_HANDLED;
    }
    case 2:
    {
    client_cmd(id, "amx_banmenu");
    return PLUGIN_HANDLED;
    }
    case 3:
    {
    client_cmd(id, "amx_mapmenu");
    return PLUGIN_HANDLED;
    }
    case 4:
    {
    client_cmd(id, "amx_votemapmenu");
    return PLUGIN_HANDLED;
    }
    case 5:
    {
    if(get_user_flags(id) & ADMIN_KICK)
    {
    client_cmd(id, "amx_slapmenu");
    return PLUGIN_HANDLED;
    }
    else
    {
    client_print(id, print_chat, "* Только Админ может пользоваться этой командой! *");
    client_cmd(id, "spk buttons/blip2.wav");
    return PLUGIN_HANDLED;
        }
    }
    case 6:
    {
    if(get_user_flags(id) & ADMIN_KICK)
    {
    client_cmd(id, "amx_teammenu");
    return PLUGIN_HANDLED;
    }
    else
    {
    client_print(id, print_chat, "* Только Админ может пользоваться этой командой! *");
    client_cmd(id, "spk buttons/blip2.wav");
    return PLUGIN_HANDLED;
        }
    }
    case 8:
    {
    return Show_ServerMenu(id);
    }
    case 9:
    {
    return PLUGIN_HANDLED;
        }
    }
    return Show_AdminMenu(id);
}

Show_KnifeMenu(id)
{
    // knife menu
    new szMenu[512]
    new iLen = 0
    iLen = format(szMenu[iLen], 511, "\yНожевой Набор^n^n")
    if(KnifeId[id] == 1)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\d Bayonet Autotronic \r[+]^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[1]\w Bayonet Autotronic^n");
    }
    if(KnifeId[id] == 2)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\d Falchion Slaughter \r[+]^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[2]\w Falchion Slaughter^n");
    }
    if(KnifeId[id] == 3)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\d Gut Case Hardened \r[+]^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[3]\w Gut Case Hardened^n");
    }
    if(KnifeId[id] == 4)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\d Karambit Waves \r[+]^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[4]\w Karambit Waves^n");
    }
    if(KnifeId[id] == 5)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\d M9 Bayonet Sapphire \r[+]^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[5]\w M9 Bayonet Sapphire^n");
    }
    if(KnifeId[id] == 6)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\d Butterfly Fade \r[+]^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[6]\w Butterfly Fade^n");
    }
    if(KnifeId[id] == 7)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[7]\d Stiletto Crimson Web \r[+]^n^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[7]\w Stiletto Crimson Web^n^n");
    }
    if(KnifeId[id] == 8)
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[8]\d Стандарт \r[+]^n^n");
    }
    else
    {
    iLen += format(szMenu[iLen], 511 - iLen, "\r[8]\w Стандарт^n^n");
    }
    iLen += format(szMenu[iLen], 511 - iLen, "\r[9]\w Назад^n");
    iLen += format(szMenu[iLen], 511 - iLen, "\r[0]\w Выход^n");
    return show_menu(id, keys, szMenu, -1, "Show_KnifeMenu");
}

public Handle_KnifeMenu(id, iKey)
{
switch(iKey)
{
    case 0:
    {
    if(KnifeId[id] == 1)
    {
    client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
    return PLUGIN_HANDLED;
    }
    else
    {
    KnifeId[id] = 1
    give_item1(id)
    client_print(id, print_chat, "* Вы взяли Нож Bayonet Autotronic *");
    return PLUGIN_HANDLED;
        }
    }
    case 1:
    {
    if(KnifeId[id] == 2)
    {
    client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
    return PLUGIN_HANDLED;
    }
    else
    {
    KnifeId[id] = 2
    give_item2(id)
    client_print(id, print_chat, "* Вы взяли Нож Falchion Slaughter *");
    return PLUGIN_HANDLED;
        }
    }
    case 2:
    {
    if(KnifeId[id] == 3)
    {
    client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
    return PLUGIN_HANDLED;
    }
    else
    {
    KnifeId[id] = 3
    give_item3(id)
    client_print(id, print_chat, "* Вы взяли Нож Gut Case Hardened *");
    return PLUGIN_HANDLED;
        }
    }
    case 3:
    {
    if(KnifeId[id] == 4)
    {
    client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
    return PLUGIN_HANDLED;
    }
    else
    {
    KnifeId[id] = 4
    give_item4(id)
    client_print(id, print_chat, "* Вы взяли Нож Karambit Waves *");
    return PLUGIN_HANDLED;
        }
    }
    case 4:
    {
    if(KnifeId[id] == 5)
    {
    client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
    return PLUGIN_HANDLED;
    }
    else
    {
    KnifeId[id] = 5
    give_item5(id)
    client_print(id, print_chat, "* Вы взяли Нож M9 Bayonet Sapphire *");
    return PLUGIN_HANDLED;
        }
    }
    case 5:
    {
    if(KnifeId[id] == 6)
    {
    client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
    return PLUGIN_HANDLED;
    }
    else
    {
    KnifeId[id] = 6
    give_item6(id)
    client_print(id, print_chat, "* Вы взяли Нож Butterfly Fade *");
    return PLUGIN_HANDLED;
        }
    }
    case 6:
    {
    if(KnifeId[id] == 7)
    {
    client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
    return PLUGIN_HANDLED;
    }
    else
    {
    KnifeId[id] = 7
    give_item7(id)
    client_print(id, print_chat, "* Вы взяли Нож Stiletto Crimson Web *");
    return PLUGIN_HANDLED;
        }
    }
    case 7:
    {
    if(KnifeId[id] == 8)
    {
    client_print(id, print_chat, "* У вас уже выбран этот Нож! *");
    return PLUGIN_HANDLED;
    }   
    if(get_user_team(id) == 1)
    {
    KnifeId[id] = 8
    give_item8(id)
    client_print(id, print_chat, "* Вы взяли Стандартный Нож*");
    return PLUGIN_HANDLED;
    }
    else
    {
    KnifeId[id] = 8
    give_item8(id)
    client_print(id, print_chat, "* Вы взяли Стандартный Нож *");
    return PLUGIN_HANDLED;
        }
    }
    case 8:
    {
    return Show_ShopMenu(id);
    }
    case 9:
    {
    return PLUGIN_HANDLED;
        }
    }
    return Show_KnifeMenu(id);
}

public give_item1(id)
{
    if(get_user_weapon(id) != CSW_KNIFE)
    return
    
    if(KnifeId[id] == 1)
    {
        set_pev(id, pev_viewmodel2, KNIFE_V_MODEL1)
        set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL1)
    }
}

public give_item2(id)
{
    if(get_user_weapon(id) != CSW_KNIFE)
    return
    
    if(KnifeId[id] == 2)
    {
        set_pev(id, pev_viewmodel2, KNIFE_V_MODEL2)
        set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL2)
    }
}

public give_item3(id)
{
    if(get_user_weapon(id) != CSW_KNIFE)
    return
    
    if(KnifeId[id] == 3)
    {
        set_pev(id, pev_viewmodel2, KNIFE_V_MODEL3)
        set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL3)
    }
}

public give_item4(id)
{
    if(get_user_weapon(id) != CSW_KNIFE)
    return
    
    if(KnifeId[id] == 4)
    {
        set_pev(id, pev_viewmodel2, KNIFE_V_MODEL4)
        set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL4)
    }
}

public give_item5(id)
{
if(get_user_weapon(id) != CSW_KNIFE)
    return
    
    if(KnifeId[id] == 5)
    {
        set_pev(id, pev_viewmodel2, KNIFE_V_MODEL5)
        set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL5)
    }
}
public give_item6(id)
{
    if(get_user_weapon(id) != CSW_KNIFE)
        return
    
    if(KnifeId[id] == 6)
    {
        set_pev(id, pev_viewmodel2, KNIFE_V_MODEL6)
        set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL6)
    }
}
public give_item7(id)
{
    if(get_user_weapon(id) != CSW_KNIFE)
        return
    
    if(KnifeId[id] == 7)
    {
        set_pev(id, pev_viewmodel2, KNIFE_V_MODEL7)
        set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL7)
    }
}
public give_item8(id)
{
    if(get_user_weapon(id) != CSW_KNIFE)
        return
    
    if(KnifeId[id] == 8)
    {
        if(get_user_team(id) == 1)
        {
            set_pev(id, pev_viewmodel2, KNIFE_V_MODEL9)
            set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL9)
            }
        else
        {
            set_pev(id, pev_viewmodel2, KNIFE_V_MODEL8)
            set_pev(id, pev_weaponmodel2, KNIFE_P_MODEL8)
        }
    }
}

public Fw_Weapon_PrimaryAttack(weapon)
{
    static id;
    id = get_pdata_cbase(weapon, m_pPlayer, XoWeapon);
    
    if(!is_user_alive(id))
        return
    
    new wpn_id = get_user_weapon(id);
    static model[32];
    pev(id, pev_viewmodel2, model, 31);
        switch(wpn_id)
        {
            case CSW_DEAGLE:
                g_deagle_overide[id] = 1;
            case CSW_AWP, CSW_SCOUT, CSW_M3:
                set_pdata_float(weapon, m_flTimeWeaponIdle, 1.5, XoWeapon);
            case CSW_KNIFE:
                set_pdata_float(weapon, m_flTimeWeaponIdle, 1.0, XoWeapon);
            default:
                set_pdata_float(weapon, m_flTimeWeaponIdle, 2.0, XoWeapon);
    }
}

public Fw_Weapon_SecondaryAttack(weapon)
{
    static id;
    id = get_pdata_cbase(weapon, m_pPlayer, XoWeapon);
    new wpn_id = get_user_weapon(id);
    
    if(wpns_scoped & (1 << wpn_id) && cs_get_user_zoom(id) <= 1)
    {
        set_pev(id, pev_weaponanim, 0);
    
        message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id);
        write_byte(0);
        write_byte(pev(id, pev_body));
        message_end();
    }
}

public Fw_Deagle_Disable(weapon)
{
    static id;
    id = get_pdata_cbase(weapon, m_pPlayer, XoWeapon);
    remove_task(id)
}

public Deagle_Overide(id)
    g_deagle_overide[id] = 1;

public Inspect_Weapon(id)
{
    if(!is_user_alive(id) || !is_user_connected(id))
        return PLUGIN_HANDLED
        
    if(cs_get_user_shield(id))
        return PLUGIN_HANDLED
        
    if(cs_get_user_zoom(id) > 1)
        return PLUGIN_HANDLED

    static weapon; weapon = get_pdata_cbase(id, m_pActiveItem);

    if(weapon <= 0 || !pev_valid(weapon))
        return PLUGIN_CONTINUE

    new wpn_id = get_pdata_int(weapon, m_iId, 4);

    if(wpns_without_inspect & (1 << wpn_id))
        return PLUGIN_HANDLED

    
    static Float:flNextAttack; flNextAttack = get_pdata_float(id, m_flNextAttack, XoPlayer);
    static Float:flNextPrimaryAttack; flNextPrimaryAttack = get_pdata_float(weapon, m_flNextPrimaryAttack, XoWeapon);

    if(flNextAttack <= 0 && flNextPrimaryAttack <= 0)
    {   
        static model[32]; pev(id, pev_viewmodel2, model, 31);
            
            new anim = inspect_anim[wpn_id];
            new current_anim = pev(get_pdata_cbase(weapon, m_pPlayer, XoWeapon), pev_weaponanim);

            switch (wpn_id)
            {
                case CSW_USP: if(cs_get_weapon_silen(weapon)) anim = 17;
                case CSW_M4A1:if(cs_get_weapon_silen(weapon)) anim = 14;
                case CSW_DEAGLE: // random inspect (seq 6 / 7)
                {
                    if(wpn_id == CSW_DEAGLE && g_deagle_overide[id] == 1)
                    {
                        anim = random_num(6, 7);

                        new Float:f_temp;
                        if(anim == 7) f_temp = 8.53;
                        else f_temp = idle_calltime[CSW_DEAGLE]
                        
                        play_inspect(id, anim);
                        remove_task(id);
                        g_deagle_overide[id] = 0;
                        set_task(f_temp, "Deagle_Overide", id);
                        return PLUGIN_CONTINUE
                    }
                }
            }
            
            if(wpn_id == CSW_KNIFE && (current_anim == 8))
                return PLUGIN_HANDLED
            
            if(!get_pdata_int(weapon, m_fInSpecialReload, 4) && current_anim != anim)
            {
                play_inspect(id, anim);
                set_pdata_float(weapon, m_flTimeWeaponIdle, idle_calltime[wpn_id], XoWeapon);
                
            }
        }
    
    return PLUGIN_CONTINUE
}

// gets a player id that triggered certain logevents, by VEN
stock get_loguser_index()
{
    static loguser[80], name[32]
    read_logargv(0, loguser, charsmax(loguser))
    parse_loguser(loguser, name, charsmax(name))

    return get_user_index(name)
}

stock format_color(message[], msglen)
{
    new string[256], len = charsmax(string);

    copy(string, len, message);

    replace_all(string, len, "!n", "^1");
    replace_all(string, len, "!t", "^3");
    replace_all(string, len, "!g", "^4");

    formatex(message, msglen, "^1%s", string);
}

play_inspect(id, anim)
{
    set_pev(id, pev_weaponanim, anim);
    
    message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id);
    write_byte(anim);
    write_byte(pev(id, pev_body));
    message_end();   
}

SendMsg(id, const MSG[], any:...)
{
    new szMsg[190]; vformat(szMsg, charsmax(szMsg), MSG, 3);
    message_begin(MSG_ONE_UNRELIABLE, 76, .player = id);
    write_byte(id);
    write_string(szMsg);
    message_end();
}
 

Top4ik

Пользователь
Регистрация
10 Фев 2020
Сообщения
54
Симпатии
4
Нашел это строчку в исходнике csgo_weapons.sma
Код:
// #define DONT_BLOCK_PRECACHE

#include <amxmodx>
#include <fakemeta_stocks>
#include <hamsandwich>

#pragma semicolon 1

const MAX_MODEL_LENGTH = 64;

new const m_rgpPlayerItems_CBasePlayer[6] = {367, 368, ...};
const m_pActiveItem = 373;

const XO_WEAPON = 4;
const m_pPlayer = 41;

new Trie:g_tszWorldModels; // handles new models strings (all excepted v_ and w_ models)
new Trie:g_tiPrecacheReturns; // handles all new models precache returns integers
new Trie:g_tiszViewModels;
new Trie:g_tiszWeaponModels;

public plugin_precache()
{
    new szModelsFile[128];
    get_localinfo("amxx_configsdir", szModelsFile, charsmax(szModelsFile));
    add(szModelsFile, charsmax(szModelsFile), "/csgo/csgo_weapons.ini");

    new iFile = fopen(szModelsFile, "rt");
    if(!iFile)
    {
        return;
    }

    new szDatas[192], szOldModel[MAX_MODEL_LENGTH], szNewModel[MAX_MODEL_LENGTH];
    new szWeaponClass[32], Trie:tRegisterWeaponDeploy = TrieCreate(), iId;

    new Trie:tWeaponsIds = TrieCreate();
    TrieSetCell(tWeaponsIds, "p228", CSW_P228);
    TrieSetCell(tWeaponsIds, "scout", CSW_SCOUT);
    TrieSetCell(tWeaponsIds, "hegrenade", CSW_HEGRENADE);
    TrieSetCell(tWeaponsIds, "xm1014", CSW_XM1014);
    TrieSetCell(tWeaponsIds, "c4", CSW_C4);
    TrieSetCell(tWeaponsIds, "mac10", CSW_MAC10);
    TrieSetCell(tWeaponsIds, "aug", CSW_AUG);
    TrieSetCell(tWeaponsIds, "smokegrenade", CSW_SMOKEGRENADE);
    TrieSetCell(tWeaponsIds, "elite", CSW_ELITE);
    TrieSetCell(tWeaponsIds, "fiveseven", CSW_FIVESEVEN);
    TrieSetCell(tWeaponsIds, "ump45", CSW_UMP45);
    TrieSetCell(tWeaponsIds, "sg550", CSW_SG550);
    TrieSetCell(tWeaponsIds, "galil", CSW_GALIL);
    TrieSetCell(tWeaponsIds, "famas", CSW_FAMAS);
    TrieSetCell(tWeaponsIds, "usp", CSW_USP);
    TrieSetCell(tWeaponsIds, "glock18", CSW_GLOCK18);
    TrieSetCell(tWeaponsIds, "awp", CSW_AWP);
    TrieSetCell(tWeaponsIds, "mp5navy", CSW_MP5NAVY);
    TrieSetCell(tWeaponsIds, "m249", CSW_M249);
    TrieSetCell(tWeaponsIds, "m3", CSW_M3);
    TrieSetCell(tWeaponsIds, "m4a1", CSW_M4A1);
    TrieSetCell(tWeaponsIds, "tmp", CSW_TMP);
    TrieSetCell(tWeaponsIds, "g3sg1", CSW_G3SG1);
    TrieSetCell(tWeaponsIds, "flashbang", CSW_FLASHBANG);
    TrieSetCell(tWeaponsIds, "deagle", CSW_DEAGLE);
    TrieSetCell(tWeaponsIds, "sg552", CSW_SG552);
    TrieSetCell(tWeaponsIds, "ak47", CSW_AK47);
    TrieSetCell(tWeaponsIds, "knife", CSW_KNIFE);
    TrieSetCell(tWeaponsIds, "p90", CSW_P90);

    new c, bool:bServerDeactivateRegistered, iExtPos, bShieldModel;
    while(!feof(iFile))
    {
        fgets(iFile, szDatas, charsmax(szDatas));
        trim(szDatas);
        if(!(c=szDatas[0]) || c == ';' || c == '#' || (c == '/' && szDatas[1] == '/'))
        {
            continue;
        }

        if(        parse(szDatas, szOldModel, charsmax(szOldModel), szNewModel, charsmax(szNewModel)) == 2
        &&    file_exists(szNewModel)    )
        {
            // models/[p/v]_
            // models/shield/[p/v]_shield_
            bShieldModel = equal(szOldModel, "models/shield/", 14);
            if( ( (c=szOldModel[bShieldModel ? 14 : 7]) == 'p' || c == 'v' ) && szOldModel[bShieldModel ? 15 : 8] == '_' )
            {
                if( equal(szOldModel[9], "mp5", 3 ) )
                {
                    copy(szWeaponClass, charsmax(szWeaponClass), "weapon_mp5navy");
                }
                else
                {
                    iExtPos = strlen(szOldModel) - 4;
                    szOldModel[ iExtPos ] = EOS;
                    formatex(szWeaponClass, charsmax(szWeaponClass), "weapon_%s", szOldModel[bShieldModel ? 23 : 9]);
                    szOldModel[ iExtPos ] = '.';
                }
                
                if( !TrieGetCell(tWeaponsIds, szWeaponClass[7], iId) )
                {
                    continue;
                }

                if( c == 'v' )
                {
                    if( !g_tiszViewModels )
                    {
                        g_tiszViewModels = TrieCreate();
                    }

                    TrieSetCell(g_tiszViewModels, szOldModel, EF_AllocString( szNewModel ) );
                }
                else
                {
                    if( !g_tiszWeaponModels )
                    {
                        g_tiszWeaponModels = TrieCreate();
                    }
                    
                    TrieSetCell(g_tiszWeaponModels, szOldModel, EF_AllocString( szNewModel ) );
                }
                
                if( !TrieKeyExists(tRegisterWeaponDeploy, szWeaponClass) )
                {
                    TrieSetCell
                    (
                        tRegisterWeaponDeploy,
                        szWeaponClass,
                        RegisterHam(Ham_Item_Deploy, szWeaponClass, "OnCBasePlayerWeapon_Deploy_P", true)
                    );
                }
            }
            else
            {
                if( !bServerDeactivateRegistered && equal(szOldModel, "models/w_backpack.mdl") )
                {
                    bServerDeactivateRegistered = true;
                    register_forward(FM_ServerDeactivate, "OnServerDeactivate");
                }

                if( !g_tszWorldModels )
                {
                    g_tszWorldModels = TrieCreate();
                }
                else if( TrieKeyExists(g_tszWorldModels, szOldModel) )
                {
                    new szModel[MAX_MODEL_LENGTH];
                    TrieGetString(g_tszWorldModels, szOldModel, szModel, charsmax(szModel));
                    log_amx("%s world model is already set to %s, can't set it to %s !!", szWeaponClass, szModel, szNewModel);
                    continue;
                }
                TrieSetString(g_tszWorldModels, szOldModel, szNewModel);
            }

            if( !g_tiPrecacheReturns )
            {
                g_tiPrecacheReturns = TrieCreate();
            }
            TrieSetCell(g_tiPrecacheReturns, szOldModel, EF_PrecacheModel(szNewModel));
#if defined DONT_BLOCK_PRECACHE
            EF_PrecacheModel(szOldModel);
#endif
        }
    }
    fclose(iFile);

    TrieDestroy(tRegisterWeaponDeploy);
    TrieDestroy(tWeaponsIds);

    if( g_tiPrecacheReturns )
    {
        register_forward(FM_PrecacheModel, "OnPrecacheModel");

        if( g_tszWorldModels )
        {
            register_forward(FM_SetModel, "OnSetModel");
        }
    }
}

public plugin_init()
{
    register_plugin("[CS:GO MOD] Weapons Replace", "1.2", "ConnorMcLeod");
}

public OnServerDeactivate()
{
    static bool:bDontPassThisTwice = false;
    if( bDontPassThisTwice ) // unregister this would be waste of time
    {
        return;
    }
    bDontPassThisTwice = true;

    new id, c4 = FM_NULLENT;
    while( (c4 = EF_FindEntityByString(c4, "classname", "weapon_c4")) > 0 )
    {
        id = get_pdata_cbase(c4, m_pPlayer);
        if( id > 0 )
        {
            // can't use set_pdata_cbase on players at this point
            set_pdata_int(id, m_rgpPlayerItems_CBasePlayer[5], 0);
            set_pdata_int(id, m_pActiveItem, 0);
            // tried to remove c4 entity but server just stucks
        }
    }
}

public OnPrecacheModel(const szModel[])
{
    static iReturn;
    if( TrieGetCell(g_tiPrecacheReturns, szModel, iReturn) )
    {
        forward_return(FMV_CELL, iReturn);
        return FMRES_SUPERCEDE;
    }
    return FMRES_IGNORED;
}

public OnCBasePlayerWeapon_Deploy_P( iWeapon )
{
    new id = get_pdata_cbase(iWeapon, m_pPlayer, XO_WEAPON);
    if( pev_valid(id) == 2 && get_pdata_cbase(id, m_pActiveItem) == iWeapon )
    {
        new iszNewModel, szOldModel[MAX_MODEL_LENGTH];
        if( g_tiszViewModels )
        {
            pev(id, pev_viewmodel2, szOldModel, charsmax(szOldModel));
            if( TrieGetCell(g_tiszViewModels, szOldModel, iszNewModel) )
            {
                set_pev(id, pev_viewmodel, iszNewModel);
            }
        }
        if( g_tiszWeaponModels )
        {
            pev(id, pev_weaponmodel2, szOldModel, charsmax(szOldModel));
            if( TrieGetCell(g_tiszWeaponModels, szOldModel, iszNewModel) )
            {
                set_pev(id, pev_weaponmodel, iszNewModel);
            }
        }
    }
}

public OnSetModel(const iEnt, const szModel[])
{
    new szNewModel[MAX_MODEL_LENGTH];
    if( TrieGetString(g_tszWorldModels, szModel, szNewModel, charsmax(szNewModel)) )
    {
        EF_SetModel(iEnt, szNewModel);
        return FMRES_SUPERCEDE;
    }
    return FMRES_IGNORED;
}
if( !bServerDeactivateRegistered && equal(szOldModel, "models/w_backpack.mdl") )
Как быть как исправить эту проблему?
 

perfectblood0

Команда форума
Администратор
Регистрация
29 Окт 2017
Сообщения
2.578
Симпатии
914
Пол
Женский
Нашел это строчку в исходнике csgo_weapons.sma
Код:
// #define DONT_BLOCK_PRECACHE

#include <amxmodx>
#include <fakemeta_stocks>
#include <hamsandwich>

#pragma semicolon 1

const MAX_MODEL_LENGTH = 64;

new const m_rgpPlayerItems_CBasePlayer[6] = {367, 368, ...};
const m_pActiveItem = 373;

const XO_WEAPON = 4;
const m_pPlayer = 41;

new Trie:g_tszWorldModels; // handles new models strings (all excepted v_ and w_ models)
new Trie:g_tiPrecacheReturns; // handles all new models precache returns integers
new Trie:g_tiszViewModels;
new Trie:g_tiszWeaponModels;

public plugin_precache()
{
    new szModelsFile[128];
    get_localinfo("amxx_configsdir", szModelsFile, charsmax(szModelsFile));
    add(szModelsFile, charsmax(szModelsFile), "/csgo/csgo_weapons.ini");

    new iFile = fopen(szModelsFile, "rt");
    if(!iFile)
    {
        return;
    }

    new szDatas[192], szOldModel[MAX_MODEL_LENGTH], szNewModel[MAX_MODEL_LENGTH];
    new szWeaponClass[32], Trie:tRegisterWeaponDeploy = TrieCreate(), iId;

    new Trie:tWeaponsIds = TrieCreate();
    TrieSetCell(tWeaponsIds, "p228", CSW_P228);
    TrieSetCell(tWeaponsIds, "scout", CSW_SCOUT);
    TrieSetCell(tWeaponsIds, "hegrenade", CSW_HEGRENADE);
    TrieSetCell(tWeaponsIds, "xm1014", CSW_XM1014);
    TrieSetCell(tWeaponsIds, "c4", CSW_C4);
    TrieSetCell(tWeaponsIds, "mac10", CSW_MAC10);
    TrieSetCell(tWeaponsIds, "aug", CSW_AUG);
    TrieSetCell(tWeaponsIds, "smokegrenade", CSW_SMOKEGRENADE);
    TrieSetCell(tWeaponsIds, "elite", CSW_ELITE);
    TrieSetCell(tWeaponsIds, "fiveseven", CSW_FIVESEVEN);
    TrieSetCell(tWeaponsIds, "ump45", CSW_UMP45);
    TrieSetCell(tWeaponsIds, "sg550", CSW_SG550);
    TrieSetCell(tWeaponsIds, "galil", CSW_GALIL);
    TrieSetCell(tWeaponsIds, "famas", CSW_FAMAS);
    TrieSetCell(tWeaponsIds, "usp", CSW_USP);
    TrieSetCell(tWeaponsIds, "glock18", CSW_GLOCK18);
    TrieSetCell(tWeaponsIds, "awp", CSW_AWP);
    TrieSetCell(tWeaponsIds, "mp5navy", CSW_MP5NAVY);
    TrieSetCell(tWeaponsIds, "m249", CSW_M249);
    TrieSetCell(tWeaponsIds, "m3", CSW_M3);
    TrieSetCell(tWeaponsIds, "m4a1", CSW_M4A1);
    TrieSetCell(tWeaponsIds, "tmp", CSW_TMP);
    TrieSetCell(tWeaponsIds, "g3sg1", CSW_G3SG1);
    TrieSetCell(tWeaponsIds, "flashbang", CSW_FLASHBANG);
    TrieSetCell(tWeaponsIds, "deagle", CSW_DEAGLE);
    TrieSetCell(tWeaponsIds, "sg552", CSW_SG552);
    TrieSetCell(tWeaponsIds, "ak47", CSW_AK47);
    TrieSetCell(tWeaponsIds, "knife", CSW_KNIFE);
    TrieSetCell(tWeaponsIds, "p90", CSW_P90);

    new c, bool:bServerDeactivateRegistered, iExtPos, bShieldModel;
    while(!feof(iFile))
    {
        fgets(iFile, szDatas, charsmax(szDatas));
        trim(szDatas);
        if(!(c=szDatas[0]) || c == ';' || c == '#' || (c == '/' && szDatas[1] == '/'))
        {
            continue;
        }

        if(        parse(szDatas, szOldModel, charsmax(szOldModel), szNewModel, charsmax(szNewModel)) == 2
        &&    file_exists(szNewModel)    )
        {
            // models/[p/v]_
            // models/shield/[p/v]_shield_
            bShieldModel = equal(szOldModel, "models/shield/", 14);
            if( ( (c=szOldModel[bShieldModel ? 14 : 7]) == 'p' || c == 'v' ) && szOldModel[bShieldModel ? 15 : 8] == '_' )
            {
                if( equal(szOldModel[9], "mp5", 3 ) )
                {
                    copy(szWeaponClass, charsmax(szWeaponClass), "weapon_mp5navy");
                }
                else
                {
                    iExtPos = strlen(szOldModel) - 4;
                    szOldModel[ iExtPos ] = EOS;
                    formatex(szWeaponClass, charsmax(szWeaponClass), "weapon_%s", szOldModel[bShieldModel ? 23 : 9]);
                    szOldModel[ iExtPos ] = '.';
                }
                
                if( !TrieGetCell(tWeaponsIds, szWeaponClass[7], iId) )
                {
                    continue;
                }

                if( c == 'v' )
                {
                    if( !g_tiszViewModels )
                    {
                        g_tiszViewModels = TrieCreate();
                    }

                    TrieSetCell(g_tiszViewModels, szOldModel, EF_AllocString( szNewModel ) );
                }
                else
                {
                    if( !g_tiszWeaponModels )
                    {
                        g_tiszWeaponModels = TrieCreate();
                    }
                    
                    TrieSetCell(g_tiszWeaponModels, szOldModel, EF_AllocString( szNewModel ) );
                }
                
                if( !TrieKeyExists(tRegisterWeaponDeploy, szWeaponClass) )
                {
                    TrieSetCell
                    (
                        tRegisterWeaponDeploy,
                        szWeaponClass,
                        RegisterHam(Ham_Item_Deploy, szWeaponClass, "OnCBasePlayerWeapon_Deploy_P", true)
                    );
                }
            }
            else
            {
                if( !bServerDeactivateRegistered && equal(szOldModel, "models/w_backpack.mdl") )
                {
                    bServerDeactivateRegistered = true;
                    register_forward(FM_ServerDeactivate, "OnServerDeactivate");
                }

                if( !g_tszWorldModels )
                {
                    g_tszWorldModels = TrieCreate();
                }
                else if( TrieKeyExists(g_tszWorldModels, szOldModel) )
                {
                    new szModel[MAX_MODEL_LENGTH];
                    TrieGetString(g_tszWorldModels, szOldModel, szModel, charsmax(szModel));
                    log_amx("%s world model is already set to %s, can't set it to %s !!", szWeaponClass, szModel, szNewModel);
                    continue;
                }
                TrieSetString(g_tszWorldModels, szOldModel, szNewModel);
            }

            if( !g_tiPrecacheReturns )
            {
                g_tiPrecacheReturns = TrieCreate();
            }
            TrieSetCell(g_tiPrecacheReturns, szOldModel, EF_PrecacheModel(szNewModel));
#if defined DONT_BLOCK_PRECACHE
            EF_PrecacheModel(szOldModel);
#endif
        }
    }
    fclose(iFile);

    TrieDestroy(tRegisterWeaponDeploy);
    TrieDestroy(tWeaponsIds);

    if( g_tiPrecacheReturns )
    {
        register_forward(FM_PrecacheModel, "OnPrecacheModel");

        if( g_tszWorldModels )
        {
            register_forward(FM_SetModel, "OnSetModel");
        }
    }
}

public plugin_init()
{
    register_plugin("[CS:GO MOD] Weapons Replace", "1.2", "ConnorMcLeod");
}

public OnServerDeactivate()
{
    static bool:bDontPassThisTwice = false;
    if( bDontPassThisTwice ) // unregister this would be waste of time
    {
        return;
    }
    bDontPassThisTwice = true;

    new id, c4 = FM_NULLENT;
    while( (c4 = EF_FindEntityByString(c4, "classname", "weapon_c4")) > 0 )
    {
        id = get_pdata_cbase(c4, m_pPlayer);
        if( id > 0 )
        {
            // can't use set_pdata_cbase on players at this point
            set_pdata_int(id, m_rgpPlayerItems_CBasePlayer[5], 0);
            set_pdata_int(id, m_pActiveItem, 0);
            // tried to remove c4 entity but server just stucks
        }
    }
}

public OnPrecacheModel(const szModel[])
{
    static iReturn;
    if( TrieGetCell(g_tiPrecacheReturns, szModel, iReturn) )
    {
        forward_return(FMV_CELL, iReturn);
        return FMRES_SUPERCEDE;
    }
    return FMRES_IGNORED;
}

public OnCBasePlayerWeapon_Deploy_P( iWeapon )
{
    new id = get_pdata_cbase(iWeapon, m_pPlayer, XO_WEAPON);
    if( pev_valid(id) == 2 && get_pdata_cbase(id, m_pActiveItem) == iWeapon )
    {
        new iszNewModel, szOldModel[MAX_MODEL_LENGTH];
        if( g_tiszViewModels )
        {
            pev(id, pev_viewmodel2, szOldModel, charsmax(szOldModel));
            if( TrieGetCell(g_tiszViewModels, szOldModel, iszNewModel) )
            {
                set_pev(id, pev_viewmodel, iszNewModel);
            }
        }
        if( g_tiszWeaponModels )
        {
            pev(id, pev_weaponmodel2, szOldModel, charsmax(szOldModel));
            if( TrieGetCell(g_tiszWeaponModels, szOldModel, iszNewModel) )
            {
                set_pev(id, pev_weaponmodel, iszNewModel);
            }
        }
    }
}

public OnSetModel(const iEnt, const szModel[])
{
    new szNewModel[MAX_MODEL_LENGTH];
    if( TrieGetString(g_tszWorldModels, szModel, szNewModel, charsmax(szNewModel)) )
    {
        EF_SetModel(iEnt, szNewModel);
        return FMRES_SUPERCEDE;
    }
    return FMRES_IGNORED;
}

Как быть как исправить эту проблему?
Скачать какую нибудь модель бомбы и закинуть её по этому пути.
 

Vaqtincha

aggressive
Разработчик
Скриптер
Регистрация
28 Янв 2018
Сообщения
963
Симпатии
685
Пол
Мужской
Top4ik, Раскомментируй первую строку либо добавь исключение эту модельку (в функции OnPrecscheModel l
perfectblood0, Моделька дефольная и она присутствует. Просто на этом плагине встроен свой антипрекешер
Судя по коду автор плагина (а он кстати вдохновил своим скиллом кодинга) пытался это исправить. Но я думаю ради одной модельки того не стоит.
 
Последнее редактирование:

Top4ik

Пользователь
Регистрация
10 Фев 2020
Сообщения
54
Симпатии
4
Скачать какую нибудь модель бомбы и закинуть её по этому пути.
Сделал так же,проблема не ушла(
Top4ik, Раскомментируй первую строку либо добавь исключение эту модельку (в функции OnPrecscheModel l
perfectblood0, Моделька дефольная и она присутствует. Просто на этом плагине встроен свой антипрекешер
Судя по коду автор плагина (а он кстати вдохновил своим скиллом кодинга) пытался это исправить. Но я думаю ради одной модельки того не стоит.
Подскажите более подробно пожалуйста,как это сделать,в скриптинге я полный нуль!
Top4ik, Раскомментируй первую строку либо добавь исключение эту модельку (в функции OnPrecscheModel l
perfectblood0, Моделька дефольная и она присутствует. Просто на этом плагине встроен свой антипрекешер
Судя по коду автор плагина (а он кстати вдохновил своим скиллом кодинга) пытался это исправить. Но я думаю ради одной модельки того не стоит.
а как же тогда решить эту проблему,сервер падает постоянно,я не знаю как быть уже
 

Vaqtincha

aggressive
Разработчик
Скриптер
Регистрация
28 Янв 2018
Сообщения
963
Симпатии
685
Пол
Мужской
Top4ik,
C++:
// #define DONT_BLOCK_PRECACHE

#include <amxmodx>
#include <fakemeta_stocks>
#include <hamsandwich>

#pragma semicolon 1

const MAX_MODEL_LENGTH = 64;

const m_pActiveItem = 373;

const XO_WEAPON = 4;
const m_pPlayer = 41;

new Trie:g_tszWorldModels; // handles new models strings (all excepted v_ and w_ models)
new Trie:g_tiPrecacheReturns; // handles all new models precache returns integers
new Trie:g_tiszViewModels;
new Trie:g_tiszWeaponModels;

public plugin_precache()
{
    new szModelsFile[128];
    get_localinfo("amxx_configsdir", szModelsFile, charsmax(szModelsFile));
    add(szModelsFile, charsmax(szModelsFile), "/csgo/csgo_weapons.ini");

    new iFile = fopen(szModelsFile, "rt");
    if(!iFile)
    {
        return;
    }

    new szDatas[192], szOldModel[MAX_MODEL_LENGTH], szNewModel[MAX_MODEL_LENGTH];
    new szWeaponClass[32], Trie:tRegisterWeaponDeploy = TrieCreate(), iId;

    new Trie:tWeaponsIds = TrieCreate();
    TrieSetCell(tWeaponsIds, "p228", CSW_P228);
    TrieSetCell(tWeaponsIds, "scout", CSW_SCOUT);
    TrieSetCell(tWeaponsIds, "hegrenade", CSW_HEGRENADE);
    TrieSetCell(tWeaponsIds, "xm1014", CSW_XM1014);
    TrieSetCell(tWeaponsIds, "c4", CSW_C4);
    TrieSetCell(tWeaponsIds, "mac10", CSW_MAC10);
    TrieSetCell(tWeaponsIds, "aug", CSW_AUG);
    TrieSetCell(tWeaponsIds, "smokegrenade", CSW_SMOKEGRENADE);
    TrieSetCell(tWeaponsIds, "elite", CSW_ELITE);
    TrieSetCell(tWeaponsIds, "fiveseven", CSW_FIVESEVEN);
    TrieSetCell(tWeaponsIds, "ump45", CSW_UMP45);
    TrieSetCell(tWeaponsIds, "sg550", CSW_SG550);
    TrieSetCell(tWeaponsIds, "galil", CSW_GALIL);
    TrieSetCell(tWeaponsIds, "famas", CSW_FAMAS);
    TrieSetCell(tWeaponsIds, "usp", CSW_USP);
    TrieSetCell(tWeaponsIds, "glock18", CSW_GLOCK18);
    TrieSetCell(tWeaponsIds, "awp", CSW_AWP);
    TrieSetCell(tWeaponsIds, "mp5navy", CSW_MP5NAVY);
    TrieSetCell(tWeaponsIds, "m249", CSW_M249);
    TrieSetCell(tWeaponsIds, "m3", CSW_M3);
    TrieSetCell(tWeaponsIds, "m4a1", CSW_M4A1);
    TrieSetCell(tWeaponsIds, "tmp", CSW_TMP);
    TrieSetCell(tWeaponsIds, "g3sg1", CSW_G3SG1);
    TrieSetCell(tWeaponsIds, "flashbang", CSW_FLASHBANG);
    TrieSetCell(tWeaponsIds, "deagle", CSW_DEAGLE);
    TrieSetCell(tWeaponsIds, "sg552", CSW_SG552);
    TrieSetCell(tWeaponsIds, "ak47", CSW_AK47);
    TrieSetCell(tWeaponsIds, "knife", CSW_KNIFE);
    TrieSetCell(tWeaponsIds, "p90", CSW_P90);

    new c, iExtPos, bShieldModel;
    while(!feof(iFile))
    {
        fgets(iFile, szDatas, charsmax(szDatas));
        trim(szDatas);
        if(!(c=szDatas[0]) || c == ';' || c == '#' || (c == '/' && szDatas[1] == '/'))
        {
            continue;
        }

        if(        parse(szDatas, szOldModel, charsmax(szOldModel), szNewModel, charsmax(szNewModel)) == 2
        &&    file_exists(szNewModel)    )
        {
            // models/[p/v]_
            // models/shield/[p/v]_shield_
            bShieldModel = equal(szOldModel, "models/shield/", 14);
            if( ( (c=szOldModel[bShieldModel ? 14 : 7]) == 'p' || c == 'v' ) && szOldModel[bShieldModel ? 15 : 8] == '_' )
            {
                if( equal(szOldModel[9], "mp5", 3 ) )
                {
                    copy(szWeaponClass, charsmax(szWeaponClass), "weapon_mp5navy");
                }
                else
                {
                    iExtPos = strlen(szOldModel) - 4;
                    szOldModel[ iExtPos ] = EOS;
                    formatex(szWeaponClass, charsmax(szWeaponClass), "weapon_%s", szOldModel[bShieldModel ? 23 : 9]);
                    szOldModel[ iExtPos ] = '.';
                }
                
                if( !TrieGetCell(tWeaponsIds, szWeaponClass[7], iId) )
                {
                    continue;
                }

                if( c == 'v' )
                {
                    if( !g_tiszViewModels )
                    {
                        g_tiszViewModels = TrieCreate();
                    }

                    TrieSetCell(g_tiszViewModels, szOldModel, EF_AllocString( szNewModel ) );
                }
                else
                {
                    if( !g_tiszWeaponModels )
                    {
                        g_tiszWeaponModels = TrieCreate();
                    }
                    
                    TrieSetCell(g_tiszWeaponModels, szOldModel, EF_AllocString( szNewModel ) );
                }
                
                if( !TrieKeyExists(tRegisterWeaponDeploy, szWeaponClass) )
                {
                    TrieSetCell
                    (
                        tRegisterWeaponDeploy,
                        szWeaponClass,
                        RegisterHam(Ham_Item_Deploy, szWeaponClass, "OnCBasePlayerWeapon_Deploy_P", true)
                    );
                }
            }
            else
            {
                if( !g_tszWorldModels )
                {
                    g_tszWorldModels = TrieCreate();
                }
                else if( TrieKeyExists(g_tszWorldModels, szOldModel) )
                {
                    new szModel[MAX_MODEL_LENGTH];
                    TrieGetString(g_tszWorldModels, szOldModel, szModel, charsmax(szModel));
                    log_amx("%s world model is already set to %s, can't set it to %s !!", szWeaponClass, szModel, szNewModel);
                    continue;
                }
                TrieSetString(g_tszWorldModels, szOldModel, szNewModel);
            }

            if( !g_tiPrecacheReturns )
            {
                g_tiPrecacheReturns = TrieCreate();
            }
            TrieSetCell(g_tiPrecacheReturns, szOldModel, EF_PrecacheModel(szNewModel));
#if defined DONT_BLOCK_PRECACHE
            EF_PrecacheModel(szOldModel);
#endif
        }
    }
    fclose(iFile);

    TrieDestroy(tRegisterWeaponDeploy);
    TrieDestroy(tWeaponsIds);

    if( g_tiPrecacheReturns )
    {
        register_forward(FM_PrecacheModel, "OnPrecacheModel");

        if( g_tszWorldModels )
        {
            register_forward(FM_SetModel, "OnSetModel");
        }
    }
}

public plugin_init()
{
    register_plugin("[CS:GO MOD] Weapons Replace", "1.2", "ConnorMcLeod");
}

public OnPrecacheModel(const szModel[])
{
    static iReturn;
    if( TrieGetCell(g_tiPrecacheReturns, szModel, iReturn) && !equali(szModel, "models/w_backpack.mdl"))
    {
        forward_return(FMV_CELL, iReturn);
        return FMRES_SUPERCEDE;
    }
    return FMRES_IGNORED;
}

public OnCBasePlayerWeapon_Deploy_P( iWeapon )
{
    new id = get_pdata_cbase(iWeapon, m_pPlayer, XO_WEAPON);
    if( pev_valid(id) == 2 && get_pdata_cbase(id, m_pActiveItem) == iWeapon )
    {
        new iszNewModel, szOldModel[MAX_MODEL_LENGTH];
        if( g_tiszViewModels )
        {
            pev(id, pev_viewmodel2, szOldModel, charsmax(szOldModel));
            if( TrieGetCell(g_tiszViewModels, szOldModel, iszNewModel) )
            {
                set_pev(id, pev_viewmodel, iszNewModel);
            }
        }
        if( g_tiszWeaponModels )
        {
            pev(id, pev_weaponmodel2, szOldModel, charsmax(szOldModel));
            if( TrieGetCell(g_tiszWeaponModels, szOldModel, iszNewModel) )
            {
                set_pev(id, pev_weaponmodel, iszNewModel);
            }
        }
    }
}

public OnSetModel(const iEnt, const szModel[])
{
    new szNewModel[MAX_MODEL_LENGTH];
    if( TrieGetString(g_tszWorldModels, szModel, szNewModel, charsmax(szNewModel)) )
    {
        EF_SetModel(iEnt, szNewModel);
        return FMRES_SUPERCEDE;
    }
    return FMRES_IGNORED;
}
 

Вложения

Top4ik

Пользователь
Регистрация
10 Фев 2020
Сообщения
54
Симпатии
4
Top4ik,
C++:
// #define DONT_BLOCK_PRECACHE

#include <amxmodx>
#include <fakemeta_stocks>
#include <hamsandwich>

#pragma semicolon 1

const MAX_MODEL_LENGTH = 64;

const m_pActiveItem = 373;

const XO_WEAPON = 4;
const m_pPlayer = 41;

new Trie:g_tszWorldModels; // handles new models strings (all excepted v_ and w_ models)
new Trie:g_tiPrecacheReturns; // handles all new models precache returns integers
new Trie:g_tiszViewModels;
new Trie:g_tiszWeaponModels;

public plugin_precache()
{
    new szModelsFile[128];
    get_localinfo("amxx_configsdir", szModelsFile, charsmax(szModelsFile));
    add(szModelsFile, charsmax(szModelsFile), "/csgo/csgo_weapons.ini");

    new iFile = fopen(szModelsFile, "rt");
    if(!iFile)
    {
        return;
    }

    new szDatas[192], szOldModel[MAX_MODEL_LENGTH], szNewModel[MAX_MODEL_LENGTH];
    new szWeaponClass[32], Trie:tRegisterWeaponDeploy = TrieCreate(), iId;

    new Trie:tWeaponsIds = TrieCreate();
    TrieSetCell(tWeaponsIds, "p228", CSW_P228);
    TrieSetCell(tWeaponsIds, "scout", CSW_SCOUT);
    TrieSetCell(tWeaponsIds, "hegrenade", CSW_HEGRENADE);
    TrieSetCell(tWeaponsIds, "xm1014", CSW_XM1014);
    TrieSetCell(tWeaponsIds, "c4", CSW_C4);
    TrieSetCell(tWeaponsIds, "mac10", CSW_MAC10);
    TrieSetCell(tWeaponsIds, "aug", CSW_AUG);
    TrieSetCell(tWeaponsIds, "smokegrenade", CSW_SMOKEGRENADE);
    TrieSetCell(tWeaponsIds, "elite", CSW_ELITE);
    TrieSetCell(tWeaponsIds, "fiveseven", CSW_FIVESEVEN);
    TrieSetCell(tWeaponsIds, "ump45", CSW_UMP45);
    TrieSetCell(tWeaponsIds, "sg550", CSW_SG550);
    TrieSetCell(tWeaponsIds, "galil", CSW_GALIL);
    TrieSetCell(tWeaponsIds, "famas", CSW_FAMAS);
    TrieSetCell(tWeaponsIds, "usp", CSW_USP);
    TrieSetCell(tWeaponsIds, "glock18", CSW_GLOCK18);
    TrieSetCell(tWeaponsIds, "awp", CSW_AWP);
    TrieSetCell(tWeaponsIds, "mp5navy", CSW_MP5NAVY);
    TrieSetCell(tWeaponsIds, "m249", CSW_M249);
    TrieSetCell(tWeaponsIds, "m3", CSW_M3);
    TrieSetCell(tWeaponsIds, "m4a1", CSW_M4A1);
    TrieSetCell(tWeaponsIds, "tmp", CSW_TMP);
    TrieSetCell(tWeaponsIds, "g3sg1", CSW_G3SG1);
    TrieSetCell(tWeaponsIds, "flashbang", CSW_FLASHBANG);
    TrieSetCell(tWeaponsIds, "deagle", CSW_DEAGLE);
    TrieSetCell(tWeaponsIds, "sg552", CSW_SG552);
    TrieSetCell(tWeaponsIds, "ak47", CSW_AK47);
    TrieSetCell(tWeaponsIds, "knife", CSW_KNIFE);
    TrieSetCell(tWeaponsIds, "p90", CSW_P90);

    new c, iExtPos, bShieldModel;
    while(!feof(iFile))
    {
        fgets(iFile, szDatas, charsmax(szDatas));
        trim(szDatas);
        if(!(c=szDatas[0]) || c == ';' || c == '#' || (c == '/' && szDatas[1] == '/'))
        {
            continue;
        }

        if(        parse(szDatas, szOldModel, charsmax(szOldModel), szNewModel, charsmax(szNewModel)) == 2
        &&    file_exists(szNewModel)    )
        {
            // models/[p/v]_
            // models/shield/[p/v]_shield_
            bShieldModel = equal(szOldModel, "models/shield/", 14);
            if( ( (c=szOldModel[bShieldModel ? 14 : 7]) == 'p' || c == 'v' ) && szOldModel[bShieldModel ? 15 : 8] == '_' )
            {
                if( equal(szOldModel[9], "mp5", 3 ) )
                {
                    copy(szWeaponClass, charsmax(szWeaponClass), "weapon_mp5navy");
                }
                else
                {
                    iExtPos = strlen(szOldModel) - 4;
                    szOldModel[ iExtPos ] = EOS;
                    formatex(szWeaponClass, charsmax(szWeaponClass), "weapon_%s", szOldModel[bShieldModel ? 23 : 9]);
                    szOldModel[ iExtPos ] = '.';
                }
               
                if( !TrieGetCell(tWeaponsIds, szWeaponClass[7], iId) )
                {
                    continue;
                }

                if( c == 'v' )
                {
                    if( !g_tiszViewModels )
                    {
                        g_tiszViewModels = TrieCreate();
                    }

                    TrieSetCell(g_tiszViewModels, szOldModel, EF_AllocString( szNewModel ) );
                }
                else
                {
                    if( !g_tiszWeaponModels )
                    {
                        g_tiszWeaponModels = TrieCreate();
                    }
                   
                    TrieSetCell(g_tiszWeaponModels, szOldModel, EF_AllocString( szNewModel ) );
                }
               
                if( !TrieKeyExists(tRegisterWeaponDeploy, szWeaponClass) )
                {
                    TrieSetCell
                    (
                        tRegisterWeaponDeploy,
                        szWeaponClass,
                        RegisterHam(Ham_Item_Deploy, szWeaponClass, "OnCBasePlayerWeapon_Deploy_P", true)
                    );
                }
            }
            else
            {
                if( !g_tszWorldModels )
                {
                    g_tszWorldModels = TrieCreate();
                }
                else if( TrieKeyExists(g_tszWorldModels, szOldModel) )
                {
                    new szModel[MAX_MODEL_LENGTH];
                    TrieGetString(g_tszWorldModels, szOldModel, szModel, charsmax(szModel));
                    log_amx("%s world model is already set to %s, can't set it to %s !!", szWeaponClass, szModel, szNewModel);
                    continue;
                }
                TrieSetString(g_tszWorldModels, szOldModel, szNewModel);
            }

            if( !g_tiPrecacheReturns )
            {
                g_tiPrecacheReturns = TrieCreate();
            }
            TrieSetCell(g_tiPrecacheReturns, szOldModel, EF_PrecacheModel(szNewModel));
#if defined DONT_BLOCK_PRECACHE
            EF_PrecacheModel(szOldModel);
#endif
        }
    }
    fclose(iFile);

    TrieDestroy(tRegisterWeaponDeploy);
    TrieDestroy(tWeaponsIds);

    if( g_tiPrecacheReturns )
    {
        register_forward(FM_PrecacheModel, "OnPrecacheModel");

        if( g_tszWorldModels )
        {
            register_forward(FM_SetModel, "OnSetModel");
        }
    }
}

public plugin_init()
{
    register_plugin("[CS:GO MOD] Weapons Replace", "1.2", "ConnorMcLeod");
}

public OnPrecacheModel(const szModel[])
{
    static iReturn;
    if( TrieGetCell(g_tiPrecacheReturns, szModel, iReturn) && !equali(szModel, "models/w_backpack.mdl"))
    {
        forward_return(FMV_CELL, iReturn);
        return FMRES_SUPERCEDE;
    }
    return FMRES_IGNORED;
}

public OnCBasePlayerWeapon_Deploy_P( iWeapon )
{
    new id = get_pdata_cbase(iWeapon, m_pPlayer, XO_WEAPON);
    if( pev_valid(id) == 2 && get_pdata_cbase(id, m_pActiveItem) == iWeapon )
    {
        new iszNewModel, szOldModel[MAX_MODEL_LENGTH];
        if( g_tiszViewModels )
        {
            pev(id, pev_viewmodel2, szOldModel, charsmax(szOldModel));
            if( TrieGetCell(g_tiszViewModels, szOldModel, iszNewModel) )
            {
                set_pev(id, pev_viewmodel, iszNewModel);
            }
        }
        if( g_tiszWeaponModels )
        {
            pev(id, pev_weaponmodel2, szOldModel, charsmax(szOldModel));
            if( TrieGetCell(g_tiszWeaponModels, szOldModel, iszNewModel) )
            {
                set_pev(id, pev_weaponmodel, iszNewModel);
            }
        }
    }
}

public OnSetModel(const iEnt, const szModel[])
{
    new szNewModel[MAX_MODEL_LENGTH];
    if( TrieGetString(g_tszWorldModels, szModel, szNewModel, charsmax(szNewModel)) )
    {
        EF_SetModel(iEnt, szNewModel);
        return FMRES_SUPERCEDE;
    }
    return FMRES_IGNORED;
}
Огромное спасибо,пока всё хорошо,вроде перестал падать,вот что значит голова и руки золотые!От души благодарен!
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу