Проблема с работой плагина [RE] Talisman

Сообщения
105
Реакции
6
Ошибка
Ошибка в работе плагина, описание чуть ниже!
ОС
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
Билд
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
Версия Metamod
Metamod-r v1.3.0.138, API (5:13)
Metamod-r build: 11:50:32 Nov 28 2023
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/5179c25
Список метамодулей
[ 1] Reunion        RUN   -    reunion.so                  v0.1.0.137         ini  Start Never
[ 2] ReSemiclip RUN - resemiclip_mm_i386.so v2.4.3 ini Chlvl ANY
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[ 5] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 6] WHBlocker RUN - whblocker_mm_i386.so v1.5.697 ini Chlvl ANY
[ 7] HitBox Fix RUN - hitbox_fix_mm_i386.so v1.1.5 ini Start ANY
[ 8] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5294 ini Start ANY
[ 9] ReAPI RUN - reapi_amxx_i386.so v5.24.0.300-dev pl8 ANY Never
[10] MySQL RUN - mysql_amxx_i386.so v1.9.0.5294 pl8 ANY ANY
[11] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5294 pl8 ANY ANY
[12] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl8 ANY Never
[13] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5294 pl8 ANY ANY
[14] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5294 pl8 ANY ANY
[15] Engine RUN - engine_amxx_i386.so v1.9.0.5294 pl8 ANY ANY
[16] AuthEmu RUN - authemu_amxx_i386.so v5.2.12.525-dev+m pl8 ANY Never
[17] Fun RUN - fun_amxx_i386.so v1.9.0.5294 pl8 ANY ANY
[18] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5294 pl8 ANY ANY
18 plugins, 18 running
Список плагинов
[  1] CSStatsX SQL            0.7.4+2     serfreeman1337    csstatsx_sql.am  running  
[ 2] [190] WallHack Viewer 20.06.06 SKAJIbnEJIb wallhack_viewer running
[ 3] [190] Vanga Detector 23.07.29 SKAJIbnEJIb & Pr vanga_detector. running
[ 4] [190] Blind RBS 20.06.06 SKAJIbnEJIb blind_rbs.amxx running
[ 5] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 6] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 7] Slots Reservation 1.9.0.5294 AMXX Dev Team adminslots.amxx running
[ 8] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 9] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 10] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 11] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 12] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 13] TimeLeft 1.9.0.5294 AMXX Dev Team timeleft.amxx running
[ 14] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 15] Stats Configuration 1.9.0.5294 AMXX Dev Team statscfg.amxx running
[ 16] Restrict Weapons 1.9.0.5294 AMXX Dev Team restmenu.amxx running
[ 17] FreshBans 1.4.8b kanagava fresh_bans_148- running
[ 18] Admin Loader 3.5 neygomon admin_loader.am running
[ 19] amxmodmenu_new 1.12 Russian MaFi9 amxmodmenu.amxx running
[ 20] Reset Score 1.0 Silenttt resetscore.amxx running
[ 21] Mode 2x2 2.5re s1lent mode.amxx running
[ 22] Bullet Damage 0.0.1 ConnorMcLeod damage.amxx running
[ 23] Parachute 1.0 maeStro parachute.amxx running
[ 24] Sound Freeze End 0.0.1 dev-cs roundstart_soun running
[ 25] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash.a running
[ 26] [GM] Free Vip 1.4.1 [GM] NWC gm_free_vip.amx running
[ 27] amxmodmenu_new 1.12 Russian MaFi9 prem_menu.amxx running
[ 28] Advanced Ultimate Weap 0.1.0b steelzzz auw.amxx running
[ 29] Auto Demo Recorder 2.2.1 F@nt0M auto_demo_recor running
[ 30] Team Balance Control 1.3.9 gyxoBka TeamBalanceCont running
[ 31] GFonRank 1.0 ApXuTekToR GFonRank.amxx running
[ 32] Menu 1.0 WaT_1 menu.amxx running
[ 33] Admin-Check 5.5 p1Mp & S1n[L]Ss Admin-Check.amx running
[ 34] Refill Weapon On Kill 0.0.1 Vaqtincha refill_weapon_o running
[ 35] Hud_info 2.1 h1k3 hud_info.amxx running
[ 36] Killer ScreenFade 0.0.5 Vaqtincha reapi_killer_sc running
[ 37] Say me and Say hp 1.4 neygomon KillHp.amxx running
[ 38] [ReAPI] Block Fire in 3.1.0 F@nt0M reapi_block_fir running
[ 39] Lite VoteBan 1.4 neygomon lite_voteban.am running
[ 40] Team Grenade Trails 1.0.0 fl0wer akr_trails.amxx running
[ 41] [ReAPI] Best player of 1.1.2 F@nt0M best_player_of_ running
[ 42] [FB] CSBANS Tools 0.0.2 uMk0 csbans_tools.am running
[ 43] ACS injection med-kit 1.0.6.2 DEV-CS.RU acs_injection.a running
[ 44] AFK Control 1.0 mx?! afk_control.amx running
[ 45] Light Style 0.0.2b b0t. LightStyle.amxx running
[ 46] Ping Control 1.2 mx?! ping_control.am running
[ 47] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amxx running
[ 48] Custom Smoke 1.08 bionext custom_smoke.am running
[ 49] GameName Changer 1.0.0 Nordic Warrior GameNameChanger running
[ 50] Ban Sound: Fresh Bans 1.0 Leo_[BH] ban_sound_fresh running
[ 51] SF Warn Menu 0.1.4g serfreeman1337 sf_warn_menu.am running
[ 52] ExItem: MegaGrenade 1.5 mx?! exitem_megagren running
[ 53] Autoresponder/Advertis 0.5 MaximusBrood ad_manager.amxx running
[ 54] Team Win In DHUD 1.0 Seroff teamwin.amxx running
[ 55] Style C4 Timer 3.1 OciXCrom crx_c4timer.amx running
[ 56] Smart-Smile Connect 1.0 dizquadSkezz uni_smileconnec running
[ 57] [GM] Weapon Models 2.0.0 [GM] NWC gm_weapon_model running
[ 58] [ReAPI] Healthnade 0.0.15f DEV-CS.RU Commun reapi_healthnad running
[ 59] New Plug-In 1.0 Kpoxa boss_life.amxx running
[ 60] BunnyHop Menu 1.2 OverGame bhop_menu.amxx running
[ 61] Lite Translit 2.8 neygomon lite_translit_c running
[ 62] ChatAdditions: Core v1.9.4 Sergey Shorokhov ChatAdditions_C running
[ 63] ChatAdditions: CSBans v1.9.4 Sergey Shorokhov CA_Storage_CSBa running
[ 64] CA: Anti Flood v1.9.4 Nordic Warrior CA_AntiFlood.am running
[ 65] CA: Mute v1.9.4 Sergey Shorokhov CA_Mute.amxx running
[ 66] CA Addon: Death mute v1.9.4 Sergey Shorokhov CA_Addon_DeathM running
[ 67] CA Addon: Request UnGA v1.9.4 steelzzz CA_Addon_Reques running
[ 68] CA: Gag v1.9.4 Sergey Shorokhov CA_Gag.amxx running
[ 69] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 70] AES: StatsX 0.5.9 [REA serfreeman1337/s aes_statsx_cstr running
[ 71] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 72] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 73] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 74] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 75] AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s aes_bonus_cstri running
[ 76] [RE] Talisman 1.4.2 BiZaJe talisman.amxx running
[ 77] [RE] Talisman Health 1.4.2 BiZaJe talisman_health running
[ 78] [RE] Talisman Sound 1.4.2 BiZaJe talisman_sound. running
Автор плагина
BiZaJe
Версия плагина
1.4.2
Исходный код
#include <tl_api>
#include <ini_file>

new const FileName[] = "talisman";
new const Section[] = "Models";

#define MODELS_MAX_LENGTH 32

new const ModelList[][] = {
"models/talisman.mdl"
}

new Array:g_ModelArray;

enum _:FwdTalisman {
GIVE_TALISMAN,
RISE_TALISMAN_PRE,
RISE_TALISMAN_POST,
DROPPED_TALISMAN_PRE,
DROPPED_TALISMAN_POST
};

enum CVARS
{
MIN_PLAYERS,
ROUND_ACCESS
};

new g_eFwdTalisman[FwdTalisman], g_eCvars[CVARS];
new FwdReturn;

new g_iPlayerId, g_MaxPlayers, g_iRoundCounter;
new g_ModelIndex[32];
new bool:g_bTalisman = false;

public plugin_init()
{
register_plugin("[RE] Talisman", PLUGIN_VERSION, "BiZaJe");

register_dictionary("talisman.txt");

RegisterHookChain(RG_CSGameRules_RestartRound, "@HC_CSGameRules_RestartRound_Pre", .post = false);
RegisterHookChain(RG_CBasePlayer_Killed, "@HC_CBasePlayer_Killed_Post", .post = true);

g_MaxPlayers = get_maxplayers()

@RegisterFwdTalisman();
@RegisterCvars();
}

@RegisterFwdTalisman(){
g_eFwdTalisman[GIVE_TALISMAN] = CreateMultiForward("give_talisman", ET_IGNORE);
g_eFwdTalisman[RISE_TALISMAN_PRE] = CreateMultiForward("rise_talisman_pre", ET_STOP, FP_CELL);
g_eFwdTalisman[RISE_TALISMAN_POST] = CreateMultiForward("rise_talisman_post", ET_IGNORE, FP_CELL);
g_eFwdTalisman[DROPPED_TALISMAN_PRE] = CreateMultiForward("drop_talisman_pre", ET_STOP);
g_eFwdTalisman[DROPPED_TALISMAN_POST] = CreateMultiForward("drop_talisman_post", ET_IGNORE, FP_CELL);
}

public plugin_natives()
{
register_native("player_is_talisman", "native_core_player_is_talisman");
register_native("is_talisman", "native_core_is_talisman");
}

public plugin_precache()
{
g_ModelArray = ArrayCreate(MODELS_MAX_LENGTH, 1);
ini_read_string_array(FileName, Section, "ModelList", g_ModelArray);

new model[MODELS_MAX_LENGTH], i;

if (ArraySize(g_ModelArray) == 0)
{
for (i = 0; i < sizeof(ModelList); i++)
ArrayPushString(g_ModelArray, ModelList[i]);

ini_write_string_array(FileName, Section, "ModelList", g_ModelArray);
}

for(i = 0; i < ArraySize(g_ModelArray); i++){
ArrayGetString(g_ModelArray, i, model, charsmax(model));
g_ModelIndex[i] = precache_model(model);
}
}

public client_disconnected(iPlayer)
{
if(g_iPlayerId == iPlayer){
@TalismanSpawn(iPlayer);
}
}

@HC_CSGameRules_RestartRound_Pre()
{
if(get_member_game(m_bCompleteReset)){
g_iRoundCounter = 0;
}
g_iRoundCounter++;

if(g_iRoundCounter < g_eCvars[ROUND_ACCESS] || get_playersnum() < g_eCvars[MIN_PLAYERS] || g_iPlayerId){
return;
}

g_bTalisman = false;

new iEnt = NULLENT;

while((iEnt = rg_find_ent_by_class(iEnt, "talisman"))){
if(!is_nullent(iEnt)){
set_entvar(iEnt, var_flags, FL_KILLME);
}
}

g_iPlayerId = RandomAlive(random_num(1, AliveCount()));

if(g_iPlayerId <= 0){
return;
}

client_print_color(0, g_iPlayerId, "%L %L", 0, "TALISMAN_PREFIX", 0, "TALISMAN_DROPPED_OUT", g_iPlayerId);

g_bTalisman = true;

ExecuteForward(g_eFwdTalisman[GIVE_TALISMAN], FwdReturn);
}

@HC_CBasePlayer_Killed_Post(const this, pevAttacker, iGib)
{
if(this == g_iPlayerId)
@TalismanSpawn(g_iPlayerId);
}

@Talisman_Touch(iEnt, iPlayer)
{
if(!is_entity(iEnt) || !is_user_connected(iPlayer))
return;

ExecuteForward(g_eFwdTalisman[RISE_TALISMAN_PRE], FwdReturn, iPlayer);

if(FwdReturn >= PLUGIN_HANDLED)
return;

SetTouch(iEnt, "");
set_entvar(iEnt, var_flags, get_entvar(iEnt, var_flags) | FL_KILLME);
client_print_color(0, iPlayer, "%L %L", 0, "TALISMAN_PREFIX", 0, "TALISMAN_RAISED", g_iPlayerId = iPlayer);
g_bTalisman = true;
ExecuteForward(g_eFwdTalisman[RISE_TALISMAN_POST], FwdReturn, iPlayer);
}

@RegisterCvars(){
bind_pcvar_num(create_cvar(
"talisman_round",
"3",
FCVAR_NONE,
"From which round to issue the talisman"),
g_eCvars[ROUND_ACCESS]
);
bind_pcvar_num(create_cvar(
"talisman_min_player",
"2",
FCVAR_NONE,
"Minimum number of players to include"),
g_eCvars[MIN_PLAYERS]
);

AutoExecConfig(true, "talisman_core");
}

public native_core_player_is_talisman()
{
return g_iPlayerId;
}

public native_core_is_talisman()
{
return g_bTalisman;
}

@TalismanSpawn(iPlayer)
{
ExecuteForward(g_eFwdTalisman[DROPPED_TALISMAN_PRE], FwdReturn);

if(FwdReturn >= PLUGIN_HANDLED)
return;

new Float:fOrigin[3], Float: fAngles[3];
get_entvar(iPlayer, var_origin, fOrigin);
new model[MODELS_MAX_LENGTH], iRndNum = random_num(0, ArraySize(g_ModelArray) - 1)
ArrayGetString(g_ModelArray, iRndNum, model, charsmax(model));

new iEnt = rg_create_entity("info_target", false);

if(!is_entity(iEnt))
return;

fAngles[1] = random_float(-180.0, 180.0);

set_entvar(iEnt, var_origin, fOrigin);
set_entvar(iEnt, var_classname, "talisman");
set_entvar(iEnt, var_model, model);
set_entvar(iEnt, var_modelindex, g_ModelIndex[iRndNum]);
set_entvar(iEnt, var_skin, random_num(0, 5));
set_entvar(iEnt, var_solid, SOLID_TRIGGER);
set_entvar(iEnt, var_movetype, MOVETYPE_TOSS);
set_entvar(iEnt, var_sequence, 0);
set_entvar(iEnt, var_framerate, 0.5);
set_entvar(iEnt, var_effects, 8);
set_entvar(iEnt, var_mins, Float:{-16.0,-16.0,-16.0})
set_entvar(iEnt, var_maxs, Float:{16.0,16.0,16.0})
set_entvar(iEnt, var_angles, fAngles);
client_print_color(0, iPlayer, "%L %L", 0, "TALISMAN_PREFIX", 0, "TALISMAN_LOST", g_iPlayerId);
ExecuteForward(g_eFwdTalisman[DROPPED_TALISMAN_POST], FwdReturn, iPlayer);
g_iPlayerId = 0
g_bTalisman = false;
SetTouch(iEnt, "@Talisman_Touch");
}

public plugin_end(){
ArrayDestroy(g_ModelArray);
}

/* The code is taken from ZP 5.0 */
stock AliveCount()
{
new iAlive, iPlayer;

for (iPlayer = 1; iPlayer <= g_MaxPlayers; iPlayer++)
{
if (is_user_alive(iPlayer) && ((get_member(iPlayer, m_iTeam) != TEAM_SPECTATOR) || (get_member(iPlayer, m_iTeam) != TEAM_UNASSIGNED)))
iAlive++;
}

return iAlive;
}

stock RandomAlive(target_index)
{
new iAlive, iPlayer;

for (iPlayer = 1; iPlayer <= g_MaxPlayers; iPlayer++)
{
if (is_user_alive(iPlayer) && ((get_member(iPlayer, m_iTeam) != TEAM_SPECTATOR) || (get_member(iPlayer, m_iTeam) != TEAM_UNASSIGNED)))
iAlive++;

if (iAlive == target_index)
return iPlayer;
}

return -1;
}
Ошибка в том что талисман просто сам по себе пропадает и не выдаётся. Я заметил что он пропадает и больше не выдаётся например когда все игроки зашли в спектра а потом назад в игру. И начинает опять всё работать после смены карты. Такой момент ещё, когда игрок остался один и он умер - в след. раунде талисман уже не выдаётся(до конца карты)
 
Сообщения
1,055
Реакции
212
Предупреждения
9
Помог
6 раз(а)
Поправлю этот момент в новой версии
 

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

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