Проблема с WurmUp 0.3

RockTheStreet

Саппорт года
Сообщения
1,743
Реакции
344
Помог
40 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Ошибка
При спавне игрока во время разминки появляются 4 сообщения. Там написано "Ошибка: Что-то пошло не так", при этом разминка работает.
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5249 (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: Jun 19 2019 13:31:53
Built from: https://github.com/alliedmodders/amxmodx/commit/6cecb34
Build ID: 5249:6cecb34
Core mode: JIT+ASM32
Билд
ReHLDS версия: 3.7.0.692-dev
Build date: 18:58:01 Sep 21 2019 (1988)
Build from: https://github.com/dreamstalker/rehlds/commit/e7232be
ReGamedll
ReGameDLL версия: 5.13.0.447-dev+m
Build date: 18:11:04 Jan 15 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/2eba3b1
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
description      stat pend  file                        vers             src  load  unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC4 ini ANY ANY
[ 4] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5249 ini Start ANY
[ 5] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 7] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 8] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 9] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl4 ANY Never
[10] ReAPI RUN - reapi_amxx_i386.so v5.10.0.188-dev pl4 ANY Never
[11] MySQL RUN - mysql_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[13] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[15] Engine RUN - engine_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[16] Fun RUN - fun_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
Список плагинов
[  1] ReAimDetector API       0.2.2       ReHLDS Team       reaimdetector.a  работает  
[ 2] Admin Loader 3.5 neygomon admin_loader_3. работает
[ 3] FreshBans 1.4.2b kanagava fresh_bans_142_ работает
[ 4] Online Helper 2.1.3 Nordic Warrior online_helper.a работает
[ 5] Map Manager 2.5.61 Mistrick mapmanager.amxx работает
[ 6] Admin Commands 1.9.0.5249 AMXX Dev Team admincmd.amxx работает
[ 7] Commands Menu 1.9.0.5249 AMXX Dev Team cmdmenu.amxx работает
[ 8] Players Menu 1.7 neugomon players_menu.am работает
[ 9] Maps Menu 1.4.1 neugomon mapsmenu.amxx работает
[ 10] Top Awards 0.2cx Safety1st top_awards.amxx работает
[ 11] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am работает
[ 12] AES: StatsX 0.5 Vega serfreeman1337 aes_statsx_cstr работает
[ 13] Admin Chat 1.9.0.5249 AMXX Dev Team adminchat.amxx работает
[ 14] Stats Конфигuration 1.9.0.5249 AMXX Dev Team statscfg.amxx работает
[ 15] Ultimate Chats Control 5.2(c) neygomon ucc.amxx debug
[ 16] UCC Addon: VoteGAG 1.2 neygomon ucc_votegag.amx работает
[ 17] Chat Manager 1.1.2-16 Mistrick chatmanager.amx работает
[ 18] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add работает
[ 19] Advert Messages 1.22 neygomon adverts.amxx работает
[ 20] AFK Control 1.4.1 [Rnd neygomon afk_control.amx работает
[ 21] Menus Front-End 1.5 neugomon menufront_end.a работает
[ 22] Ping Control 1.31 neygomon Ping_Control.am работает
[ 23] WebSiteBot 1.0 Parker; SpecWS.amxx работает
[ 24] DemoRecoder 1.1 neygomon amx_demorec.amx работает
[ 25] Mode 2x2 2.5re s1lent mode.amxx работает
[ 26] Reset Score 0.0.2f wopox1337 ResetScore.amxx работает
[ 27] Parachute Lite 1.0 Leo_[BH] parachute_lite. работает
[ 28] Show Damage 1.0 neygomon damager.amxx работает
[ 29] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amxx работает
[ 30] Say me and Say hp 1.4 neygomon sayme.amxx работает
[ 31] NightVIP 1.1 dev-cs vipnight.amxx работает
[ 32] Items Restrict 1.1 s1lent items_restrict. работает
[ 33] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx работает
[ 34] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike работает
[ 35] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am работает
[ 36] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. работает
[ 37] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste работает
[ 38] AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s aes_bonus_cstri работает
[ 39] AES Bonus: Flags 0.2 Sonyx aes_bonus_flags работает
Автор плагина
F@nt0M & h1k3
Версия плагина
0.3
Исходный код
#pragma semicolon 1

#define TOGGLE_PLUGINS
#define PLAY_SOUND

#include <amxmodx>
#include <hamsandwich>
#include <reapi>

#define TASK_ID_TIMER 1
#define TASK_ID_FINISH 2

enum _:ITEM {
WeaponIdType:ITEM_ID,
ITEM_TITLE[32]
};

new const ITEMS[][ITEM] = {
{WEAPON_M4A1, "M4A1"},
{WEAPON_AK47, "AK-47"},
{WEAPON_FAMAS, "Famas"},
{WEAPON_SCOUT, "SCOUT"},
};


#if defined PLAY_SOUND
new const SOUNDS[][] = {
"sound/rww/RoundStart.mp3",

};
#endif

#if defined TOGGLE_PLUGINS
new const PLUGINS[][] = {
"test.amxx"
};
#endif

enum {
SPAWN,
ON_SPAWN_EQUIP,
HAS_RESTRICT_ITEM,
DROP_PLAYER_ITEM,
ADD_PLAYER_ITEM,
DEAD_PLAYER_WEAPONS,
GIVE_C4,
KILLED,

HOOK_CHAIN_LAST // DO NOT EDIT
};

enum {
GAME_PLAYER_EQUIP,
PLAYE_WEAPON_STRIP,
ARMOURY_ENTITY,

HAM_HOOKS_LAST // DO NOT EDIT
};

new HookChain:roundEndPre, HookChain:addAccount;
new HookChain:hookChains[HOOK_CHAIN_LAST], HamHook:hamForwards[HAM_HOOKS_LAST];

new mp_round_infinite, round_infinite[32];
new mp_forcerespawn, forcerespawn;
new mp_respawn_immunitytime, respawn_immunitytime;
new csstats_pause, aes_track_pause;
new warmUpTime, warmUpMode, warmUpReward;

new bool:enabled = false;
new timer, hudSync, hudSyncStats;
#if defined PLAY_SOUND
new sounds[sizeof(SOUNDS)], soundsNum = 0;
#endif
new item, WeaponIdType:itemId, itemName[32], itemTitle[32];
new kills[MAX_PLAYERS + 1];

#if defined PLAY_SOUND
public plugin_precache() {
for (new i = 0; i < sizeof(SOUNDS); i++) {
if (file_exists(SOUNDS[i], true)) {
precache_generic(SOUNDS[i]);
sounds[soundsNum++] = i;
}
}
}
#endif

public plugin_init() {
register_plugin("[ReAPI] WurmUp", "0.3", "F@nt0M & h1k3");

roundEndPre = RegisterHookChain(RG_RoundEnd, "RoundEnd_Pre", false);
addAccount = RegisterHookChain(RG_CBasePlayer_AddAccount, "CBasePlayer_AddAccount_Pre", false);

hookChains[SPAWN] = RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn_Post", true);
hookChains[ON_SPAWN_EQUIP] = RegisterHookChain(RG_CBasePlayer_OnSpawnEquip, "CBasePlayer_OnSpawnEquip_Pre", false);
hookChains[HAS_RESTRICT_ITEM] = RegisterHookChain(RG_CBasePlayer_HasRestrictItem, "CBasePlayer_HasRestrictItem_Pre", false);
hookChains[DROP_PLAYER_ITEM] = RegisterHookChain(RG_CBasePlayer_DropPlayerItem, "CBasePlayer_DropPlayerItem_Pre", false);
hookChains[ADD_PLAYER_ITEM] = RegisterHookChain(RG_CBasePlayer_AddPlayerItem, "CBasePlayer_AddPlayerItem_Pre", false);
hookChains[DEAD_PLAYER_WEAPONS] = RegisterHookChain(RG_CSGameRules_DeadPlayerWeapons, "CSGameRules_DeadPlayerWeapons_Pre", false);
hookChains[GIVE_C4] = RegisterHookChain(RG_CSGameRules_GiveC4, "CSGameRules_GiveC4_Pre", false);
hookChains[KILLED] = RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed_Post", true);

hamForwards[GAME_PLAYER_EQUIP] = RegisterHam(Ham_Use, "game_player_equip", "HamHookSupercede", false);
hamForwards[PLAYE_WEAPON_STRIP] = RegisterHam(Ham_Use, "player_weaponstrip", "HamHookSupercede", false);
hamForwards[ARMOURY_ENTITY] = RegisterHam(Ham_CS_Restart, "armoury_entity", "HamHookSupercede", false);

// Toggle_Forwards(false);

mp_round_infinite = get_cvar_pointer("mp_round_infinite");
mp_forcerespawn = get_cvar_pointer("mp_forcerespawn");
mp_respawn_immunitytime = get_cvar_pointer("mp_respawn_immunitytime");
csstats_pause = get_cvar_pointer("csstats_pause");
aes_track_pause = get_cvar_pointer("aes_track_pause");

hudSync = CreateHudSyncObj();
hudSyncStats = CreateHudSyncObj();

Hide_ArmouryEntity();
BuyZone_ToogleSolid(SOLID_NOT);

warmUpTime = create_cvar("warmup_time", "60", .has_min = true, .min_val = 0.0);
warmUpMode = create_cvar("warmup_mode", "0", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0);
warmUpReward = create_cvar("warmup_reward", "0", .has_min = true, .min_val = 0.0);
}

public plugin_pause() {
if (!enabled) {
return;
}

Toggle_Cvars(false);
Toggle_Forwards(false);
#if defined TOGGLE_PLUGINS
Toggle_Plugins(true);
#endif
BuyZone_ToogleSolid(SOLID_TRIGGER);

DisableHookChain(roundEndPre);

set_member_game(m_bCompleteReset, true);
set_member_game(m_bGameStarted, true);
rg_round_end(0.1, WINSTATUS_DRAW, ROUND_GAME_COMMENCE, "");

Players_GiveItems(true);

DisableHookChain(addAccount);

remove_task(TASK_ID_TIMER);
remove_task(TASK_ID_FINISH);
}

public RoundEnd_Pre(const WinStatus:status, const ScenarioEventEndRound:event) {
#pragma unused status
if (event != ROUND_GAME_COMMENCE) {
return HC_CONTINUE;
}

new time = get_pcvar_num(warmUpTime);
if (time == 0) {
DisableHookChain(roundEndPre);
DisableHookChain(addAccount);
return HC_CONTINUE;
}

enabled = true;

Prepare_Item();

Toggle_Cvars(true);
#if defined TOGGLE_PLUGINS
Toggle_Plugins(false);
#endif
Players_GiveItems(false);

arrayset(kills, 0, sizeof(kills));
#if defined PLAY_SOUND
Send_Audio();
#endif
set_task(1.0, "TaskTimer", TASK_ID_TIMER, .flags = "a", .repeat = time);
timer = time;

SetHookChainReturn(ATYPE_BOOL, false);
return HC_SUPERCEDE;
}

public CBasePlayer_AddAccount_Pre(const id, const amount, const RewardType:type) {
if (get_pcvar_num(warmUpTime) == 0) {
return HC_CONTINUE;
}

switch (type) {
case RT_PLAYER_RESET: {
new reward = get_pcvar_num(warmUpReward);
if (reward > 0) {
SetHookChainArg(2, ATYPE_INTEGER, amount + (kills[id] * reward));
}
}
case RT_PLAYER_JOIN: {
SetHookChainArg(2, ATYPE_INTEGER, 0);
}
case RT_ENEMY_KILLED: {
SetHookChainArg(2, ATYPE_INTEGER, 1);
}
}
return HC_CONTINUE;
}

public CBasePlayer_Spawn_Post(const id) {
if (is_user_alive(id)) {
Player_GiveItem(id);
}
}

public CBasePlayer_OnSpawnEquip_Pre(const id) {
return HC_SUPERCEDE;
}

public CBasePlayer_HasRestrictItem_Pre() {
SetHookChainReturn(ATYPE_BOOL, true);
return HC_SUPERCEDE;
}

public CBasePlayer_DropPlayerItem_Pre() {
SetHookChainReturn(ATYPE_INTEGER, 0);
return HC_SUPERCEDE;
}

public CBasePlayer_AddPlayerItem_Pre() {
SetHookChainReturn(ATYPE_INTEGER, 0);
return HC_SUPERCEDE;
}

public CSGameRules_DeadPlayerWeapons_Pre() {
SetHookChainReturn(ATYPE_INTEGER, GR_PLR_DROP_GUN_NO);
}

public CSGameRules_GiveC4_Pre() {
return HC_SUPERCEDE;
}

public CBasePlayer_Killed_Post(const id, const killer) {
if (id != killer && is_user_connected(killer)) {
kills[killer]++;
}
}

public HamHookSupercede() {
return HAM_SUPERCEDE;
}

public TaskTimer() {
timer--;
if (timer > 0) {
set_hudmessage(135, 206, 235, .x = -1.0, .y = 0.08, .holdtime = 0.9, .channel = -1);
ShowSyncHudMsg(0, hudSync, "Разминка на %s!^nРестарт через %d сек", itemTitle, timer);

if (csstats_pause || aes_track_pause) {
set_hudmessage(255, 0, 0, .x = -1.0, .y = 0.05, .holdtime = 0.9, .channel = -1);
ShowSyncHudMsg(0, hudSyncStats, "[Статистика Отключена]");
}
} else {
BuyZone_ToogleSolid(SOLID_TRIGGER);
Toggle_Cvars(false);
#if defined TOGGLE_PLUGINS
Toggle_Plugins(true);
#endif
Toggle_Forwards(false);
Players_GiveItems(true);
set_task(0.2, "TaskFinish", TASK_ID_FINISH);

DisableHookChain(roundEndPre);
set_member_game(m_bCompleteReset, true);
set_member_game(m_bGameStarted, true);
rg_round_end(0.1, WINSTATUS_DRAW, ROUND_GAME_COMMENCE, "");
}
}

public TaskFinish() {
set_hudmessage(135, 206, 235, .x = -1.0, .y = 0.08, .holdtime = 5.0, .channel = -1);
ShowSyncHudMsg(0, hudSync, "Разминка окончена!");

if (csstats_pause || aes_track_pause) {
set_hudmessage(255, 0, 0, .x = -1.0, .y = 0.05, .holdtime = 5.0, .channel = -1);
ShowSyncHudMsg(0, hudSyncStats, "[Статистика Включена]");
}

DisableHookChain(addAccount);
enabled = false;
}

Toggle_Forwards(const bool:enable) {
for (new i = 0; i < HOOK_CHAIN_LAST; i++) {
if (enable) {
EnableHookChain(hookChains[i]);
} else {
DisableHookChain(hookChains[i]);
}
}
for (new i = 0; i < HAM_HOOKS_LAST; i++) {
if (enable) {
EnableHamForward(hamForwards[i]);
} else {
DisableHamForward(hamForwards[i]);
}
}
}

Toggle_Cvars(const bool:enable) {
if (enable) {
get_pcvar_string(mp_round_infinite, round_infinite, charsmax(round_infinite));
set_pcvar_string(mp_round_infinite, "1");

forcerespawn = get_pcvar_num(mp_forcerespawn);
set_pcvar_num(mp_forcerespawn, 3);

respawn_immunitytime = get_pcvar_num(mp_respawn_immunitytime);
set_pcvar_num(mp_respawn_immunitytime, 3);

if (csstats_pause) {
set_pcvar_num(csstats_pause, 1);
}

if (aes_track_pause) {
set_pcvar_num(aes_track_pause, 1);
}
} else {
set_pcvar_string(mp_round_infinite, round_infinite);
set_pcvar_num(mp_forcerespawn, forcerespawn);
set_pcvar_num(mp_respawn_immunitytime, respawn_immunitytime);

if (csstats_pause) {
set_pcvar_num(csstats_pause, 0);
}

if (aes_track_pause) {
set_pcvar_num(aes_track_pause, 0);
}
}
}

#if defined TOGGLE_PLUGINS
Toggle_Plugins(const bool:enable) {
for (new i = 0; i < sizeof(PLUGINS); i++) {
if (enable) {
unpause("ac", PLUGINS[i]);
} else {
pause("ac", PLUGINS[i]);
}
}
}
#endif

Players_GiveItems(const bool:defaultItems) {
new players[MAX_PLAYERS], num;
get_players(players, num, "ah");
for (new i = 0, player; i < num; i++) {
player = players[i];

rg_remove_all_items(player);
if (defaultItems) {
rg_give_default_items(player);
} else {
Player_GiveItem(player);
}
}
}

Player_GiveItem(const id) {
DisableHookChain(HookChain:hookChains[ADD_PLAYER_ITEM]);
rg_give_item(id, "weapon_knife", GT_APPEND);
new ent = rg_give_item(id, itemName, GT_APPEND);
if (ent > 0) {
rg_set_user_bpammo(id, itemId, rg_get_iteminfo(ent, ItemInfo_iMaxAmmo1));
}
EnableHookChain(HookChain:hookChains[ADD_PLAYER_ITEM]);
}

Hide_ArmouryEntity() {
new ent = NULLENT;
while ((ent = rg_find_ent_by_class(ent, "armoury_entity"))) {
if(get_member(ent, m_Armoury_iCount) > 0) {
set_entvar(ent, var_effects, get_entvar(ent, var_effects) | EF_NODRAW);
set_entvar(ent, var_solid, SOLID_NOT);
set_member(ent, m_Armoury_iCount, 0);
}
}
}

BuyZone_ToogleSolid(const solid) {
new ent = NULLENT;
while ((ent = rg_find_ent_by_class(ent, "func_buyzone"))) {
set_entvar(ent, var_solid, solid);
}
}

Prepare_Item() {
new lastItemStr[3], lastItem;
if (get_localinfo("warmup_last_item", lastItemStr, charsmax(lastItemStr))) {
lastItem = str_to_num(lastItemStr);
} else {
lastItem = -1;
}

switch (get_pcvar_num(warmUpMode)) {
case 1: {
item = (lastItem + 1) % sizeof(ITEMS);
}

default: {
new tries = 0;
do {
item = random(100) % sizeof(ITEMS);
} while (item == lastItem && tries < sizeof(ITEMS));
}
}

itemId = ITEMS[item][ITEM_ID];
rg_get_weapon_info(itemId, WI_NAME, itemName, charsmax(itemName));
copy(itemTitle, charsmax(itemTitle), ITEMS[item][ITEM_TITLE]);

num_to_str(item, lastItemStr, charsmax(lastItemStr));
set_localinfo("warmup_last_item", lastItemStr);
}

#if defined PLAY_SOUND
Send_Audio() {
if (soundsNum > 0) {
new sound = (soundsNum > 1) ? sounds[random(100) % soundsNum] : 0;
client_cmd(0, "mp3 play ^"%s^"", SOUNDS[sound]);
}
}
#endif
Собсна, как решить данную проблему? Не очень приятно, когда при каждом спавне во время разминки тебе плагин флудит в чат.

Отключал все плагины и по одному, и все разом(оставляя лишь плагин разминки, ничего более). Итог: сообщения появлялись, хотя я до последнего надеялся что проблема не в этом плагине.
 

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

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