- Ошибка
-
FATAL ERROR (shutting down): SV_ModelIndex: SV_ModelIndex: model models/shpric/p_injectorrbl.mdl not precached
./hlds_run: line 272: 8314 Segmentation fault $HL_CMD
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.9.0.5294 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Dec 3 2021 15:54:56
Built from: https://github.com/alliedmodders/amxmodx/commit/363871a
Build ID: 5294:363871a
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.13.0.788-dev
Build date: 12:57:18 Jul 24 2023 (3390)
Build from: https://github.com/dreamstalker/rehlds/commit/f955b07
- ReGamedll
-
ReGameDLL version: 5.26.0.668-dev
Build date: 19:02:48 Dec 31 2023
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/d3c0ec8
- Версия Metamod
-
Metamod v1.21p37 2013/05/30 (5:13)
by Will Day
http://www.metamod.org/
Patch: Metamod-P (mm-p) v37
by Jussi Kivilinna
http://metamod-p.sourceforge.net/
compiled: May 30 2013, 11:41:16 EET (optimized)
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] Reunion RUN - reunion_mm_i386. v0.1.92d ini Start Never
[ 2] VoiceTranscoder RUN - VoiceTranscoder. v2017RC5 ini ANY ANY
[ 3] AMX Mod X RUN - amxmodx_mm_i386. v1.9.0.5 ini Start ANY
[ 4] Rechecker RUN - rechecker_mm_i38 v2.7 ini Chlvl ANY
[ 5] ReSRDetector RUN - resrdetector_mm_ v0.1.0 ini Chlvl ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i38 v1.5.697 ini Chlvl ANY
[ 8] HitBox Fix RUN - hitbox_fix_mm_i3 v1.1.5 ini Start ANY
[ 9] Admins Kit RUN - adminskit_amxx_i v2.1.1 pl3 ANY Never
[10] IPHub Client RUN - iphubclient_amxx v1.0.1 pl3 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i3 v1.9.0.5 pl3 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl3 ANY ANY
[13] MySQL RUN - mysql_amxx_i386. v1.9.0.5 pl3 ANY ANY
[14] Engine RUN - engine_amxx_i386 v1.9.0.5 pl3 ANY ANY
[15] GeoIP RUN - geoip_amxx_i386. v1.9.0.5 pl3 ANY ANY
[16] ReAPI RUN - reapi_amxx_i386. v5.24.0. pl3 ANY Never
[17] ReAimDetector RUN - reaimdetector_am v0.2.2 pl3 ANY Never
[18] VTC AMXX API RUN - VtcApi_amxx_i386 v2017 RC pl3 ANY ANY
[19] CStrike RUN - cstrike_amxx_i38 v1.9.0.5 pl3 ANY ANY
[20] SQLite RUN - sqlite_amxx_i386 v1.9.0.5 pl3 ANY ANY
[21] Fun RUN - fun_amxx_i386.so v1.9.0.5 pl3 ANY ANY
[22] Amxx Easy Http RUN - easy_http_amxx_i v1.3.0 pl3 ANY ANY
[23] CSX RUN - csx_amxx_i386.so v1.9.0.5 pl3 ANY ANY
23 plugins, 23 running
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] DopBan 3.0.3b kanagava dop_ban303_.amx running
[ 2] Map Manager: Core 3.2.1 Mistrick map_manager_cor running
[ 3] [190] Analizator 22.12.07BE SKAJIbnEJIb analizator.amxx running
[ 4] Map Manager: Scheduler 0.2.1 Mistrick map_manager_sch running
[ 5] Admin Mapmenu 0.5.3 d3m37r4 admin_mapmenu.a running
[ 6] Map Manager: Rtv 0.1.5 Mistrick map_manager_rtv running
[ 7] Map Manager: Nominatio 0.3.5 Mistrick map_manager_nom running
[ 8] Map Manager: BlockList 0.0.4 Mistrick map_manager_blo running
[ 9] Map Manager: Online so 0.0.4 Mistrick map_manager_onl running
[ 10] Map Manager: Effects 0.1.3 Mistrick map_manager_eff running
[ 11] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 12] Map Manager: Advanced 0.1.0 Mistrick map_manager_adv running
[ 13] Map Manager: Sounds 0.0.3 Mistrick map_manager_sou running
[ 14] [190] Cvar On Map 20.06.06 SKAJIbnEJIb cvar_on_map.amx running
[ 15] Mode 2x2 2.5re s1lent mode.amxx running
[ 16] FreshBans 1.4.6b kanagava fresh_bans_146- running
[ 17] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 18] [190] Vanga Detector 24.09.07 SKAJIbnEJIb & Pr vanga_detector. running
[ 19] Menus Front-End 20.06.06 SKAJIbnEJIb & AM amxmodmenu_rbs. running
[ 20] Ping Checker 26.0.1 RC1 h1k3 ping_checker.am running
[ 21] [190] Ultimate Gag 21.01.02BE SKAJIbnEJIb ultimate_gag.am running
[ 22] [VTC][183] Ultimate Ga 17.08.28 SKAJIbnEJIb ultimate_gag_vt running
[ 23] [190] AdminCmd RBS 22.11.15 SKAJIbnEJIb & AM admincmd_rbs.am running
[ 24] GameCMS_API 5.6.1 zhorzh78 gamecms_api_5.6 running
[ 25] GameCMS Stats Pigs 1.0 OverGame gamecms_stats_p running
[ 26] Knife Skins 2.0.0 Emma Jule knife_skins_v3. running
[ 27] GameCMS_Registration 1.5 nb zhorzh78 gamecms_registr running
[ 28] GameCMS_Present 1.6.22 nb zhorzh78 gamecms_present running
[ 29] GameCMS_Present Coins 1.1 zhorzh78 presents_coins_ running
[ 30] [AMXX+GameCMS] Clan Sy 3.4 Yalta-cs clan_system_vk_ running
[ 31] test.amxx running
[ 32] Bad nick 1.1 pike Bad_nick.amxx running
[ 33] unknown unknown unknown Server-Side_Smo running
[ 34] GameCMS_Informer 2.3 API5 zhorzh78 forum_HUD_infor running
[ 35] Telegram Reports Sende 3.0.0 @pywave & Albert telegram_report running
[ 36] Players models 1.0 django modelsrbl.amxx running
[ 37] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 38] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 39] Unreal Spawn Fixer 1.2 karaulov unreal_spawn_fi running
[ 40] [190] AdminChat RBS 22.11.15 SKAJIbnEJIb adminchat_rbs.a running
[ 41] Items Restrict 1.1 s1lent items_restrict. running
[ 42] [190] CsStats MySQL 22.11.15 SKAJIbnEJIb csstats_mysql.a running
[ 43] [190] StatsX Unlimited 22.12.08 SKAJIbnEJIb statsx_unlimite running
[ 44] [190] StatsX RBS 24.10.11BE SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 45] [190] Stats Configurat 24.10.11BE SKAJIbnEJIb & AM statscfg_rbs.am running
[ 46] Kill Sounds 0.1 Vaqtincha Kill_Sounds.amx paused
[ 47] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 48] [190] Army Ranks Ultim 24.10.08BE SKAJIbnEJIb army_ranks_ulti running
[ 49] [190] BonusMenu RBS 22.12.07BE SKAJIbnEJIb bonusmenu_rbs.a running
[ 50] Rcon Shop 0.4 b0t. RconShop.amxx running
[ 51] [190] Ultimate Informe 21.03.23 SKAJIbnEJIb ultimate_inform running
[ 52] [190] Skill ELO 22.11.15 SKAJIbnEJIb skill_elo.amxx running
[ 53] [190] Chat RBS 24.10.11BE SKAJIbnEJIb chat_rbs.amxx running
[ 54] [190] Snipers RBS 20.06.06 SKAJIbnEJIb snipers_rbs.amx running
[ 55] ACS injection med-kit 1.0.6.2 DEV-CS.RU acs.amxx running
[ 56] [ACS] INJECTION BonusM 1.0 mx?! acs_injection_b running
[ 57] [ReAPI] Healthnade 0.1.7.2 F@nt0M + mx?! reapi_healthnad running
[ 58] [ReAPI] TopRoundDamage 1.0.6 Dager* *.* -G- damage_round.am running
[ 59] Killer ScreenFade 0.0.5 Vaqtincha reapi_killer_sc running
[ 60] [190] Ultimate Weapons 24.10.08BE SKAJIbnEJIb ultimate_weapon running
[ 61] [190] VIP RBS 24.10.11BE SKAJIbnEJIb vip_rbs.amxx running
[ 62] MultiJump 1.0.0 Nordic Warrior multijump.amxx running
[ 63] [190] Warmup RBS 21.03.23 SKAJIbnEJIb warmup_rbs.amxx running
[ 64] Simple Damager 2.1.0 fl0wer simple_damager. running
[ 65] [190] Screen Player 24.10.10BE SKAJIbnEJIb screen_player.a running
[ 66] C4 Timer on roundtime 0.3.3a neygomon c4timer.amxx running
[ 67] Bomb Taker 0.0.2b Vaqtincha c4_taker.amxx running
[ 68] [190] CmdMenu RBS 20.06.06 SKAJIbnEJIb & AM cmdmenu_rbs.amx running
[ 69] Reset Score 1.0 M1 TEAM ResetScore.amxx running
[ 70] Parachute Lite [ReAPI] 11.0 Leo_[BH] parachute_lite. running
[ 71] Reklama 20.05.2020 mx?! reklama.amxx running
[ 72] Demo Recorder 2.4.1 F@nt0M demo_recorder.a running
[ 73] [190] AfkKicker RBS 22.11.15 SKAJIbnEJIb afkkicker_rbs.a running
[ 74] Block grande info soun 1.0 neygomon block_granade_i running
[ 75] Advanced Kill Assists 1.3d Xelson next21_kill_ass running
[ 76] [190] Ultimate Flags 22.11.15 SKAJIbnEJIb ultimate_flags. running
[ 77] [190] SlayLosers RBS 20.06.06 SKAJIbnEJIb & d3 slaylosers_rbs. running
[ 78] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash.a running
[ 79] NameChangeTime 0.0.1 Vaqtincha block_change_ni running
[ 80] [190] FG RconShop 24.10.10BE SKAJIbnEJIb fg_rconshop.amx running
[ 81] Molotov Cocktail API 2.16 CHEL74 + mx?! molotov_cocktai running
[ 82] Molotov Cocktail Spawn 1.5 mx?! molotov_cocktai running
[ 83] Molotov Cocktail Bonus 1.2 mx?! molotov_cocktai running
[ 84] Molotov get_user_attac 1.0 mx?! molotov_get_use running
[ 85] Molotov Kill Rewards 1.2 mx?! molotov_kill_re running
[ 86] HolyGrenade: Core 1.0 CHEL74 holygrenade_cor paused
[ 87] Holygrenade: Addon 1.0 CHEL74 holygrenade_spa paused
[ 88] Artifact Bomb: Core 1.0.1 CHEL74 weapon_artifact running
[ 89] Artifact: Spawn Equip 1.0 CHEL74 artifact_spawn_ running
[ 90] Revive Teammates: Core 1.1.7 ufame & Albertio rt_core.amxx running
[ 91] Revive Teammates: Plan 1.1.7 ufame & Albertio rt_planting.amx running
[ 92] Revive Teammates: Rest 1.1.7 ufame & Albertio rt_restrictions running
[ 93] Revive Teammates: Time 1.1.7 ufame & Albertio rt_timer.amxx running
[ 94] Revive Teammates: Effe 1.1.7 ufame & Albertio rt_effects.amxx running
[ 95] Revive Teammates: Bonu 1.1.7 ufame & Albertio rt_bonus.amxx running
95 plugins, 92 running
- Автор плагина
- https://dev-cs.ru/members/10396/
- Версия плагина
- [ACS] INJECTION 1.0.6.2
- Исходный код
-
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>
#include <reapi>
#define ACS_INJ_SOUND_NOTIFY "buttons/bell1.wav"
#define ACS_INJ_SOUND_REJECT "buttons/button2.wav"
#define is_valid_player(%0) bool:is_user_connected(%0)
#define FFADE_IN 0x0000 // Just here so we don't pass 0 into the function
#define FFADE_OUT 0x0001 // Fade out (not in)
#define FFADE_MODULATE 0x0002 // Modulate (don't blend)
#define FFADE_STAYOUT 0x0004 // ignores the duration, stays faded out until new ScreenFade message received
static Float:gf_cure_time[MAX_PLAYERS + 1];
static gi_cure_speed[MAX_PLAYERS + 1];
enum _:ACS_STOP_THROTTLING {
bool:FLAG,
Float:LAST_USAGE
}; new ACS_PRINT_THR[MAX_PLAYERS + 1][ACS_STOP_THROTTLING];
enum _:CVARS {
PREFIX[64], ACCESS[32], ACCESS_2[32], COMMANDS[512], SPAWN_BONUS_COUNT, SPAWN_BONUS_STEAM_COUNT, USE_METHOD, SPEED, SPEED_DYNAMIC, BLOCK, Float:NEXT_ATTACK,
HEALTH, MAX_TIMES, MAX_COUNT, SEQUENCE, COST, BAR, VIP, DIFF, DIFF_MODE, KILL, V_MODEL[MAX_RESOURCE_PATH_LENGTH], P_MODEL[MAX_RESOURCE_PATH_LENGTH],
PRE_SAMPLE[MAX_RESOURCE_PATH_LENGTH], SAMPLE[MAX_RESOURCE_PATH_LENGTH], CHEAT, ENABLE, SPAWN, AES_BUY_COUNT, CMD_COUNT, NOTIFY_MODE, NOTIFY_SOUND_MODE
}; new CVAR[CVARS];
enum _:INJECT_DATA {
USED, COUNT, bool:IS_STEAM, Float:REMAINS_INJECT, bool:IS_INJECT, WEAPON
}; new acs_injections[MAX_PLAYERS + 1][INJECT_DATA];
#define ACS_INJ_SOUND_MASK (~30) // Какие сообщения выводить без звукового сопровождения и контроля троттлинга
enum _:NOTIFY_MODE {
INJ_SHOW_GET = 1, // Сопровождается звуком NOTIFY (сообщение с уведомлением о способе использования шпирца)
INJ_SHOW_TOTAL = 2, // Без звука
INJ_SHOW_LEFT = 4, // Без звука
INJ_SHOW_PARTIAL = 8, // Без звука
INJ_SHOW_FULL = 16, // Без звука
INJ_SHOW_FADE = 32, // Сопровождается звуком исцеления
INJ_SHOW_BLINK = 64, // Сопровождается звуком REJECT
INJ_SHOW_ERROR = 128 // Сопровождается звуком REJECT
}
public plugin_precache() {
register_plugin("ACS injection med-kit", "1.0.6.2", "DEV-CS.RU");
acs_create_cvars();
}
public plugin_natives() {
register_native("acs_inj_get_user_injections", "native_acs_inj_get_injections");
register_native("acs_inj_add_user_injections", "native_acs_inj_add_injections");
register_native("acs_inj_reset_user_injections", "native_acs_inj_reset_injections");
register_native("acs_inj_get_user_injects", "native_acs_inj_get_injects");
register_native("acs_inj_is_user_injected", "native_acs_inj_is_injected");
register_native("acs_inj_is_user_injection", "native_acs_inj_is_injection");
}
public plugin_init() {
if (register_dictionary("acs_injection.txt") == 0)
server_print("[ACS_INJECT] Error: not fount dictionary <acs_injection.txt>");
RegisterHamPlayer(Ham_Spawn, "CBasePlayer_Spawn", .Post = true);
RegisterHamPlayer(Ham_Killed, "CBasePlayer_Killed", .Post = true);
register_event("CurWeapon", "check_weapon", "be", "1=1");
RegisterHam(Ham_Item_Deploy, "weapon_knife", "CBasePlayerWeapon_Deploy", .Post = true);
RegisterHam(Ham_Item_CanHolster, "weapon_knife", "CBasePlayerWeapon_CanHolster");
}
public client_putinserver(id) {
// Используем STEAM только если игрок не соответствует флагам доступа (чтобы различить количество выдаваемых в начале раунда шприцов по кварам)
acs_injections[id][IS_STEAM] = (CVAR[SPAWN_BONUS_STEAM_COUNT] && (!((get_user_flags(id) & read_flags(CVAR[ACCESS])) || (!read_flags(CVAR[ACCESS])))) && is_user_steam(id));
acs_injections[id][COUNT]
= acs_injections[id][USED]
= 0;
acs_injections[id][REMAINS_INJECT] = 0.0;
acs_injections[id][IS_INJECT] = false;
}
public client_disconnected(id) {
// Ждем вас снова!
}
public CBasePlayer_OnSpawnEquip(id) {
if (CVAR[SPAWN])
acs_injections[id][COUNT] = 0;
if (acs_inj_check_access(id))
acs_inj_add_injection_count(id, (acs_injections[id][IS_STEAM] ? CVAR[SPAWN_BONUS_STEAM_COUNT] : CVAR[SPAWN_BONUS_COUNT]));
}
public CBasePlayer_Spawn(id) {
acs_injections[id][IS_INJECT] = false;
acs_injections[id][REMAINS_INJECT] = 0.0;
acs_injections[id][USED] = 0;
}
public CBasePlayer_Killed(id) {
acs_injections[id][IS_INJECT] = false;
acs_injections[id][REMAINS_INJECT] = 0.0;
acs_injections[id][USED] = 0;
if (CVAR[KILL])
acs_injections[id][COUNT] = 0;
}
public check_weapon(id) {
// Если во время анимации переключили оружие, останавливаем лечение
if ((!CVAR[BLOCK]) && acs_injections[id][IS_INJECT] && get_member(id, m_pActiveItem) != get_member(id, m_rgpPlayerItems, KNIFE_SLOT))
acs_injections[id][IS_INJECT] = false;
return;
}
public bool:Command_BuyMedkit(id) {
return acs_inj_add_injection_count(id, CVAR[AES_BUY_COUNT]);
}
public bool:acs_inj_check_access(id) {
return is_valid_player(id) ? ((get_user_flags(id) & read_flags(CVAR[ACCESS])) || (!read_flags(CVAR[ACCESS])) || (get_user_flags(id) & read_flags(CVAR[ACCESS_2])) || (!read_flags(CVAR[ACCESS_2])) || acs_injections[id][IS_STEAM]) : false;
}
public bool:acs_inj_add_injection_count(id, count) {
static bool:b_result, i_count;
if ((b_result = (count > 0))) {
if ((b_result = (acs_injections[id][USED] < CVAR[MAX_TIMES]))) {
if ((b_result = (acs_injections[id][COUNT] < CVAR[MAX_COUNT]))) {
// Если выдаем (покупаем) больше лимита - обрезаем под лимит, чтобы получить хоть сколько-нибудь шприцов, а не ошибку
i_count = ((acs_injections[id][COUNT] + count) <= CVAR[MAX_COUNT]) ? count : (CVAR[MAX_COUNT] - acs_injections[id][COUNT]);
acs_injections[id][COUNT] += i_count;
if (i_count == 1)
acs_client_print(id, INJ_SHOW_GET, "%L", id, "INJ_GET_INJECT");
else
acs_client_print(id, INJ_SHOW_GET, "%L", id, "INJ_GET_INJECT_COUNT", i_count, fmt("%L", id, fmt("INJ_COUNT_%d_SUFFIX", (i_count % 10))));
if (acs_injections[id][COUNT] > 1)
acs_client_print(id, INJ_SHOW_TOTAL, "%L", id, "INJ_TOTAL_COUNT", acs_injections[id][COUNT], fmt("%L", id, fmt("INJ_COUNT_%d_SUFFIX", acs_injections[id][COUNT] % 10)));
} else
acs_client_print(id, INJ_SHOW_ERROR, "%L", id, "INJ_MAX_COUNT");
} else
acs_client_print(id, INJ_SHOW_ERROR, "%L", id, "INJ_LIMIT");
}
return b_result;
}
public cmd_injection(id) {
if (acs_inj_check_access(id)) {
if (acs_inj_can_get_inject(id))
acs_inj_add_injection_count(id, CVAR[CMD_COUNT]);
} else
acs_client_print(id, INJ_SHOW_ERROR, "%L", id, "INJ_ACCESS");
return PLUGIN_HANDLED;
}
public @use_injection(id)
{
static p_result, Float:f_inj_time, Float:CUR_HEALTH, Float:MAX_HEALTH, Float:HEALTH_UP;
p_result = PLUGIN_CONTINUE;
if (acs_inj_can_use_inject(id)) {
acs_injections[id][WEAPON] = get_member(id, m_pActiveItem);
CUR_HEALTH = Float:get_entvar(id, var_health);
MAX_HEALTH = Float:get_entvar(id, var_max_health);
// Если лечим не до максимального уровня, проверяем остаток
if (CVAR[HEALTH] > 0)
// Если Не закончили лечение, продолжаем
if (acs_injections[id][REMAINS_INJECT] > 0)
HEALTH_UP = acs_injections[id][REMAINS_INJECT];
// Иначе начинаем новое
else
HEALTH_UP = float(CVAR[HEALTH]);
else
HEALTH_UP = MAX_HEALTH - CUR_HEALTH;
acs_injections[id][REMAINS_INJECT] = HEALTH_UP;
switch (CVAR[SPEED_DYNAMIC]) {
case 1: gi_cure_speed[id] = floatround(CVAR[SPEED] * (CUR_HEALTH / (MAX_HEALTH - CVAR[HEALTH]))) + 2;
case 2: gi_cure_speed[id] = floatround(CVAR[SPEED] * (HEALTH_UP / CVAR[HEALTH])) + 2;
case 3: gi_cure_speed[id] = floatround(CVAR[SPEED] * (CUR_HEALTH / (MAX_HEALTH - CVAR[HEALTH])) * (HEALTH_UP / CVAR[HEALTH])) + 2;
default: gi_cure_speed[id] = CVAR[SPEED];
}
f_inj_time = acs_injections[id][REMAINS_INJECT] / gi_cure_speed[id];
//console_print(id, "[DEBUG] CURR = %f, MAX = %f, SPEED = %d, TIME = %f", CUR_HEALTH, MAX_HEALTH, gi_cure_speed[id], f_inj_time);
rg_switch_weapon(id, get_member(id, m_rgpPlayerItems, KNIFE_SLOT));
if (CVAR[V_MODEL][0] && CVAR[P_MODEL][0]) {
set_entvar(id, var_viewmodel, CVAR[V_MODEL]);
set_entvar(id, var_weaponmodel, CVAR[P_MODEL]);
acs_send_weapon_anim(id, CVAR[SEQUENCE]);
}
set_member(id, m_flNextAttack, f_inj_time);
if (CVAR[BAR] && f_inj_time > 1.0)
rg_send_bartime(id, floatround(f_inj_time));
if (CVAR[PRE_SAMPLE][0])
rh_emit_sound2(id, 0, CHAN_ITEM, CVAR[PRE_SAMPLE]);
gf_cure_time[id] = 0.0;
acs_injections[id][IS_INJECT] = true;
//console_print(id, "[DEBUG] is_inject = %d", acs_injections[id][IS_INJECT]);
RequestFrame("@inject_engine", id)
p_result = PLUGIN_HANDLED;
}
return p_result;
}
@inject_engine(id) {
static Float:f_time, s_classname[8];
if ((!acs_injections[id][IS_INJECT]) || get_member_game(m_bRoundTerminating)) {
if (is_valid_player(id)) {
if (CVAR[BAR])
rg_send_bartime(id, 0);
if (is_user_alive(id)) {
if ((get_member(id, m_pActiveItem) == get_member(id, m_rgpPlayerItems, KNIFE_SLOT)))
if ((!is_nullent(acs_injections[id][WEAPON])) && is_entity(acs_injections[id][WEAPON])) {
get_entvar(acs_injections[id][WEAPON], var_classname, s_classname, charsmax(s_classname))
if ((contain(s_classname, "weapon_") == 0) && (get_member(acs_injections[id][WEAPON], m_pPlayer) == id))
rg_switch_weapon(id, acs_injections[id][WEAPON]);
else
rg_switch_weapon(id, get_member(id, m_rgpPlayerItems, KNIFE_SLOT));
} else
rg_switch_weapon(id, get_member(id, m_rgpPlayerItems, KNIFE_SLOT));
set_member(id, m_flNextAttack, CVAR[NEXT_ATTACK]);
if (acs_injections[id][REMAINS_INJECT] == 0.0) {
if (CVAR[NOTIFY_MODE] & INJ_SHOW_FADE)
acs_screen_fade(id, { 0, 200, 0 }, 1.5, 0.6, 200);
if (CVAR[NOTIFY_SOUND_MODE] & INJ_SHOW_FADE)
rh_emit_sound2(id, 0, CHAN_ITEM, CVAR[SAMPLE]);
// Проверяем, чтобы не уйти в минус (сторонние плагины могут забрать шприцы в процессе лечения)
if (acs_injections[id][COUNT] > 0)
acs_injections[id][COUNT]--;
else
acs_injections[id][COUNT] = 0;
acs_injections[id][USED]++;
if (acs_injections[id][COUNT])
acs_client_print(id, INJ_SHOW_LEFT, "%L", id, "INJ_LEFT_COUNT", fmt("%L", id, fmt("INJ_COUNT_%d_PREFIX", (acs_injections[id][COUNT] % 10))), acs_injections[id][COUNT], fmt("%L", id, fmt("INJ_COUNT_%d_SUFFIX", (acs_injections[id][COUNT] % 10))));
}
if (Float:get_entvar(id, var_health) == Float:get_entvar(id, var_max_health))
acs_client_print(id, INJ_SHOW_FULL, "%L", id, "INJ_SUCCESFULLY_INJECTED_FULL");
else
acs_client_print(id, INJ_SHOW_PARTIAL, "%L", id, "INJ_SUCCESFULLY_INJECTED");
}
rg_add_account(id, -CVAR[COST]); // Никаких кредитов, списываем деньги сразу по окончании лечения, чтобы пациент не сдох раньше оплаты
}
} else {
f_time = get_gametime();
if (gf_cure_time[id] < f_time) {
//console_print(id, "[DEBUG] f_time = %f, cure_time = %f, cure_speed = %d", f_time, gf_cure_time[id], gi_cure_speed[id]);
acs_injections[id][REMAINS_INJECT] = acs_injections[id][REMAINS_INJECT] - 1.0;
if (!(ExecuteHamB(Ham_TakeHealth, id, 1.0, DMG_GENERIC) && acs_injections[id][REMAINS_INJECT] > 0.0)) {
acs_injections[id][REMAINS_INJECT] = 0.0;
acs_injections[id][IS_INJECT] = false;
}
gf_cure_time[id] = f_time + 1.0 / gi_cure_speed[id];
}
RequestFrame("@inject_engine", id);
}
}
public CBasePlayerWeapon_CanHolster(p_weapon) {
static bool:b_result, i_player;
i_player = get_member(p_weapon, m_pPlayer);
//console_print(i_player, "[DEBUG] player = %d, block = %d, is_inj = %d", i_player, CVAR[BLOCK], acs_injections[i_player][IS_INJECT]);
SetHamReturnInteger(!(b_result = CVAR[BLOCK] && acs_injections[i_player][IS_INJECT]));
return (b_result) ? HAM_SUPERCEDE: HAM_IGNORED;
}
public CBasePlayerWeapon_Deploy(p_weapon) {
static i_player;
i_player = get_member(p_weapon, m_pPlayer);
if (CVAR[CHEAT]
&& (!acs_injections[i_player][COUNT])
&& (Float:get_entvar(i_player, var_health) < Float:get_entvar(i_player, var_max_health) / 2.0)
&& (!random(5)))
acs_inj_add_injection_count(i_player, 1);
}
acs_create_cvars() {
static s_cmd_name[32];
bind_pcvar_string(create_cvar("acs_inj_prefix", "^4[Injection]", .description = "Префикс в чате"), CVAR[PREFIX], charsmax(CVAR[PREFIX]));
bind_pcvar_num(create_cvar("acs_inj_enable", "1", .description = "0 - Выкл. 1 - Вкл.", .has_min=true, .min_val=0.0, .has_max=true, .max_val=1.0), CVAR[ENABLE]);
bind_pcvar_string(create_cvar("acs_inj_access", "s", .description = "Флаги доступа (оставьте пустым для выдачи всем игрокам)"), CVAR[ACCESS], charsmax(CVAR[ACCESS]));
bind_pcvar_string(create_cvar("acs_inj_access2", "s", .description = "Флаги доступа (оставьте пустым для выдачи всем игрокам)"), CVAR[ACCESS_2], charsmax(CVAR[ACCESS_2]));
bind_pcvar_string(create_cvar("acs_inj_commands", "/acs_injection /acs_inject", .description = "Команды для получения шприца (оставьте пустым чтобы отключить)"), CVAR[COMMANDS], charsmax(CVAR[COMMANDS]));
bind_pcvar_num(create_cvar("acs_inj_spawn_bonus_count", "1", .description = "Сколько шприцов выдавать бесплатно в начале раунда игрокам с флагами доступа", .has_min=true, .min_val=0.0, .has_max=true, .max_val=10.0), CVAR[SPAWN_BONUS_COUNT]);
bind_pcvar_num(create_cvar("acs_inj_spawn_bonus_steam_count", "1", .description = "Сколько шприцов выдавать бесплатно в начале раунда игрокам STEAM (не используется, если флаги доступа не заданы)", .has_min=true, .min_val=0.0, .has_max=true, .max_val=10.0), CVAR[SPAWN_BONUS_STEAM_COUNT]);
bind_pcvar_num(create_cvar("acs_inj_aes_buy_count", "1", .description = "Сколько шприцов выдавать при покупке через AES-Bonus", .has_min=true, .min_val=1.0, .has_max=true, .max_val=10.0), CVAR[AES_BUY_COUNT]);
bind_pcvar_num(create_cvar("acs_inj_cmd_count", "1", .description = "Сколько шприцов выдавать по команде acs_inj_commands", .has_min=true, .min_val=1.0, .has_max=true, .max_val=10.0), CVAR[CMD_COUNT]);
bind_pcvar_num(create_cvar("acs_inj_use_method", "4", .description = "Метод использования:^n0 - через Z (radio1)^n1 - через X (radio2)^n2 - через C (radio3)^n3 - через Q (drop)^n4 - через F (<фонарь> - impulse 100)", .has_max = true, .max_val = 4.0), CVAR[USE_METHOD]);
bind_pcvar_num(create_cvar("acs_inj_speed", "10", .description = "Скорость лечения (HP в секунду)", .has_min=true, .min_val=1.0, .has_max=true, .max_val=100.0), CVAR[SPEED]);
bind_pcvar_num(create_cvar("acs_inj_speed_dynamic", "3", .description = "Изменять время лечения в зависимости от:^n 0 - Выкл.^n1 - текущей величины здоровья^2 - неиспользованного остатка шприца^n3 - оба варианта", .has_min=true, .min_val=0.0, .has_max=true, .max_val=3.0), CVAR[SPEED_DYNAMIC]);
bind_pcvar_num(create_cvar("acs_inj_block", "0", .description = "Блокировать смену оружия в процессе лечения", .has_min=true, .min_val=0.0, .has_max=true, .max_val=1.0), CVAR[BLOCK]);
bind_pcvar_float(create_cvar("acs_inj_next_attack", "0.0", .description = "Через сколько секунд после лечения можно стрелять", .has_min=true, .min_val=0.0, .has_max=true, .max_val=10.0), CVAR[NEXT_ATTACK]);
bind_pcvar_num(create_cvar("acs_inj_health", "30", .description = "Величина пополняемого здоровья, 0 - MAX ", .has_min = true, .has_max = true, .min_val = 0.0, .max_val = 100.0), CVAR[HEALTH]);
bind_pcvar_num(create_cvar("acs_inj_max_use", "3", .description = "Максимальное кол-во использований за раунд", .has_min = true, .min_val = 1.0, .has_max=true, .max_val=10.0), CVAR[MAX_TIMES]);
bind_pcvar_num(create_cvar("acs_inj_max_count", "3", .description = "Сколько максимально игрок может иметь с собой шприцов", .has_min=true, .min_val=0.0, .has_max=true, .max_val=10.0), CVAR[MAX_COUNT]);
bind_pcvar_num(create_cvar("acs_inj_sequence", "0", .description = "Индекс анимации модели шприца", .has_min=true, .min_val=0.0, .has_max=true, .max_val=100.0), CVAR[SEQUENCE]);
bind_pcvar_num(create_cvar("acs_inj_cost", "0", .description = "Стоимость услуги", .has_min=true, .min_val=0.0, .has_max=true, .max_val=16000.0), CVAR[COST]);
bind_pcvar_num(create_cvar("acs_inj_bar", "1", .description = "Включить линию прогресса", .has_min=true, .min_val=0.0, .has_max=true, .max_val=1.0), CVAR[BAR]);
bind_pcvar_num(create_cvar("acs_inj_vip", "0", .description = "Запретить VIP игроку использовать шприц на as_* картах", .has_min=true, .min_val=0.0, .has_max=true, .max_val=1.0), CVAR[VIP]);
bind_pcvar_num(create_cvar("acs_inj_win_diff", "5", .description = "Если разница между победами команд превышает это значение, блокировать шприц для доминантной команды (0 - Выкл.)", .has_min=true, .min_val=0.0, .has_max=true, .max_val=10.0), CVAR[DIFF]);
bind_pcvar_num(create_cvar("acs_inj_win_diff_mode", "0", .description = "Режим определения доминантной команды:^n0 - доминирование на N очков^n1 - имеет подряд N побед", .has_min=true, .min_val=0.0, .has_max=true, .max_val=1.0), CVAR[DIFF_MODE]);
bind_pcvar_num(create_cvar("acs_inj_notify_mode", "255", .description = "Режим вывода уведомлений по действиям шприца:^n0 - Выкл.^n1 - получение шприца^n2 - количествово шприцов с собой^n4 - остаток шприцов^n8 - частичное излечение^n16 - полное излечение^n32 - затемнение экрана^n64 - мигание строки баланса^n128 - ошибки по действиям шприца^n(для произвольной комбинации необходимо сложить значения нужных пунктов)", .has_min=true, .min_val=0.0, .has_max=true, .max_val=255.0), CVAR[NOTIFY_MODE]);
bind_pcvar_num(create_cvar("acs_inj_notify_sound_mode", "160", .description = "Режим сопровождения звуком уведомлений по действиям шприца:^n0 - Выкл.^n1 - получение шприца^n32 - звук излечения^n128 - ошибки по действиям шприца^n(для произвольной комбинации необходимо сложить значения нужных пунктов)", .has_min=true, .min_val=0.0, .has_max=true, .max_val=255.0), CVAR[NOTIFY_SOUND_MODE]);
bind_pcvar_num(create_cvar("acs_inj_spawn_reset", "1", .description = "Обнулять кол-во шприцов в начале раунда", .has_min=true, .min_val=0.0, .has_max=true, .max_val=1.0), CVAR[SPAWN]);
bind_pcvar_num(create_cvar("acs_inj_kill_reset", "1", .description = "Обнулять кол-во шприцов после смерти", .has_min=true, .min_val=0.0, .has_max=true, .max_val=1.0), CVAR[KILL]);
bind_pcvar_num(create_cvar("acs_inj_cheat", "1", .description = "Выдать шприц с 20% вероятностью игроку со здоровьем <50 при переключении оружия", .has_min=true, .min_val=0.0, .has_max=true, .max_val=1.0), CVAR[CHEAT]);
bind_pcvar_string(create_cvar("acs_inj_v_model", "models/shpric/v_injectorrbl.mdl", .description = "V модель шприца (опционально)"), CVAR[V_MODEL], charsmax(CVAR[V_MODEL]));
bind_pcvar_string(create_cvar("acs_inj_p_model", "models/shpric/p_injectorrbl.mdl", .description = "P модель шприца (опционально)"), CVAR[P_MODEL], charsmax(CVAR[P_MODEL]));
bind_pcvar_string(create_cvar("acs_inj_pre_sample", "injection/pre_medshot.wav", .description = "Звук до иньекции (опционально)"), CVAR[PRE_SAMPLE], charsmax(CVAR[PRE_SAMPLE]));
bind_pcvar_string(create_cvar("acs_inj_sample", "injection/medshot.wav", .description = "Звук после иньекции (опционально)"), CVAR[SAMPLE], charsmax(CVAR[SAMPLE]));
if (file_exists(fmt("sound/%s", ACS_INJ_SOUND_NOTIFY)))
precache_sound(ACS_INJ_SOUND_NOTIFY);
if (file_exists(fmt("sound/%s", ACS_INJ_SOUND_REJECT)))
precache_sound(ACS_INJ_SOUND_REJECT);
if (CVAR[V_MODEL][0])
precache_model(CVAR[V_MODEL]);
if (CVAR[P_MODEL][0])
precache_model(CVAR[P_MODEL]);
if (CVAR[PRE_SAMPLE][0])
precache_sound(CVAR[PRE_SAMPLE]);
if (CVAR[SAMPLE][0])
precache_sound(CVAR[SAMPLE]);
while (argbreak(CVAR[COMMANDS], s_cmd_name, charsmax(s_cmd_name), CVAR[COMMANDS], charsmax(CVAR[COMMANDS])) != INVALID_HANDLE) {
if (s_cmd_name[0] == '/' || s_cmd_name[0] == '!' || s_cmd_name[0] == '.') {
register_clcmd(fmt("say %s", s_cmd_name), "cmd_injection");
register_clcmd(fmt("say_team %s", s_cmd_name), "cmd_injection");
} else
register_clcmd(s_cmd_name, "cmd_injection", CVAR[ACCESS]);
}
switch (CVAR[USE_METHOD]) {
case 0: register_clcmd("radio1", "@use_injection");
case 1: register_clcmd("radio2", "@use_injection");
case 2: register_clcmd("radio3", "@use_injection");
case 3: register_clcmd("drop", "@use_injection");
case 4: register_impulse(100, "@use_injection");
}
if (CVAR[SPAWN_BONUS_COUNT] || CVAR[SPAWN_BONUS_STEAM_COUNT])
RegisterHookChain(RG_CBasePlayer_OnSpawnEquip, "CBasePlayer_OnSpawnEquip", true);
AutoExecConfig(.name = "acs_injection");
}
public native_acs_inj_get_injections(const plugin_id, const argc) {
enum { arg_id = 1 }
static id;
id = get_param(arg_id);
return is_valid_player(id) ? acs_injections[id][COUNT] : 0;
}
public native_acs_inj_add_injections(const plugin_id, const argc) {
enum { arg_id = 1, arg_add_value }
static id, add_value, bool:b_result;
id = get_param(arg_id);
add_value = get_param(arg_add_value);
if ((b_result = bool:is_user_alive(id)))
//Проверяем чтобы не уйти в минус
if (acs_injections[id][COUNT] + add_value >= 0)
acs_injections[id][COUNT] += add_value;
return b_result;
}
public native_acs_inj_reset_injections(plugin_id, num_params) {
enum { arg_id = 1 }
static id, bool:b_result;
id = get_param(arg_id);
if ((b_result = is_valid_player(id)))
acs_injections[id][COUNT] = 0;
return b_result;
}
public native_acs_inj_get_injects(plugin_id, num_params) {
enum { arg_id = 1 }
static id;
id = get_param(arg_id);
return is_valid_player(id) ? acs_injections[id][USED] : 0;
}
public native_acs_inj_is_injected(plugin_id, num_params) {
enum { arg_id = 1 }
static id;
id = get_param(arg_id);
return is_valid_player(id) ? (acs_injections[id][USED] > 0) : false;
}
public native_acs_inj_is_injection(plugin_id, num_params) {
enum { arg_id = 1 }
static id;
id = get_param(arg_id);
return is_user_alive(id) ? acs_injections[id][IS_INJECT] : false;
}
stock acs_check_throttling(id) {
static Float:f_time, Float:f_delta;
f_time = get_gametime();
f_delta = f_time - ACS_PRINT_THR[id][LAST_USAGE];
if (ACS_PRINT_THR[id][FLAG]) {
if (f_delta > 4 * 0.75)
ACS_PRINT_THR[id][FLAG] = false;
} else if (f_delta < 0.75)
ACS_PRINT_THR[id][FLAG] = true;
ACS_PRINT_THR[id][LAST_USAGE] = f_time;
return !ACS_PRINT_THR[id][FLAG];
}
stock acs_client_print(const id, const notify_mode, const message[], any:...) {
static s_tmp[190];
// Отключаем проверку троттлинга, если сообщение без звуковых уведомлений (если сообщения показываются подряд - второе и последующие должны быть без звука)
if ((CVAR[NOTIFY_MODE] & notify_mode) && ((id == 0) || is_valid_player(id)) && (acs_check_throttling(id) || (!((CVAR[NOTIFY_SOUND_MODE] & ACS_INJ_SOUND_MASK) & notify_mode)))) {
vformat(s_tmp, charsmax(s_tmp), message, 4);
if (CVAR[PREFIX])
format(s_tmp, charsmax(s_tmp), "%s %s", CVAR[PREFIX], s_tmp);
client_print_color(id, ((notify_mode & INJ_SHOW_ERROR) ? print_team_red : print_team_blue), s_tmp);
if ((CVAR[NOTIFY_SOUND_MODE] & ACS_INJ_SOUND_MASK) & notify_mode)
acs_send_audio(id, ((notify_mode & INJ_SHOW_ERROR) ? ACS_INJ_SOUND_REJECT : ACS_INJ_SOUND_NOTIFY));
}
}
stock bool:acs_inj_can_get_inject(id) {
new bool:b_result = false;
if (CVAR[ENABLE]) {
if ((!(CVAR[VIP] && get_member(id, m_bIsVIP)))) {
if (is_user_alive(id)) {
if (!is_team_dominate(id)) {
if (!(b_result = (get_member(id, m_iAccount) >= CVAR[COST])))
acs_blink_account(id);
} else
acs_client_print(id, INJ_SHOW_ERROR, "%L", id, "INJ_DOMINA");
} else
acs_client_print(id, INJ_SHOW_ERROR, "%L", id, "INJ_ALIVE");
} else
acs_client_print(id, INJ_SHOW_ERROR, "%L", id, "INJ_VIP");
}
//console_print(id, "[DEBUG] can_get_inject = %d", b_result);
return b_result;
}
stock bool:acs_inj_can_use_inject(id) {
static p_weapon;
new bool:b_result = false;
//console_print(id, "[DEBUG] used = %d, count = %d", acs_injections[id][USED], acs_injections[id][COUNT]);
if ((!acs_injections[id][IS_INJECT])
&& (!get_member_game(m_bRoundTerminating))
&& acs_inj_can_get_inject(id)
&& (Float:get_entvar(id, var_health) < Float:get_entvar(id, var_max_health))) {
if (acs_injections[id][COUNT]) {
if ((b_result = acs_injections[id][USED] < CVAR[MAX_TIMES])) {
if (b_result && (CVAR[USE_METHOD] < 4)) {
p_weapon = get_member(id, m_pActiveItem);
b_result = ((!is_nullent(p_weapon)) && is_entity(p_weapon) && (get_member(p_weapon, m_iId) == CSW_KNIFE))
}
} else
acs_client_print(id, INJ_SHOW_ERROR, "%L", id, "INJ_LIMIT");
} else
acs_client_print(id, INJ_SHOW_ERROR, "%L", id, "INJ_DONT_HAVE");
}
return b_result;
}
stock acs_send_audio(const id, const sample[]) {
static i_msg;
if(sample[0]) {
if ((id == 0) || is_valid_player(id)) {
if(!i_msg) {
i_msg = get_user_msgid("SendAudio");
}
message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, i_msg, .player = id);
{
write_byte(id);
write_string(sample);
write_short(PITCH_NORM);
}
message_end();
}
}
}
stock bool:is_team_dominate(id) {
static i_diff;
return (CVAR[DIFF] && (get_member(id, m_iTeam) == acs_get_team_dominate(i_diff))) ? (i_diff > CVAR[DIFF]) : false;
}
stock TeamName:acs_get_team_dominate(&diff = 0) {
static TeamName:t_team;
t_team = TEAM_UNASSIGNED;
if ((diff = (CVAR[DIFF_MODE] ? (get_member_game(m_iNumConsecutiveCTLoses) - get_member_game(m_iNumConsecutiveTerroristLoses)) : (get_member_game(m_iNumTerroristWins) - get_member_game(m_iNumCTWins))) > 0))
t_team = TEAM_TERRORIST;
else if (diff < 0)
t_team = TEAM_CT;
abs(diff);
return t_team;
}
stock acs_send_weapon_anim(const id, const sequence) {
if (is_valid_player(id) && is_user_alive(id)) {
set_entvar(id, var_weaponanim, sequence);
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = id);
{
write_byte(sequence);
write_byte(0);
}
message_end();
}
}
stock acs_screen_fade(id = 0, v_color[3] = { 0, 0, 0 }, Float:f_time = -1.0, Float:hold_time = 0.0, alpha = 0, flags = FFADE_IN, bool:reliable = false) {
static i_fade_time, i_msg, i_msg_dest;
if (is_valid_player(id) && is_user_alive(id)) {
if (get_member(id, m_blindUntilTime) < get_gametime()) {
if (f_time == -1.0)
i_fade_time = 4;
else
i_fade_time = clamp(floatround(f_time * (1 << 12)), 0, 0xFFFF);
if (!i_msg)
i_msg = get_user_msgid("ScreenFade");
if (reliable)
i_msg_dest = id ? MSG_ONE : MSG_ALL;
else
i_msg_dest = id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST;
message_begin(i_msg_dest, i_msg, .player = id);
{
write_short(i_fade_time);
write_short(clamp(floatround(hold_time * (1 << 12)), 0, 0xFFFF));
write_short(flags);
write_byte(v_color[0]);
write_byte(v_color[1]);
write_byte(v_color[2]);
write_byte(alpha);
}
message_end();
}
}
}
stock acs_blink_account(id) {
static i_msg;
if (is_valid_player(id) && is_user_alive(id)) {
if ((CVAR[NOTIFY_MODE] & INJ_SHOW_ERROR))
acs_client_print(id, INJ_SHOW_ERROR, "%L", id, "INJ_NOT_ENOUGH");
if ((CVAR[NOTIFY_MODE] & INJ_SHOW_BLINK) && (i_msg || (i_msg = get_user_msgid("BlinkAcct")))) {
message_begin(MSG_ONE_UNRELIABLE, i_msg, .player = id);
{
write_byte(3);
}
message_end();
}
}
}
Крашит сервер из-за прекеша. Модели установлены в правильном расположении.
В этой теме было размещено решение! Перейти к решению.
Download all Attachments
-
29.3 KB Просмотры: 10
-
6.3 KB Просмотры: 17