Проблемма с Covi плагином

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
48
Реакции
-4
Ошибка
Не отображается
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5263 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Oct 27 2019 16:23:31
Built from: https://github.com/alliedmodders/amxmodx/commit/15a14a0
Build ID: 5263:15a14a0
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.692-dev-mpatch
Build date: 18:13:20 Sep 30 2019 (1997)
Build from: https://github.com/dreamstalker/rehlds/commit/e7232be
ReGamedll
ReGameDLL version: 5.7.0.310-dev
Build date: 05:50:50 May 24 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/8e3b6f4
Версия 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)
Список метамодулей
[ 1] Reunion          RUN   -    reunion_mm_i386.  v0.1.0.9  ini   Start Never
[ 2] Revoice RUN - revoice_mm_i386. v0.1.0.3 ini Start Never
[ 3] Rechecker RUN - rechecker_mm_i38 v2.5 ini Chlvl ANY
[ 4] ReAuthCheck RUN - reauthcheck_mm_i v0.1.6 ini Start Never
[ 5] AMX Mod X RUN - amxmodx_mm_i386. v1.9.0.5 ini Start ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 7] Ultimate Unprec RUN - unprecacher_i386 vBeta 2. ini Chlvl Chlvl
[ 8] MySQL RUN - mysql_amxx_i386. v1.9.0.5 pl5 ANY ANY
[ 9] FakeMeta RUN - fakemeta_amxx_i3 v1.9.0.5 pl5 ANY ANY
[10] Engine RUN - engine_amxx_i386 v1.9.0.5 pl5 ANY ANY
[11] CStrike RUN - cstrike_amxx_i38 v1.9.0.5 pl5 ANY ANY
[12] CSX RUN - csx_amxx_i386.so v1.9.0.5 pl5 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl5 ANY ANY
[14] Fun RUN - fun_amxx_i386.so v1.9.0.5 pl5 ANY ANY
[15] ReAimDetector RUN - reaimdetector_am v0.2.2 pl5 ANY Never
[16] ReAPI RUN - reapi_amxx_i386. v5.11.0. pl5 ANY Never
16 plugins, 16 running
Список плагинов
[  1] AMXBans: Core           MA 1.6.9    Larte Team        amxbans_core.am  running  
[ 2] AMXBans: Main MA 1.6.9 Larte Team amxbans_main.am running
[ 3] Aliases checker 1.0.3 kanagava alias_detector. running
[ 4] [ReAMX] Damager RBS 19.08.30 SKAJIbnEJIb damager_rbs.amx running
[ 5] Admin Commands 1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 6] Slots Reservation 1.9.0.5263 AMXX Dev Team adminslots.amxx running
[ 7] Multi-Lingual System 1.9.0.5263 AMXX Dev Team multilingual.am running
[ 8] Menus Front-End 1.9.0.5263 AMXX Dev Team menufront.amxx running
[ 9] Commands Menu 1.9.0.5263 AMXX Dev Team cmdmenu.amxx running
[ 10] Players Menu 1.9.0.5263 AMXX Dev Team plmenu.amxx running
[ 11] Maps Menu 1.9.0.5263 AMXX Dev Team mapsmenu.amxx running
[ 12] Plugin Menu 1.9.0.5263 AMXX Dev Team pluginmenu.amxx running
[ 13] Restrict Weapons 1.9.0.5263 AMXX Dev Team restmenu.amxx running
[ 14] Anti Flood 1.9.0.5263 AMXX Dev Team antiflood.amxx running
[ 15] Scrolling Message 1.9.0.5263 AMXX Dev Team scrollmsg.amxx running
[ 16] Info. Messages 1.9.0.5263 AMXX Dev Team imessage.amxx running
[ 17] Admin Votes 1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 18] Map Manager RU 1.2.2 Mistrick map_manager.amx running
[ 19] TimeLeft 1.9.0.5263 AMXX Dev Team timeleft.amxx running
[ 20] AES: StatsX 0.5 Vega serfreeman1337 aes_statsx_cstr running
[ 21] StatsX 1.9.0.5263 AMXX Dev Team statsx.amxx running
[ 22] Pause Plugins 1.9.0.5263 AMXX Dev Team pausecfg.amxx running
[ 23] Stats Configuration 1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 24] ResetScore 0.2.0 aNNakin resetscore.amxx running
[ 25] [182] Parachute RBS 17.12.12 KRoT@L/JTP10181 parachute_rbs.a running
[ 26] AntiFlash FINAL 5.0 Leo_[BH] antiflash5.amxx running
[ 27] Weapon Model + Sound R 1.3 GHW_Chronic GHW_Weapon_Repl running
[ 28] Admins Online 1.0 FloRys admins_online.a running
[ 29] VIP 1.5 by4udilo admin_vip_2.amx running
[ 30] Auto VIP [STEAM] 1.1 ArtHa auto_steam_vip. debug
[ 31] admin model 1.0 TaTi adm.amxx debug
[ 32] Chiter-VOTEBAN 3.0 SLIMSHADY_MOD voteban_by_slim running
[ 33] Auto-Restart 0.5 [email protected] auto-restart.am running
[ 34] Lite Translit 2.8 neygomon lite_translit.a running
[ 35] [ReAMX] Demo Recorder 18.02.08 SKAJIbnEJIb demorecorder_rb running
[ 36] Erotic Bomb 0.4 8dp & Spection erotic_bomb.amx running
[ 37] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 38] Play or Be Kicked 1.5.243 Brad Jones pbk.amxx running
[ 39] Ping Checker 26.0.1 RC1 h1k3 ping_checker.am running
[ 40] Smoke: HealthNade 0.0.4 wopox1337 Smoke_HealthNad running
[ 41] XMAS Skybox 1.0 SeMax xmas_sky.amxx running
[ 42] [182] SlayLosers RBS 19.09.02 SKAJIbnEJIb & d3 slaylosers_rbs. running
[ 43] mute menu 1.0 cheap_suit mutemenu.amxx running
[ 44] Reklama 09.07.2019 mx?! reklama.amxx running
[ 45] CHAT MODEL 3.0 MayroN & Sanya@ chat_model.amxx paused
[ 46] COVID_mode 1.2.5 wellasgood Covid_mode.amxx running
[ 47] Advanced Experience Sy 0.5 Vega serfreeman1337 aes_main.amxx running
[ 48] AES: CStrike Addon 0.5 Vega serfreeman1337 aes_exp_cstrike running
[ 49] AES: Informer 0.5 Vega serfreeman1337 aes_informer.am running
[ 50] AES: Admin Tools 0.5 Vega serfreeman1337 aes_exp_editor. running
[ 51] AMXBans: Freeze Gm 1.6 Larte Team amxbans_freeze. running
[ 52] AMXBans: Screens Gm 1.6 Larte Team amxbans_ssban.a running
Автор плагина
wellasgood
Версия плагина
1.2.5
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <reapi>

#define AUTO_CREATE_CONFIG //Авто-создание конфига. (включать только если включен режим MASK_ALL_MODE)

#define MULTI_LANGUAGE(%0) fmt("%L", LANG_SERVER, %0)

#define ACCESS_FLAG_MENU (ADMIN_BAN | ADMIN_USER) //Мульти флаг, доступ к меню включения/выключения масок и для режима MASK_ACCESS

#define MASK_ALL_MODE //Если включено, то маски всем выставляются при заходе.

#define MASK_ACCESS //Работает с режимом MASK_ALL_MODE (Если включено, то выдает при спавне маски только игрокам с флагом ACCESS_FLAG_MENU, иначе всем)

#if defined MASK_ALL_MODE
#define SAVE_MASK_MODE //Сохранение цвета маски при выходе и повторном заходе игрока, а также при смене карты.

new DefColor;

#if defined SAVE_MASK_MODE
#include <nvault>
new Vault, SaveMaskColor[MAX_PLAYERS+1], DoubleSaveColor[MAX_PLAYERS+1];
new bool:DefCheck[MAX_PLAYERS+1];
#endif

new const DEFAULT_COLOR[] = "135 206 250" //указать цвет который будет выставляться по умолчанию (RGB формат)
#endif

#define CHAT_ADVERTISING //возможность рекламировать в чат сообщения о командах открытия меню (вкл/выкл откоммент/коммент).

#if defined CHAT_ADVERTISING
#define TIME 120.0 //время для показа рекламы в чате (интервал)
#endif

new const PLUGIN[] = "COVID_mode";
new const VERSION[] = "1.2.5";
new const AUTHOR[] = "wellasgood";

new const MEDICAL_MODEL[] = "models/medical-mask/med-mask_clr.mdl";
new const MEDICAL_MODEL_FIX[] = "models/medical-mask/med-mask_clr_fix.mdl";

new Entity[MAX_PLAYERS+1], MaskColor[MAX_PLAYERS+1];
new bool:HDModels[MAX_PLAYERS+1], Model[2];

#if defined MASK_ALL_MODE
new bool:Check[MAX_PLAYERS+1];

enum _:CVAR_DATA
{
MASK_HEALTH_EN,
MASK_HEALTH_NUM,
MASK_HEALTH_MSG
};

new eCvarData[CVAR_DATA], bool:CheckHealth[MAX_PLAYERS+1], bool:CheckRandom[MAX_PLAYERS+1];
#endif

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_dictionary("covid.txt");

register_clcmd("say /covid", "cmdOpenMenu");
register_clcmd("say /cv", "cmdOpenMenu");

register_concmd("its_color", "func_its_color");

register_menu("CovidMenu", 1023, "Handle_CovidMenu", 0);

#if defined MASK_ALL_MODE
RegisterHookChain(RG_CBasePlayer_Spawn, "EventSpawn", true);

RegCvars();

#if defined AUTO_CREATE_CONFIG
AutoExecConfig(true, "COVID_mode");
#endif

new Float:Color[3];
func_handler_row(DEFAULT_COLOR, Color);

DefColor = RGBtoHUE(Color);
#endif

#if defined SAVE_MASK_MODE
Vault = nvault_open("Covid_save");

if(Vault == INVALID_HANDLE)
{
set_fail_state("Error opening nVault file!");
}
#endif

RegisterQueryFile("models/player/militia/militia.mdl", "handler_QueryFile", RES_TYPE_HASH_ANY, -1);
RegisterQueryFile("models/player/spetsnaz/spetsnaz.mdl", "handler_QueryFile", RES_TYPE_HASH_ANY, -1);

#if defined CHAT_ADVERTISING
set_task_ex(TIME, "Chat_Advertising", .flags = SetTask_Repeat);
#endif
}

#if defined MASK_ALL_MODE
RegCvars()
{
bind_pcvar_num(create_cvar(
.name = "cv_mask_health_en",
.string = "1",
.description = MULTI_LANGUAGE("DESCRIPTION_CVAR_HEALTH_EN"),
.has_min = true,
.min_val = 0.0,
.has_max = true,
.max_val = 1.0),
eCvarData[MASK_HEALTH_EN]
);

bind_pcvar_num(create_cvar(
.name = "cv_mask_health_num",
.string = "5",
.description = MULTI_LANGUAGE("DESCRIPTION_CVAR_HEALTH_NUM"),
.has_min = false,
.min_val = 0.0,
.has_max = false,
.max_val = 0.0),
eCvarData[MASK_HEALTH_NUM]
);

bind_pcvar_num(create_cvar(
.name = "cv_mask_health_msg",
.string = "1",
.description = MULTI_LANGUAGE("DESCRIPTION_CVAR_HEALTH_MSG"),
.has_min = true,
.min_val = 0.0,
.has_max = true,
.max_val = 1.0),
eCvarData[MASK_HEALTH_MSG]
);
}
#endif

public plugin_precache()
{
CheckModels(MEDICAL_MODEL, 0);
CheckModels(MEDICAL_MODEL_FIX, 1);
}

CheckModels(const model[], num)
{
if(!file_exists(fmt("\%s", model)))
{
set_fail_state("Error! Model '%s' not found", model);
}
else
{
Model[num] = precache_model(model);
}
}

public handler_QueryFile(const PlayerID, const hash, const uniqueId)
{
HDModels[PlayerID] = true;
}

#if defined MASK_ALL_MODE
public client_putinserver(PlayerID)
{
if(is_user_bot(PlayerID) || is_user_hltv(PlayerID))
{
return;
}

Check[PlayerID] = false;

if(eCvarData[MASK_HEALTH_EN])
{
CheckHealth[PlayerID] = false;
}

#if defined SAVE_MASK_MODE
new AuthID[MAX_AUTHID_LENGTH], Data[12];
get_user_authid(PlayerID, AuthID, charsmax(AuthID));

new timestamp, AccessResult = nvault_lookup(Vault, AuthID, Data, charsmax(Data), timestamp);

if(AccessResult)
{
SaveMaskColor[PlayerID] = str_to_num(Data);

if(SaveMaskColor[PlayerID] > 255)
{
switch(SaveMaskColor[PlayerID])
{
case 666:
{
CheckRandom[PlayerID] = true;
}
case 777:
{
CheckRandom[PlayerID] = false;
}
case 888:
{
if(eCvarData[MASK_HEALTH_EN])
{
CheckHealth[PlayerID] = true;
}
}
}
}
else
{
DoubleSaveColor[PlayerID] = SaveMaskColor[PlayerID];
DefCheck[PlayerID] = true;
}
}
#endif

#if defined MASK_ACCESS
if(get_user_flags(PlayerID) & ACCESS_FLAG_MENU)
{
#if defined SAVE_MASK_MODE
if(SaveMaskColor[PlayerID] != 888)
{
CreateEnt(PlayerID);
}
#else
CreateEnt(PlayerID);
#endif
}
#else
#if defined SAVE_MASK_MODE
if(SaveMaskColor[PlayerID] != 888)
{
CreateEnt(PlayerID);
}
#else
CreateEnt(PlayerID);
#endif
#endif
}

public EventSpawn(PlayerID)
{
if(!is_user_alive(PlayerID))
{
return;
}

if(eCvarData[MASK_HEALTH_EN])
{
if(CheckHealth[PlayerID])
{
new Float:HP = get_entvar(PlayerID, var_health);
set_entvar(PlayerID, var_health, HP - eCvarData[MASK_HEALTH_NUM]);

if(eCvarData[MASK_HEALTH_MSG])
{
HealthMsg(PlayerID, 2);
}
}
}

if(Entity[PlayerID] && is_entity(Entity[PlayerID]))
{
if(!Check[PlayerID])
{
SetMask(PlayerID);

#if defined SAVE_MASK_MODE
if(!CheckRandom[PlayerID])
{
if(DefCheck[PlayerID])
{
set_entvar(Entity[PlayerID], var_colormap, SaveMaskColor[PlayerID]);
}
else
{
set_entvar(Entity[PlayerID], var_colormap, DefColor);
}
}
#else
set_entvar(Entity[PlayerID], var_colormap, DefColor);
#endif
}

if(CheckRandom[PlayerID])
{
new RandomNum = random_num(0, 255);
set_entvar(Entity[PlayerID], var_colormap, RandomNum);
}
}
}
#endif

public client_disconnected(PlayerID)
{
RemoveMask(PlayerID);

MaskColor[PlayerID] = 0;

#if defined SAVE_MASK_MODE
SaveMaskColor[PlayerID] = 0;
DefCheck[PlayerID] = false;
#endif

HDModels[PlayerID] = false;
}

public cmdOpenMenu(PlayerID)
{
if(get_user_flags(PlayerID) & ACCESS_FLAG_MENU)
{
CovidMenu(PlayerID);
}

return PLUGIN_HANDLED;
}

CovidMenu(PlayerID)
{
new Menu[MAX_MENU_LENGTH], Keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_0;
new Len = formatex(Menu, charsmax(Menu), "%L^n^n", PlayerID, "COVID_MENU_TITLE");

Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[1] \y# \w%L \y[\r%L\y]^n^n", PlayerID, "COVID_MENU_ITEM_INFO", PlayerID, Entity[PlayerID] == 0 ? "COVID_MENU_ITEM_OFF" : "COVID_MENU_ITEM_ON");

#if defined MASK_ALL_MODE
if(Entity[PlayerID] == 0)
{
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[2] \y# \w%L \y[\d%L\y]^n", PlayerID, "COVID_MENU_ITEM_COLOR_RANDOM_INFO", PlayerID, "COVID_MENU_ITEM_COLOR_OFF");
}
else
{
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[2] \y# \w%L \y[\r%L\y]^n", PlayerID, "COVID_MENU_ITEM_COLOR_RANDOM_INFO", PlayerID, !CheckRandom[PlayerID] ? "COVID_MENU_ITEM_OFF" : "COVID_MENU_ITEM_ON");
}
#else
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[2] \y# \w%L \y[\r%L\y]^n", PlayerID, "COVID_MENU_ITEM_COLOR_RANDOM_INFO", PlayerID, "COVID_MENU_ITEM_DISABLED");
#endif

if(Entity[PlayerID] == 0)
{
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[3] \y# \w%L \y[\d%L\y]^n", PlayerID, "COVID_MENU_ITEM_COLOR_INFO", PlayerID, "COVID_MENU_ITEM_COLOR_OFF");
}
#if defined MASK_ALL_MODE
else if(CheckRandom[PlayerID])
{
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[3] \y# \w%L \y[\d%L\y]^n", PlayerID, "COVID_MENU_ITEM_COLOR_INFO", PlayerID, "COVID_MENU_ITEM_COLOR_RANDOM_ACTIVATE");
}
#endif
else
{
#if defined SAVE_MASK_MODE
if(MaskColor[PlayerID] == 0)
{
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[3] \y# \w%L \y[\r%L\y]^n", PlayerID, "COVID_MENU_ITEM_COLOR_INFO", PlayerID, fmt(!DefCheck[PlayerID] ? "COVID_MENU_ITEM_COLOR_%d" : "COVID_MENU_ITEM_AUTOSAVE_%d", MaskColor[PlayerID]));
}
else
{
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[3] \y# \w%L \y[\r%L\y]^n", PlayerID, "COVID_MENU_ITEM_COLOR_INFO", PlayerID, fmt("COVID_MENU_ITEM_COLOR_%d", MaskColor[PlayerID]));
}
#else
#if !defined MASK_ALL_MODE
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[3] \y# \w%L \y[\r%L\y]^n", PlayerID, "COVID_MENU_ITEM_COLOR_INFO", PlayerID, fmt("COVID_MENU_ITEM_COLOR_%d", MaskColor[PlayerID] + 50));
#else
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[3] \y# \w%L \y[\r%L\y]^n", PlayerID, "COVID_MENU_ITEM_COLOR_INFO", PlayerID, fmt("COVID_MENU_ITEM_COLOR_%d", MaskColor[PlayerID]));
#endif
#endif
}

if(Entity[PlayerID] == 0)
{
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[4] \y# \w%L \y[\d%L\y]^n^n", PlayerID, "COVID_MENU_ITEM_ITS_COLOR", PlayerID, "COVID_MENU_ITEM_COLOR_OFF");
}
else
{
Len += formatex(Menu[Len], charsmax(Menu) - Len, "\r[4] \y# \w%L \y[\d%L\y]^n^n", PlayerID, "COVID_MENU_ITEM_ITS_COLOR", PlayerID, "COVID_MENU_ITEM_ITS_COLOR_RGB");
}

formatex(Menu[Len], charsmax(Menu) - Len, "\r[0] \y# \w%L", PlayerID, "COVID_MENU_EXIT");
return show_menu(PlayerID, Keys, Menu, -1, "CovidMenu");
}

public Handle_CovidMenu(PlayerID, Keys)
{
switch(Keys)
{
case 0:
{
if(Entity[PlayerID] && is_entity(Entity[PlayerID]))
{
RemoveMask(PlayerID);

MaskColor[PlayerID] = 0;

#if defined MASK_ALL_MODE
Check[PlayerID] = false;

if(eCvarData[MASK_HEALTH_EN])
{
CheckHealth[PlayerID] = true;

if(eCvarData[MASK_HEALTH_MSG])
{
HealthMsg(PlayerID, 1);
}
}

#if defined SAVE_MASK_MODE
SaveMaskColor[PlayerID] = 888;
SaveMask(PlayerID);
#endif
#endif
}
else
{
CreateEnt(PlayerID);
SetMask(PlayerID);

#if defined MASK_ALL_MODE
Check[PlayerID] = true;

if(eCvarData[MASK_HEALTH_EN])
{
CheckHealth[PlayerID] = false;

if(eCvarData[MASK_HEALTH_MSG])
{
HealthMsg(PlayerID, 1);
}
}

#if defined SAVE_MASK_MODE
SaveMaskColor[PlayerID] = DefColor;
SaveMask(PlayerID);
#endif
#endif
}
}
case 1:
{
#if defined MASK_ALL_MODE
if(Entity[PlayerID] != 0)
{
CheckRandom[PlayerID] = !CheckRandom[PlayerID];

#if defined SAVE_MASK_MODE
SaveMaskColor[PlayerID] = CheckRandom[PlayerID] ? 666 : 777;
SaveMask(PlayerID);
#endif
}
#endif
}
case 2:
{
if(Entity[PlayerID] != 0)
{
#if defined MASK_ALL_MODE
if(!CheckRandom[PlayerID])
{
MaskColor[PlayerID] = (MaskColor[PlayerID] + 50) % 300;

if(MaskColor[PlayerID] < 50)
{
#if defined SAVE_MASK_MODE
set_entvar(Entity[PlayerID], var_colormap, !DefCheck[PlayerID] ? DefColor : DoubleSaveColor[PlayerID]);
#else
set_entvar(Entity[PlayerID], var_colormap, DefColor);
#endif
}
else
{
set_entvar(Entity[PlayerID], var_colormap, MaskColor[PlayerID] - 50);
}
}
#else
MaskColor[PlayerID] = (MaskColor[PlayerID] + 50) % 250;
set_entvar(Entity[PlayerID], var_colormap, MaskColor[PlayerID]);
#endif

#if defined SAVE_MASK_MODE
if(MaskColor[PlayerID] < 50)
{
SaveMaskColor[PlayerID] = !DefCheck[PlayerID] ? MaskColor[PlayerID] - 50 : DoubleSaveColor[PlayerID];
}
else
{
SaveMaskColor[PlayerID] = MaskColor[PlayerID] - 50;
}

SaveMask(PlayerID);
#endif
}
}
case 3:
{
if(Entity[PlayerID] != 0)
{
client_cmd(PlayerID, "messagemode ^"its_color^"");
}
}
case 9:
{
return PLUGIN_HANDLED;
}
}

CovidMenu(PlayerID);
return PLUGIN_HANDLED;
}

public func_its_color(PlayerID)
{
new String[13];
read_argv(1, String, charsmax(String));

new Float:Color[3];
func_handler_row(String, Color);

new TopColorNum = RGBtoHUE(Color);

set_entvar(Entity[PlayerID], var_colormap, TopColorNum);

#if defined SAVE_MASK_MODE
SaveMaskColor[PlayerID] = TopColorNum;
SaveMask(PlayerID);
#endif

return PLUGIN_HANDLED;
}

func_handler_row(const String[], Float:Color[3])
{
new R[4], G[4], B[4];
parse(String, R, charsmax(R), G, charsmax(G), B, charsmax(B));

Color[0] = str_to_float(R);
Color[1] = str_to_float(G);
Color[2] = str_to_float(B);
}

#if defined CHAT_ADVERTISING
public Chat_Advertising()
{
client_print_color(0, print_team_default, "%l", "COVID_CHAT_INFO");
}
#endif

SetMask(PlayerID)
{
set_entvar(Entity[PlayerID], var_body, 0);

#if defined MASK_ALL_MODE
#if defined SAVE_MASK_MODE
set_entvar(Entity[PlayerID], var_colormap, !DefCheck[PlayerID] ? DefColor : DoubleSaveColor[PlayerID]);
#else
set_entvar(Entity[PlayerID], var_colormap, DefColor);
#endif
#endif
}

RemoveMask(PlayerID)
{
if(Entity[PlayerID] && is_entity(Entity[PlayerID]))
{
set_entvar(Entity[PlayerID], var_flags, FL_KILLME);
set_entvar(Entity[PlayerID], var_nextthink, get_gametime());
Entity[PlayerID] = 0;
}
}

CreateEnt(PlayerID)
{
if((Entity[PlayerID] = rg_create_entity("info_target")))
{
set_entvar(Entity[PlayerID], var_classname, "_covid_medical_mask");
set_entvar(Entity[PlayerID], var_model, HDModels[PlayerID] ? MEDICAL_MODEL : MEDICAL_MODEL_FIX);
set_entvar(Entity[PlayerID], var_modelindex, HDModels[PlayerID] ? Model[0] : Model[1]);
set_entvar(Entity[PlayerID], var_movetype, MOVETYPE_FOLLOW);
set_entvar(Entity[PlayerID], var_aiment, PlayerID);
}
}

#if defined MASK_ALL_MODE
HealthMsg(PlayerID, num)
{
client_print_color(PlayerID, print_team_default, "%l", num == 1 ? "COVID_HEALTH_MSG_PRE" : "COVID_HEALTH_MSG_POST", eCvarData[MASK_HEALTH_NUM]);
}
#endif

#if defined SAVE_MASK_MODE
SaveMask(PlayerID)
{
new AuthID[MAX_AUTHID_LENGTH], Data[12];

get_user_authid(PlayerID, AuthID, charsmax(AuthID));
formatex(Data, charsmax(Data), "%d", SaveMaskColor[PlayerID]);

nvault_set(Vault, AuthID, Data);
}
#endif

//Thanks Garey
stock RGBtoHUE(Float:rgb[3])
{
new Float:r = rgb[0] / 255.0;
new Float:g = rgb[1] / 255.0;
new Float:b = rgb[2] / 255.0;
new Float:cmax = floatmax(r, floatmax(g, b));
new Float:cmin = floatmin(r, floatmin(g, b));
new Float:delta = cmax - cmin;
new Float:H = 1.0;
if (!delta)
{
// undefined color seams like white or black which dont exists
return 0;
}
if (r == cmax)
{
H = (g - b) / delta;
}
else if (g == cmax)
{
H = 2.0 + (b - r) / delta;
}
else
{
H = 4.0 + (r - g) / delta;
}

H /= 6.0;

if (H < 0.0)
{
H += 1;
}

return floatround(H * 255);
}
Добрый вечер.Столкнулся с проблемкой данного плагина,установил всё вроде как по инструкции но вот столкнулся с тем,что модели масок вовсе не отображаются ни у одного игрока и при вызове меню /сv менюшка высвечивается и показанно что маски выкл,пытаешься включить не включается и менюха сама закрывается.В чём может быть загвоздка не кто не подскажет?
 
В этой теме было размещено решение! Перейти к решению.

wellasgood

Кидала, мошенник, вымогатель
Сообщения
1,409
Реакции
182
Помог
2 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Yaiceclav, товарищ, добрый день! Плагин тестировался, работало все хорошо!

Без ошибок не сможем Вам помочь..
28 Дек 2020
Единственное что могу по рекомендовать, это перепроверить все требования для работоспособности плагина и настройки.
 
Сообщения
48
Реакции
-4
wellasgood, Благодарю за помощь.Плагин с мешен в плане установки и вряд ли там можно что та проморгать)Я уже не однократно переустанавливал данную версию и поставил предыдущую версию и другими компиляторами пробывал но так же не каких изменений,одного не понимаю компилируется без ошибок, в логах тоже ошибки не показывает, модели при загрузке загружаются на клиент игры а в игре их нет, чего же ему не хватает :hunter:
 
Сообщения
1,340
Реакции
529
Помог
91 раз(а)
Yaiceclav, возможно конфликтует с плагинами, которые подгружают модели/caps
 
Сообщения
48
Реакции
-4
present, Благодарю.Нашел ошибку в логах
L 12/29/2020 - 00:22:45: [AMXX] Run time error 10 (plugin "Covid_mode.amxx") (native "rg_create_entity") - debug not enabled!
L 12/29/2020 - 00:22:45: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 12/29/2020 - 00:23:43: [ReAPI] ReGameDll: isn't available
29 Дек 2020
Поставил режим debug и теперь наблюдается
L 12/29/2020 - 07:05:29: Start of error session.
L 12/29/2020 - 07:05:29: Info (map "$2000$") (file "addons/amxmodx/logs/error_20201229.log")
L 12/29/2020 - 07:05:29: [ReAPI] RegisterHookChain: function (CBasePlayer_Spawn) is not available, ReGameDLL required.
L 12/29/2020 - 07:05:29: [AMXX] Displaying debug trace (plugin "Covid_mode.amxx", version "1.2.4")
L 12/29/2020 - 07:05:29: [AMXX] Run time error 10: native error (native "RegisterHookChain")
L 12/29/2020 - 07:05:29: [AMXX] [0] Covid_mode.sma::plugin_init (line 251)
29 Дек 2020
Прошу прощения за тавтологию,данный дебаг проводился на версии 1.2.4 с не тем исходным кодом который указан у меня.Исправил свою ошибку и вот
L 12/29/2020 - 07:13:35: Start of error session.
L 12/29/2020 - 07:13:35: Info (map "$2000$") (file "addons/amxmodx/logs/error_20201229.log")
L 12/29/2020 - 07:13:35: [ReAPI] RegisterHookChain: function (CBasePlayer_Spawn) is not available, ReGameDLL required.
L 12/29/2020 - 07:13:35: [AMXX] Displaying debug trace (plugin "Covid_mode.amxx", version "1.2.5")
L 12/29/2020 - 07:13:35: [AMXX] Run time error 10: native error (native "RegisterHookChain")
L 12/29/2020 - 07:13:35: [AMXX] [0] Covid_mode.sma::plugin_init (line 71)
 
Сообщения
48
Реакции
-4
present, Обновил ReGameDll и всё заработало как часики)Бесконечно благодарен за помощь,вы лучшие) Всех с наступающим НГ):good2:?
 
Статус
В этой теме нельзя размещать новые ответы.

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

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