Ошибка компиляции модуля MultiJump для плагина Vip Modular 5.0.0-b12 by ArKaNeMaN

Сообщения
9
Реакции
0
Версия SourceMod
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.776-dev
Build date: 19:37:50 Apr 20 2022 (2930)
Build from: https://github.com/dreamstalker/rehlds/commit/3dc9f8c
Компилятор
WEB-компилятор
Исходный код
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <reapi>
#include <VipModular>

#define GetRound() \
(get_member_game(m_iTotalRoundsPlayed) + 1)

#pragma semicolon 1
#pragma compress 1

public stock const PluginName[] = "[VipM-M] Multi Jump";
public stock const PluginVersion[] = "1.2.0";
public stock const PluginAuthor[] = "ArKaNeMaN";
public stock const PluginURL[] = "https://github.com/ArKaNeMaN/VipM-M-MultiJump";
public stock const PluginDescription[] = "Multi jump module for Vip Modular.";

new const MODULE_NAME[] = "MultiJump";
new const PARAM_COUNT_NAME[] = "Count";
new const PARAM_VEL_MULT_NAME[] = "VelMult";
new const PARAM_COOLDOWN_NAME[] = "Cooldown";
new const PARAM_MIN_ROUND_NAME[] = "MinRound"; // Не лимитами, т.к. часто дёргается

new g_iUserMaxJumps[MAX_PLAYERS + 1] = {0, ...};
new Float:g_iUserVelocityMultiplier[MAX_PLAYERS + 1] = {1.0, ...};
new Float:g_fUserCooldownDuration[MAX_PLAYERS + 1] = {0.0, ...};
new g_iUserMinRound[MAX_PLAYERS + 1] = {0, ...};

new g_iUserJumpsCounter[MAX_PLAYERS + 1] = {0, ...};
new Float:g_fUserCooldownExpiresAt[MAX_PLAYERS + 1] = {0.0, ...};

public VipM_OnInitModules() {
register_plugin(PluginName, PluginVersion, PluginAuthor);

VipM_Modules_Register(MODULE_NAME, false);
VipM_Modules_AddParams(MODULE_NAME,
PARAM_COUNT_NAME, ptInteger, false,
PARAM_VEL_MULT_NAME, ptFloat, false,
PARAM_COOLDOWN_NAME, ptFloat, false,
PARAM_MIN_ROUND_NAME, ptInteger, false
);
VipM_Modules_RegisterEvent(MODULE_NAME, Module_OnActivated, "@OnActivated");
VipM_Modules_RegisterEvent(MODULE_NAME, Module_OnCompareParams, "@OnCompareParams");
}

public VipM_OnUserUpdated(const UserId) {
if (VipM_Modules_HasModule(MODULE_NAME, UserId)) {
new Trie:Params = VipM_Modules_GetParams(MODULE_NAME, UserId);

g_iUserMaxJumps[UserId] = VipM_Params_GetInt(Params, PARAM_COUNT_NAME, 1);
g_iUserVelocityMultiplier[UserId] = VipM_Params_GetFloat(Params, PARAM_VEL_MULT_NAME, 1.0);
g_fUserCooldownDuration[UserId] = VipM_Params_GetFloat(Params, PARAM_COOLDOWN_NAME, 0.0);
g_iUserMinRound[UserId] = VipM_Params_GetInt(Params, PARAM_MIN_ROUND_NAME, 0);
} else {
SetDefaultValues(UserId);
}
}

public client_putinserver(UserId) {
SetDefaultValues(UserId);

g_iUserJumpsCounter[UserId] = 0;
g_fUserCooldownExpiresAt[UserId] = 0.0;
}

SetDefaultValues(const UserId) {
g_iUserMaxJumps[UserId] = 0;
g_iUserVelocityMultiplier[UserId] = 1.0;
g_fUserCooldownDuration[UserId] = 0.0;
g_iUserMinRound[UserId] = 0;
}

@OnActivated() {
RegisterHam(Ham_Player_Jump, "player", "@Hook_PlayerJump", false);
}

Trie:@OnCompareParams(const Trie:MainParams, const Trie:NewParams) {
new iOld = VipM_Params_GetInt(MainParams, PARAM_COUNT_NAME, 0);
new iNew = VipM_Params_GetInt(NewParams, PARAM_COUNT_NAME, 0);

if (iOld < 0 || iOld >= iNew) {
// Если надо оставить старые параметры, надо вернуть Invalid_Trie, иначе всё поломается)
// TODO: Сделать в ядре проверку, что вернулся старый Trie
// https://github.com/ArKaNeMaN/amxx-VipModular-pub/blob/master/amxmodx/scripting/VipM/Core/Modules/Units.inc#L91-L127

return Invalid_Trie;
// return MainParams;
}

return NewParams;
}

@Hook_PlayerJump(UserId){
if (
!g_iUserMaxJumps[UserId]
|| !is_user_alive(UserId)
) {
return HAM_IGNORED;
}

new szButton = pev(UserId, pev_button);
new szOldButton = pev(UserId, pev_oldbuttons);

if (!(szButton & IN_JUMP)) {
return HAM_IGNORED;
}

new Float:fGameTime = get_gametime();

if (pev(UserId, pev_flags) & FL_ONGROUND) {
if (g_iUserJumpsCounter[UserId] > 0 && g_fUserCooldownDuration[UserId] > 0.0) {
g_fUserCooldownExpiresAt[UserId] = fGameTime + g_fUserCooldownDuration[UserId];
}
g_iUserJumpsCounter[UserId] = 0;
return HAM_IGNORED;
}

if (
!(szOldButton & IN_JUMP)
&& (
g_iUserMaxJumps[UserId] < 0
|| g_iUserJumpsCounter[UserId] < g_iUserMaxJumps[UserId]
)
&& (
g_fUserCooldownExpiresAt[UserId] <= 0.0
|| g_fUserCooldownExpiresAt[UserId] <= fGameTime
)
&& GetRound() >= g_iUserMinRound[UserId]
) {
g_iUserJumpsCounter[UserId]++;

new Float:szVelocity[3];
pev(UserId, pev_velocity, szVelocity);
szVelocity[2] = random_float(295.0, 305.0);
szVelocity[2] *= g_iUserVelocityMultiplier[UserId];
set_pev(UserId, pev_velocity, szVelocity);
}

return HAM_IGNORED;
}
При попытке компилиривания выдает ошибку, помогите пожалуйста:sad::sad:
AMX Mod X Compiler 1.9.0.5271
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

/hlds/web/api/bin/user_include/VipModular.inc(96) : fatal error 100: cannot read from file: "VipM/AccessModes"

Compilation aborted.
1 Error.
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
timeout: the monitored command dumped core
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
9
Реакции
0
использовать нельзя.
учимся https://dev-cs.ru/threads/246/
Тоже не получается

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// VipM-M-MultiJump.sma
//
// C:\Users\user\Desktop\compilator_1_9_0\VipM-M-MultiJump.sma(5) : fatal error 100: cannot read from file: "VipModular"
//
// Compilation aborted.
// 1 Error.
// Could not locate output file C:\Users\user\Desktop\compilator_1_9_0\compiled\VipM-M-MultiJump.amx (compile failed).
//
// Compilation Time: 0,22 sec
// ----------------------------------------

Press enter to exit ...
 

ArKaNeMaN

Квалифицированный специалист по VipModular
Сообщения
456
Реакции
304
Помог
7 раз(а)
Сообщения
9
Реакции
0
Можете скомпилировать и отправить сюда пожалуйста если не трудно🙃🙂
 

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

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