Зимняя разминка, проблема со сменой карты через админ меню

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
21
Реакции
0
Предупреждения
5
Ошибка
При смене карты через админ меню разминка не запускается на новой карте, сразу пистолетка начинается и бесконечный раунд с возрождением.

Но если менять карту например через /rtv или через голосование по достижению конца карты то на новой карте разминка работает.
ОС
Linux
Amx Mod X
1.9.0
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.776-dev
Build date: 18:10:15 Apr 26 2022 (2936)
Build from: https://github.com/dreamstalker/rehlds/commit/3dc9f8c
ReGamedll
ReGameDLL version: 5.21.0.556-dev
Build date: 08:43:58 Jul 22 2022
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/1081301
Версия 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.0.1 ini Start Never
[ 2] SafeNameAndChat RUN - SafeNameAndChat. v1.1 ini ANY ANY
[ 3] VoiceTranscoder RUN - VoiceTranscoder. v2020MA2 ini ANY ANY
[ 4] AMX Mod X RUN - amxmodx_mm_i386. v1.9.0.5 ini Start ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 6] WHBlocker RUN - whblocker_mm_i38 v1.5.697 ini Chlvl ANY
[ 7] Rechecker RUN - rechecker_mm_i38 v2.7 ini Chlvl ANY
[ 8] Engine RUN - engine_amxx_i386 v1.9.0.5 pl4 ANY ANY
[ 9] FakeMeta RUN - fakemeta_amxx_i3 v1.9.0.5 pl4 ANY ANY
[10] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl4 ANY ANY
[11] ReAPI RUN - reapi_amxx_i386. v5.21.0. pl4 ANY Never
[12] MySQL RUN - mysql_amxx_i386. v1.9.0.5 pl4 ANY ANY
[13] CStrike RUN - cstrike_amxx_i38 v1.9.0.5 pl4 ANY ANY
[14] CSX RUN - csx_amxx_i386.so v1.9.0.5 pl4 ANY ANY
[15] Fun RUN - fun_amxx_i386.so v1.9.0.5 pl4 ANY ANY
15 plugins, 15 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] AIM detector 0.9.4.3b kanagava aim_detector_09 running
[ 2] [190] AMXBans RBS 20.06.06 SKAJIbnEJIb & La amxbans_rbs.amx running
[ 3] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 4] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 5] Slots Reservation 1.9.0.5294 AMXX Dev Team adminslots.amxx running
[ 6] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 7] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 8] [182] Cvar On Map 20.06.06 SKAJIbnEJIb cvar_on_map.amx running
[ 9] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 10] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 11] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 12] Menus Front-End 20.06.06 SKAJIbnEJIb & AM amxmodmenu_rbs. running
[ 13] CS Misc. Stats 1.9.0.5271 AMXX Dev Team miscstats.amxx running
[ 14] Multi-Lingual System 1.9.0.5294 AMXX Dev Team multilingual.am running
[ 15] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 16] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 17] Items Restrict 1.1 s1lent items_restrict. running
[ 18] [190] CsStats MySQL 22.11.15 SKAJIbnEJIb csstats_mysql.a running
[ 19] [190] Skill ELO 22.11.15 SKAJIbnEJIb skill_elo.amxx running
[ 20] [190] Stats Configurat 20.06.06 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 21] [190] StatsX RBS 21.03.23 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 22] [190] Ultimate Gag 21.01.02BE SKAJIbnEJIb ultimate_gag.am running
[ 23] [190] Chat RBS 20.06.06 SKAJIbnEJIb chat_rbs.amxx running
[ 24] [190] Ultimate Informe 21.03.23 SKAJIbnEJIb ultimate_inform running
[ 25] Teleport Menu 1.9.0.5294 AMXX Dev Team telemenu.amxx running
[ 26] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 27] Autoresponder/Advertis 0.5 MaximusBrood ad_manager.amxx running
[ 28] Admin ESP 1.5b_mini KoST admin_esp_mini. running
[ 29] Smoke FIX 0.1 many Smoke_FIX.amxx running
[ 30] Auto Demo Recorder 2.2.1 F@nt0M demo_recorder.a running
[ 31] Mode 2x2 1.9 s1lent mode.amxx running
[ 32] UnBanmenu 1 AMX Team unbanmenu.amxx running
[ 33] C4 Timer on roundtime 0.3.3a neygomon c4_timer_on_rou running
[ 34] Snow WarmUp 0.4 bizon reapi_snow_warm running
[ 35] [190] Ultimate Knife 22.11.15 SKAJIbnEJIb ultimate_knife. running
[ 36] Map Manager 2.5.61 Mistrick mapmanager.amxx running
[ 37] Map Manager: Sub Plugi 0.1 Mistrick mapmanager_subp running
[ 38] AFK Control 1.4.1 [Rnd neygomon afk_control.amx running
[ 39] Reset Score 0.2 Silenttt / CepeH RESET_SCORE_V0. running
[ 40] [190] High Ping Kicker 20.06.06 SKAJIbnEJIb hpk_rbs.amxx running
[ 41] [190] Ultimate Weapons 22.11.15 SKAJIbnEJIb ultimate_weapon running
[ 42] [190] VIP RBS 21.08.23BE SKAJIbnEJIb vip_rbs.amxx running
[ 43] [190] Snipers RBS 20.06.06 SKAJIbnEJIb snipers_rbs.amx running
[ 44] [190] Parachute RBS 22.11.15 SKAJIbnEJIb & KR parachute_rbs.a running
[ 45] Kills Counter 1.0 Safety1st kills_counter.a running
[ 46] Motd Model 1.0 Marenin motd_model.amxx running
[ 47] Admin Check 1.51 OneEyed admin_check.amx running
[ 48] Name_Change 1.0 Name_Change changed_name_un running
[ 49] Ammo 1.2 Ammo ammo.amxx running
[ 50] CS:GO Inspect Weapon 5.1.5 hellmonja csgo_inspect_we running
[ 51] Custom Models 1.3.2 neugomon custom_models.a running
[ 52] [190] Map Spawns Edito 20.06.06 SKAJIbnEJIb & iG MapSpawnsEditor running
[ 53] [190] SlayLosers RBS 20.06.06 SKAJIbnEJIb & d3 slaylosers_rbs. running
[ 54] [190] No Team Flash 20.06.06 SKAJIbnEJIb NoTeamFlash.amx running
[ 55] [190] Army Ranks Ultim 20.06.06 SKAJIbnEJIb army_ranks_ulti running
[ 56] Custom skies 0.0.1 Nordic Warrior CustomSkies.amx running
[ 57] Hostage no death T 1.0 Brute hostage_no_deat running
[ 58] Grenade Trail 1.0 Jim grenade_trail.a running
[ 59] Green Fade 0.1 Stimul Green_Fade.amxx running
[ 60] Snow Regulation 1.0 endemic snow_regulation running
60 plugins, 60 running
Автор плагина
https://dev-cs.ru/members/4218/
Версия плагина
https://dev-cs.ru/resources/1477/
Исходный код
#include <amxmodx>
#include <fakemeta>
#include <reapi>
#include <hamsandwich>
#include <xs>

new const PLUGIN_NAME[] = "Snow WarmUp";
new const PLUGIN_VERSION[] = "0.4";
new const PLUGIN_AUTHOR[] = "bizon";

new const SNOWBALL_MODEL_VIEW[] = "models/snow_warmup/v_snowball.mdl";
new const SNOWBALL_MODEL_PLAYER[] = "models/snow_warmup/p_snowball.mdl";
new const SNOWBALL_MODEL_WORLD[] = "models/snow_warmup/w_snowball.mdl";
//
new const ICE_CUBE_MODEL[] = "models/snow_warmup/ice_cube.mdl";
new const ICE_CUBE_CLASS[] = "ice_cube";
//
new const SNOWBALL_SOUND_FREEZE[] = "snow_warmup/freeze.wav";
new const SNOWBALL_SOUND_UNFREEZE[] = "snow_warmup/unfreeze.wav";
new const SNOWBALL_SOUND_SPLASH[] = "snow_warmup/splash.wav";
//
const TASK_USER_FREEZE = 0x134;
const TASK_AWARD_DELAY = 0x513;
//
const SNOWBALL_MEGA_THROW_COUNT = 8;
const Float: SNOWBALL_MEGA_THROW_DEGREES = 45.0;
const Float: SNOWBALL_MEGA_THROW_RADIUS = 300.0;
new const SNOWBALL_WEAPONLIST[] = "snow_warmup/weapon_snowball";

enum any: HookChainStruct
{
HookChain: HC_ROUND_END,
HookChain: HC_RESTART_ROUND,
HookChain: HC_PLAYER_SPAWN,
HookChain: HC_PLAYER_KILLED,
HookChain: HC_PLAYER_DUCK,
HookChain: HC_PLAYER_PRETHINK,
HookChain: HC_CAN_HAVE_PLAYER_ITEM,
HookChain: HC_THROW_SMOKE_GRENADE,
HookChain: HC_WEAPON_DEFAULT_DEPLOY,
HookChain: HC_PLAYER_RADIO,
};

enum any: CvarsStruct
{
CVAR_SWU_TIME,
CVAR_SWU_IS_FREEZE_USER,
CVAR_SWU_FREEZE_TIME_USER,
CVAR_SWU_DAMAGE_USER,
CVAR_SWU_START_HEALTH_USER,
CVAR_SWU_AWARD_WINNER_MONEY,
CVAR_SWU_MEGA_THROW_COUNT,
CVAR_SWU_AMBIENT_SOUND[MAX_RESOURCE_PATH_LENGTH]
};

enum any: StatesStruct
{
STATE_PLUGINS_ON,
STATE_PLUGINS_OFF,
STATE_CVARS_SET,
STATE_CVARS_UNSET,
}

new
g_iHook[HookChainStruct],
bool: bIsSnowWarmUp,
g_iTimer,
bool: g_bIsSoundPlayed[MAX_PLAYERS+1],
//
g_iCvarRoundInfinite,
g_iCvarForseRespawn,
g_member_bCTCantBuy,
g_member_bTCantBuy,
g_iIniParseState,
//
g_iSpriteTrail,
//
g_eCvar[CvarsStruct],
g_aStateInfo[StatesStruct],
//
g_iKillsCount[MAX_PLAYERS+1],
g_iMegaThrowKillsCount[MAX_PLAYERS+1];

public plugin_precache()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
@cvars_attach();

precache_model(SNOWBALL_MODEL_VIEW);
precache_model(SNOWBALL_MODEL_PLAYER);
precache_model(SNOWBALL_MODEL_WORLD);

precache_model(ICE_CUBE_MODEL);

precache_sound(SNOWBALL_SOUND_FREEZE);
precache_sound(SNOWBALL_SOUND_UNFREEZE);
precache_sound(SNOWBALL_SOUND_SPLASH);

if(g_eCvar[CVAR_SWU_AMBIENT_SOUND][0] != EOS)
precache_sound(g_eCvar[CVAR_SWU_AMBIENT_SOUND]);

precache_generic(fmt("sprites/%s.txt", SNOWBALL_WEAPONLIST));
precache_generic("sprites/snow_warmup/hud_snowball.spr");

g_iSpriteTrail = precache_model("sprites/zbeam3.spr");

register_dictionary("reapi_snow_warmpup.txt");
}

public client_disconnected(pPlayer)
{
g_iKillsCount[pPlayer] = 0;
@ice_cube_destroy_by_owner(pPlayer);

g_bIsSoundPlayed[pPlayer] = false;

remove_task(pPlayer + TASK_USER_FREEZE);
}

public plugin_init()
{
register_clcmd(SNOWBALL_WEAPONLIST, "@SnowBall_Switch");

g_iHook[HC_ROUND_END] = RegisterHookChain(RG_RoundEnd, "@RoundEnd_Pre");

@read_ini();
}

@SnowBall_Switch(pPlayer)
{
engclient_cmd(pPlayer, "weapon_smokegrenade");
return PLUGIN_HANDLED;
}

@RoundEnd_Pre(WinStatus: status, ScenarioEventEndRound: event, Float: tmDelay)
{
if(event != ROUND_GAME_COMMENCE)
return;

g_iHook[HC_RESTART_ROUND] = RegisterHookChain(RG_CSGameRules_RestartRound, "@CSGameRules_RestartRound_Pre");
// избегаем блок вызова RG_CBasePlayer_OnSpawnEquip вышестоящими плагинами, RG_CSGameRules_PlayerSpawn - тоже не вариант
g_iHook[HC_PLAYER_SPAWN] = RegisterHookChain(RG_CBasePlayer_Spawn, "@CBasePlayer_Spawn_Post", true);
g_iHook[HC_PLAYER_KILLED] = RegisterHookChain(RG_CBasePlayer_Killed, "@CBasePlayer_Killed_Post", true);
g_iHook[HC_PLAYER_DUCK] = RegisterHookChain(RG_CBasePlayer_Duck, "@CBasePlayer_Duck_Pre");

if(g_eCvar[CVAR_SWU_MEGA_THROW_COUNT])
g_iHook[HC_PLAYER_PRETHINK] = RegisterHookChain(RG_CBasePlayer_PreThink, "@CBasePlayer_PreThink");

g_iHook[HC_CAN_HAVE_PLAYER_ITEM] = RegisterHookChain(RG_CSGameRules_CanHavePlayerItem, "@CSGameRules_CanHavePlayerItem_Pre");
g_iHook[HC_THROW_SMOKE_GRENADE] = RegisterHookChain(RG_ThrowSmokeGrenade, "@ThrowSmokeGrenade_Post", true);
g_iHook[HC_WEAPON_DEFAULT_DEPLOY] = RegisterHookChain(RG_CBasePlayerWeapon_DefaultDeploy, "@CBasePlayerWeapon_DefaultDeploy_Pre");
g_iHook[HC_PLAYER_RADIO] = RegisterHookChain(RG_CBasePlayer_Radio, "@CBasePlayer_Radio_Pre");

g_iCvarRoundInfinite = get_cvar_num("mp_round_infinite");
g_iCvarForseRespawn = get_cvar_num("mp_forcerespawn");
set_cvar_num("mp_round_infinite", 1);
set_cvar_num("mp_forcerespawn", 1);

g_member_bCTCantBuy = get_member_game(m_bCTCantBuy);
g_member_bTCantBuy = get_member_game(m_bTCantBuy);
set_member_game(m_bCTCantBuy, true);
set_member_game(m_bTCantBuy, true);

DisableHookChain(g_iHook[HC_ROUND_END]);
}

@CSGameRules_RestartRound_Pre()
{
if(bIsSnowWarmUp)
{
DisableHookChain(g_iHook[HC_RESTART_ROUND]);
DisableHookChain(g_iHook[HC_PLAYER_SPAWN]);
DisableHookChain(g_iHook[HC_PLAYER_KILLED]);
DisableHookChain(g_iHook[HC_PLAYER_DUCK]);

if(g_eCvar[CVAR_SWU_MEGA_THROW_COUNT])
DisableHookChain(g_iHook[HC_PLAYER_PRETHINK]);

DisableHookChain(g_iHook[HC_CAN_HAVE_PLAYER_ITEM]);
DisableHookChain(g_iHook[HC_THROW_SMOKE_GRENADE]);
DisableHookChain(g_iHook[HC_WEAPON_DEFAULT_DEPLOY]);
DisableHookChain(g_iHook[HC_PLAYER_RADIO]);

set_cvar_num("mp_round_infinite", g_iCvarRoundInfinite);
set_cvar_num("mp_forcerespawn", g_iCvarForseRespawn);

set_member_game(m_bCTCantBuy, g_member_bCTCantBuy);
set_member_game(m_bTCantBuy, g_member_bTCantBuy);

if(g_eCvar[CVAR_SWU_AMBIENT_SOUND][0] != EOS)
client_cmd(0, "stopsound");

new
pBestPlayer,
iMax,
iArraySize,
sData[64],
iStartMoney;

iStartMoney = get_cvar_num("mp_startmoney");

for(new pPlayer = 1; pPlayer <= MaxClients; pPlayer++)
{
if(!is_user_connected(pPlayer))
continue;

set_msg_weaponlist(pPlayer, "weapon_smokegrenade", 13, 1, -1, -1, 3, 3, WEAPON_SMOKEGRENADE, (ITEM_FLAG_LIMITINWORLD|ITEM_FLAG_EXHAUSTIBLE));

if(g_iKillsCount[pPlayer] > iMax)
{
pBestPlayer = pPlayer;
iMax = g_iKillsCount[pPlayer];
}

rg_add_account(pPlayer, iStartMoney, AS_SET);
}

set_task(0.5, "@func_give_award", pBestPlayer + TASK_AWARD_DELAY);

iArraySize = ArraySize(any: g_aStateInfo[STATE_PLUGINS_ON]);
for(new i; i < iArraySize; i++)
{
ArrayGetString(any: g_aStateInfo[STATE_PLUGINS_ON], i, sData, charsmax(sData));
unpause("ac", sData);
}

iArraySize = ArraySize(any: g_aStateInfo[STATE_CVARS_SET]);
for(new i; i < iArraySize; i++)
{
ArrayGetString(any: g_aStateInfo[STATE_CVARS_SET], i, sData, charsmax(sData));
server_cmd("%s", sData);

}
server_exec();

}else{
g_iTimer = g_eCvar[CVAR_SWU_TIME];
set_task(1.0, "@func_hud_info", 0xC0DE, .flags = "b");

new
iFwd,
iArraySize,
sData[64];

iFwd = CreateMultiForward("swu_start", ET_CONTINUE);
ExecuteForward(iFwd);

iArraySize = ArraySize(any: g_aStateInfo[STATE_PLUGINS_OFF]);
for(new i; i < iArraySize; i++)
{
ArrayGetString(any: g_aStateInfo[STATE_PLUGINS_OFF], i, sData, charsmax(sData));
pause("ac", sData);
}

iArraySize = ArraySize(any: g_aStateInfo[STATE_CVARS_UNSET]);
for(new i; i < iArraySize; i++)
{
ArrayGetString(any: g_aStateInfo[STATE_CVARS_UNSET], i, sData, charsmax(sData));
server_cmd("%s", sData);
}
server_exec();
}

bIsSnowWarmUp = true;
}

@CBasePlayer_Spawn_Post(pPlayer)
{
if(!is_user_alive(pPlayer))
return;

rg_remove_all_items(pPlayer);

DisableHookChain(g_iHook[HC_CAN_HAVE_PLAYER_ITEM]);

new iItem;
iItem = rg_give_item(pPlayer, "weapon_smokegrenade");

if(!is_nullent(iItem))
{
rg_set_iteminfo(iItem, ItemInfo_iMaxAmmo1, 999);
rg_set_user_bpammo(pPlayer, get_member(iItem, m_iId), 999);
}

EnableHookChain(g_iHook[HC_CAN_HAVE_PLAYER_ITEM]);

set_entvar(pPlayer, var_health, Float: float(g_eCvar[CVAR_SWU_START_HEALTH_USER]));

if(g_eCvar[CVAR_SWU_AMBIENT_SOUND][0] && !g_bIsSoundPlayed[pPlayer])
{
g_bIsSoundPlayed[pPlayer] = true;
rg_send_audio(pPlayer, g_eCvar[CVAR_SWU_AMBIENT_SOUND], PITCH_NORM);
}

set_msg_weaponlist(pPlayer, SNOWBALL_WEAPONLIST, 13, 1, -1, -1, 3, 3, WEAPON_SMOKEGRENADE, (ITEM_FLAG_LIMITINWORLD|ITEM_FLAG_EXHAUSTIBLE));

g_iMegaThrowKillsCount[pPlayer] = 0;
}

@CBasePlayer_Killed_Post(pVictim, pKiller, iGibs)
{
rg_set_rendering(pVictim, kRenderFxNone, 255, 255, 255, kRenderNormal, 16);
rg_reset_maxspeed(pVictim);
set_entvar(pVictim, var_gravity, 1.0);

@ice_cube_destroy_by_owner(pVictim);
remove_task(pVictim + TASK_USER_FREEZE);

if(is_user_connected(pKiller))
{
g_iKillsCount[pKiller]++;
g_iMegaThrowKillsCount[pKiller]++;
}
}

@CBasePlayer_Jump_Pre(pPlayer)
{
if(Float: get_entvar(pPlayer, var_maxspeed) == -1.0)
{
set_entvar(pPlayer, var_button, get_entvar(pPlayer, var_button) & ~IN_JUMP);
SetHookChainReturn(ATYPE_INTEGER, 0);
return HC_SUPERCEDE;
}

return HC_CONTINUE;
}

@CBasePlayer_Duck_Pre(pPlayer)
{
if(Float: get_entvar(pPlayer, var_maxspeed) == -1.0)
set_entvar(pPlayer, var_oldbuttons, get_entvar(pPlayer, var_oldbuttons) | IN_DUCK);
}

@CBasePlayer_PreThink(pPlayer)
{
if(!is_user_alive(pPlayer) || ~get_entvar(pPlayer, var_button) & IN_ATTACK2 || g_iMegaThrowKillsCount[pPlayer] < g_eCvar[CVAR_SWU_MEGA_THROW_COUNT])
return;

g_iMegaThrowKillsCount[pPlayer] = 0;

new
Float: fOriginStart[3],
Float: fOriginEnd[3],
Float: fDegrees;

get_entvar(pPlayer, var_origin, fOriginStart);

for(new i; i < SNOWBALL_MEGA_THROW_COUNT; i++)
{
fOriginEnd[0] = fOriginStart[0] + SNOWBALL_MEGA_THROW_RADIUS * floatcos(fDegrees, degrees);
fOriginEnd[1] = fOriginStart[1] + SNOWBALL_MEGA_THROW_RADIUS * floatsin(fDegrees, degrees);
fOriginEnd[2] = fOriginStart[2];

@snowball_throw(pPlayer, fOriginStart, fOriginEnd, true);

fDegrees += SNOWBALL_MEGA_THROW_DEGREES;
}

static const iSequenceThrow = 2; // anim throw
set_msg_svc_weaponanim(pPlayer, iSequenceThrow);
set_member(pPlayer, m_flNextAttack, 3.0);
}

@CSGameRules_CanHavePlayerItem_Pre(pPlayer, iItem)
{
if(is_nullent(iItem))
return HC_CONTINUE;

rg_remove_entity(iItem)
SetHookChainReturn(ATYPE_INTEGER, 0);
return HC_SUPERCEDE;
}

@ThrowSmokeGrenade_Post(pPlayer, Float: fOrigin[3], Float: fVelocity[3], Float: flTime, const usEvent)
{
new eEnt;
eEnt = GetHookChainReturn(ATYPE_INTEGER);

if(!is_nullent(eEnt))
engfunc(EngFunc_RemoveEntity, eEnt);

new Float: fOriginEnd[3];
get_origin_aiming(pPlayer, fOriginEnd, 8192.0);

@snowball_throw(pPlayer, fOrigin, fOriginEnd, false);
}

@CBasePlayerWeapon_DefaultDeploy_Pre(iItem, szViewModel[], szWeaponModel[], iAnim, szAnimExt[], skiplocal)
{
if(!is_nullent(iItem) && get_member(iItem, m_iId) == WEAPON_SMOKEGRENADE)
{
SetHookChainArg(2, ATYPE_STRING, SNOWBALL_MODEL_VIEW);
SetHookChainArg(3, ATYPE_STRING, SNOWBALL_MODEL_PLAYER);
}
}

@CBasePlayer_Radio_Pre(pPlayer, iMsgIndex, sMsgVerbose[], iPitch, bool: bIsShowIcon)
{
SetHookChainReturn(ATYPE_INTEGER, 0);
return HC_SUPERCEDE;
}

@snowball_throw(pPlayer, Float: fOriginStart[3], Float: fOriginEnd[3], bool: bIsMegaThrow)
{
new
eEnt,
Float: fVelocity[3];

xs_vec_sub(fOriginEnd, fOriginStart, fVelocity);
xs_vec_normalize(fVelocity, fVelocity);
xs_vec_mul_scalar(fVelocity, 1999.0, fVelocity);

eEnt = rg_create_entity("info_target");

engfunc(EngFunc_SetModel, eEnt, SNOWBALL_MODEL_WORLD);
engfunc(EngFunc_SetOrigin, eEnt, fOriginStart);
engfunc(EngFunc_SetSize, eEnt, Float: { -3.0, -3.0, -3.0 }, Float: { 3.0, 3.0, 2.0 });

set_entvar(eEnt, var_classname, "snowball");
set_entvar(eEnt, var_owner, pPlayer);
set_entvar(eEnt, var_iuser4, bIsMegaThrow);
set_entvar(eEnt, var_movetype, MOVETYPE_TOSS);
set_entvar(eEnt, var_solid, SOLID_BBOX);

if(vector_length(fVelocity) != 0.0)
set_entvar(eEnt, var_velocity, fVelocity);

SetTouch(eEnt, "@touch_snowball");

set_msg_beamfollow(eEnt, g_iSpriteTrail, 3, 5, 0, 255, 255, 150);
}

@touch_snowball(eEnt, pToucher)
{
if(is_nullent(eEnt))
return;

new
pOwner,
Float: flGameTime;

pOwner = get_entvar(eEnt, var_owner);
flGameTime = get_gametime();

if(is_user_connected(pToucher) && pOwner != pToucher && is_user_connected(pOwner) && rg_is_player_can_takedamage(pOwner, pToucher))
{
new Float: fOriginIceCube[3];
get_entvar(pToucher, var_origin, fOriginIceCube);

if(g_eCvar[CVAR_SWU_IS_FREEZE_USER])
{
if(task_exists(pToucher + TASK_USER_FREEZE))
change_task(pToucher + TASK_USER_FREEZE, float(g_eCvar[CVAR_SWU_FREEZE_TIME_USER]));
else
{
set_task(float(g_eCvar[CVAR_SWU_FREEZE_TIME_USER]), "@func_reset_user_freeze", pToucher + TASK_USER_FREEZE);
set_entvar(pToucher, var_velocity, Float: { 0.0, 0.0, 0.0 });

new eIceCube
eIceCube = rg_create_entity("info_target");

engfunc(EngFunc_SetModel, eIceCube, ICE_CUBE_MODEL);
engfunc(EngFunc_SetOrigin, eIceCube, fOriginIceCube);

set_entvar(eIceCube, var_classname, ICE_CUBE_CLASS);
set_entvar(eIceCube, var_iuser3, pToucher);
set_entvar(eIceCube, var_ltime, flGameTime + float(g_eCvar[CVAR_SWU_FREEZE_TIME_USER]));
set_entvar(eIceCube, var_nextthink, flGameTime + 0.1);

if(get_entvar(eEnt, var_iuser4))
set_entvar(eIceCube, var_body, 1);

SetThink(eIceCube, "@think_ice_cube");
}

rg_set_rendering(pToucher, kRenderFxGlowShell, 0, 255, 255, kRenderNormal, 16);
set_entvar(pToucher, var_maxspeed, -1.0);
set_entvar(pToucher, var_gravity, 99.0);
}

emit_sound(pToucher, CHAN_STATIC, SNOWBALL_SOUND_FREEZE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);

static const Float: fDamageHitGroup[] =
{
1.0, // HIT_GENERIC
1.5, // HIT_HEAD
1.2, // HIT_CHEST
1.1, // HIT_STOMACH
1.1, // HIT_LEFTARM
1.1, // HIT_RIGHTARM
1.0, // HIT_LEFTLEG
1.0, // HIT_RIGHTLEG
1.0 // HIT_SHIELD
};

engfunc(EngFunc_TraceLine, fOriginIceCube, fOriginIceCube, DONT_IGNORE_MONSTERS, eEnt, 0);

new iHitGroup;
iHitGroup = get_tr2(0, TR_iHitgroup);
set_member(pToucher, m_LastHitGroup, iHitGroup);

ExecuteHamB(Ham_TakeDamage, pToucher, eEnt, pOwner, float(g_eCvar[CVAR_SWU_DAMAGE_USER]) * fDamageHitGroup[iHitGroup], DMG_FREEZE);
}

new
Float: fOrigin[3],
iVelocity[3];

get_entvar(eEnt, var_origin, fOrigin);

for(new i; i < sizeof(iVelocity); i++)
iVelocity[i] = random_num(-500, 500);

set_msg_bloodstream(fOrigin, iVelocity, 254, 70);
emit_sound(eEnt, CHAN_STATIC, SNOWBALL_SOUND_SPLASH, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);

SetThink(eEnt, "@think_snowball_remove");
SetTouch(eEnt, "");

set_entvar(eEnt, var_nextthink, flGameTime + 0.1);
}

@think_snowball_remove(eEnt)
{
rg_remove_entity(eEnt);
}

@think_ice_cube(eEnt)
{
new
Float: flGameTime,
Float: flLifeTime,
iState;

flGameTime = get_gametime();
flLifeTime = get_entvar(eEnt, var_ltime);

if(flLifeTime < flGameTime)
{
iState = get_entvar(eEnt, var_impulse);

if(iState)
rg_remove_entity(eEnt);
else
{
set_entvar(eEnt, var_impulse, ++iState);
static const Float: flAnimTimeDestroyIceCube = 3.0;

set_entvar(eEnt, var_body, 0);
set_entvar(eEnt, var_framerate, flAnimTimeDestroyIceCube / 10.0);
set_entvar(eEnt, var_nextthink, flGameTime + flAnimTimeDestroyIceCube);
}
}
else
{
new
pOwner,
Float: fOrigin[3];

pOwner = get_entvar(eEnt, var_iuser3);
get_entvar(pOwner, var_origin, fOrigin);

static const Float: flCorrectOriginAxisDown = 40.0;
fOrigin[2] -= flCorrectOriginAxisDown;

set_entvar(eEnt, var_origin, fOrigin);
set_entvar(eEnt, var_nextthink, flGameTime + 0.1);
}
}

@func_hud_info(iTask)
{
if(g_iTimer <= 0)
{
remove_task(iTask);
server_cmd("sv_restart 1");
}else{
new
pPlayers[32],
iPlayersCount,
sSeconds[16];

get_players(pPlayers, iPlayersCount, "ach");

for(new i, pPlayer; i < iPlayersCount; i++)
{
pPlayer = pPlayers[i];

correct_word_seconds(g_iTimer, pPlayer, sSeconds, charsmax(sSeconds));

set_dhudmessage(0, 255, 255, -1.0, 0.04, .holdtime = 0.8);
show_dhudmessage(pPlayer, "%L", pPlayer, "SWU_TIMER_INFO", g_iTimer, sSeconds);

if(g_eCvar[CVAR_SWU_MEGA_THROW_COUNT])
{
if(g_iMegaThrowKillsCount[pPlayer] >= g_eCvar[CVAR_SWU_MEGA_THROW_COUNT])
{
set_dhudmessage(random(255), random(255), random(255), -1.0, 0.85, .holdtime = 0.8);
show_dhudmessage(pPlayer, "%L", pPlayer, "SWU_MEGA_THROW_ACTIVE");
}else{
set_dhudmessage(255, 255, 255, -1.0, 0.85, .holdtime = 0.8);
show_dhudmessage(pPlayer, "%L", pPlayer, "SWU_MEGA_THROW_RELOAD", g_iMegaThrowKillsCount[pPlayer] * 100 / g_eCvar[CVAR_SWU_MEGA_THROW_COUNT]);
}
}
}

g_iTimer--;
}
}

@func_reset_user_freeze(pPlayer)
{
pPlayer -= TASK_USER_FREEZE;

rg_set_rendering(pPlayer);
rg_reset_maxspeed(pPlayer);
set_entvar(pPlayer, var_gravity, 1.0);

emit_sound(pPlayer, CHAN_STATIC, SNOWBALL_SOUND_UNFREEZE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
}

@func_give_award(pBestPlayer)
{
pBestPlayer -= TASK_AWARD_DELAY;

set_dhudmessage(0, 255, 255, -1.0, 0.04, .holdtime = 5.0);

new bool: bIsConnectedBestPlayer;
bIsConnectedBestPlayer = bool: is_user_connected(pBestPlayer);

for(new pPlayer = 1; pPlayer <= MaxClients; pPlayer++)
{
if(bIsConnectedBestPlayer)
show_dhudmessage(pPlayer, "%L", pPlayer, "SWU_TIMER_END_ADD", pBestPlayer);
else
show_dhudmessage(pPlayer, "%L", pPlayer, "SWU_TIMER_END");
}

if(bIsConnectedBestPlayer)
rg_add_account(pBestPlayer, g_eCvar[CVAR_SWU_AWARD_WINNER_MONEY]);

new iFwd;
iFwd = CreateMultiForward("swu_end", ET_CONTINUE, FP_CELL);
ExecuteForward(iFwd, _, pBestPlayer);
}

@ice_cube_destroy_by_owner(pPlayer)
{
new eEnt;
eEnt = NULLENT;

while((eEnt = rg_find_ent_by_class(eEnt, ICE_CUBE_CLASS)))
{
if(!is_nullent(eEnt) && get_entvar(eEnt, var_iuser3) == pPlayer)
{
set_entvar(eEnt, var_ltime, -1.0);
return;
}
}
}

@cvars_attach()
{
bind_pcvar_num(
create_cvar(
"swu_time", "100", FCVAR_SERVER,
.description = "Время разминки (в секундах)",
.has_min = false, .min_val = 0.0,
.has_max = false, .max_val = 0.0
), g_eCvar[CVAR_SWU_TIME]
);

bind_pcvar_num(
create_cvar(
"swu_is_freeze_user", "1", FCVAR_SERVER,
.description = "Замораживать ли игрока при попадании в него снежком?^n1 - да, 0 - нет",
.has_min = true, .min_val = 0.0,
.has_max = true, .max_val = 1.0
), g_eCvar[CVAR_SWU_IS_FREEZE_USER]
);

bind_pcvar_num(
create_cvar(
"swu_freeze_time_user", "3", FCVAR_SERVER,
.description = "На сколько секунд замораживать игрока при попадании в него снежком?",
.has_min = false, .min_val = 0.0,
.has_max = false, .max_val = 0.0
), g_eCvar[CVAR_SWU_FREEZE_TIME_USER]
);

bind_pcvar_num(
create_cvar(
"swu_damage_user", "55", FCVAR_SERVER,
.description = "Сколько урона получает игрок при попадании в него снежком?",
.has_min = false, .min_val = 0.0,
.has_max = false, .max_val = 0.0
), g_eCvar[CVAR_SWU_DAMAGE_USER]
);

bind_pcvar_num(
create_cvar(
"swu_start_health_user", "100", FCVAR_SERVER,
.description = "Изначальное здоровье игрока на разминке",
.has_min = false, .min_val = 0.0,
.has_max = false, .max_val = 0.0
), g_eCvar[CVAR_SWU_START_HEALTH_USER]
);

bind_pcvar_num(
create_cvar(
"swu_award_winner_money", "2500", FCVAR_SERVER,
.description = "Награда для победителя (сделавшего бОльшее количество фрагов) в разминке (в $)",
.has_min = false, .min_val = 0.0,
.has_max = false, .max_val = 0.0
), g_eCvar[CVAR_SWU_AWARD_WINNER_MONEY]
);

bind_pcvar_num(
create_cvar(
"swu_mega_throw_count", "5", FCVAR_SERVER,
.description = "Количество убийств для доступа к мегаброску^n0 - отключает мегабросок",
.has_min = false, .min_val = 0.0,
.has_max = false, .max_val = 0.0
), g_eCvar[CVAR_SWU_MEGA_THROW_COUNT]
);

bind_pcvar_string(
create_cvar(
"swu_ambient_sound", "ambience/wind1.wav", FCVAR_SERVER,
.description = "Звук, который будет воспроизводиться при старте разминки\
^nОставьте настройку пустой, чтобы звук не воспроизводился",
.has_min = false, .min_val = 0.0,
.has_max = false, .max_val = 0.0
), g_eCvar[CVAR_SWU_AMBIENT_SOUND], charsmax(g_eCvar[CVAR_SWU_AMBIENT_SOUND])
);

AutoExecConfig(true);
}

@read_ini()
{
g_aStateInfo[STATE_PLUGINS_ON] = any: ArrayCreate(64);
g_aStateInfo[STATE_PLUGINS_OFF] = any: ArrayCreate(64);
g_aStateInfo[STATE_CVARS_SET] = any: ArrayCreate(64);
g_aStateInfo[STATE_CVARS_UNSET] = any: ArrayCreate(64);

new const INI_PATH_FILE[] = "/reapi_snow_warmup.ini";

new sPathFile[128];
get_localinfo("amxx_configsdir", sPathFile, charsmax(sPathFile));
add(sPathFile, charsmax(sPathFile), INI_PATH_FILE);

if(!file_exists(sPathFile))
{
log_amx("Предупреждение (некритичное): отсутствует файл `%s`", sPathFile);
return;
}

new INIParser: iIniParserHandle;
iIniParserHandle = INI_CreateParser();

INI_SetReaders(iIniParserHandle, "@INI_ParseValueHandler", "@INI_ParseSectionHandler");
INI_ParseFile(iIniParserHandle, sPathFile);
INI_DestroyParser(iIniParserHandle);
}

bool: @INI_ParseValueHandler(INIParser: handle, const sKey[], const sValue[], bool: invalid_tokens, bool: equal_token, bool: quotes, curtok, any: data)
{
if(sKey[0] == EOS || sKey[0] == '/')
return true;

switch(g_iIniParseState)
{
case STATE_PLUGINS_OFF: ArrayPushString(any: g_aStateInfo[STATE_PLUGINS_OFF], sValue);
case STATE_PLUGINS_ON: ArrayPushString(any: g_aStateInfo[STATE_PLUGINS_ON], sValue);
case STATE_CVARS_SET: ArrayPushString(any: g_aStateInfo[STATE_CVARS_SET], fmt("%s %s", sKey, sValue));
case STATE_CVARS_UNSET: ArrayPushString(any: g_aStateInfo[STATE_CVARS_UNSET], fmt("%s %s", sKey, sValue));
}

return true;
}

bool: @INI_ParseSectionHandler(INIParser: handle, const sSection[], bool: invalid_tokens, bool: close_bracket, bool: extra_tokens, curtok, any: data)
{
if(equal(sSection, "PLUGINS_OFF"))
g_iIniParseState = STATE_PLUGINS_OFF;
else if(equal(sSection, "PLUGINS_ON"))
g_iIniParseState = STATE_PLUGINS_ON;
else if(equal(sSection, "CVARS_ON"))
g_iIniParseState = STATE_CVARS_SET;
else if(equal(sSection, "CVARS_OFF"))
g_iIniParseState = STATE_CVARS_UNSET;

return true;
}

stock get_origin_aiming(pPlayer, Float: fOrigin[3], Float: fDist)
{
static Float: fDest[3];

get_entvar(pPlayer, var_origin, fOrigin);
get_entvar(pPlayer, var_view_ofs, fDest);

xs_vec_add(fOrigin, fDest, fOrigin);

get_entvar(pPlayer, var_v_angle, fDest);
engfunc(EngFunc_MakeVectors, fDest);
global_get(glb_v_forward, fDest);

xs_vec_mul_scalar(fDest, fDist, fDest);
xs_vec_add(fOrigin, fDest, fDest);

engfunc(EngFunc_TraceLine, fOrigin, fDest, DONT_IGNORE_MONSTERS, pPlayer, 0);
get_tr2(0, TR_vecEndPos, fOrigin);
}

stock rg_remove_entity(eEnt)
{
set_entvar(eEnt, var_nextthink, -1.0);
set_entvar(eEnt, var_flags, FL_KILLME);
}

stock rg_set_rendering(eEnt, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
new Float: fRenderColor[3];
fRenderColor[0] = float(r);
fRenderColor[1] = float(g);
fRenderColor[2] = float(b);

set_entvar(eEnt, var_renderfx, fx);
set_entvar(eEnt, var_rendercolor, fRenderColor);
set_entvar(eEnt, var_rendermode, render);
set_entvar(eEnt, var_renderamt, float(amount));
}

stock set_msg_beamfollow(eEnt, iSpriteIndex, iLifeTime, iSize, iRed, iGreen, iBlue, iBrightness)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BEAMFOLLOW);
write_short(eEnt);
write_short(iSpriteIndex);
write_byte(iLifeTime * 10);
write_byte(iSize);
write_byte(iRed);
write_byte(iGreen);
write_byte(iBlue);
write_byte(iBrightness);
message_end();
}

stock set_msg_bloodstream(Float: fOrigin[3], iVelVector[3], iColor, iSpeed)
{
message_begin_f(MSG_BROADCAST, SVC_TEMPENTITY, fOrigin);
write_byte(TE_BLOODSTREAM);
write_coord_f(fOrigin[0]);
write_coord_f(fOrigin[1]);
write_coord_f(fOrigin[2]);
write_short(iVelVector[0]);
write_short(iVelVector[1]);
write_short(iVelVector[2]);
write_byte(iColor);
write_byte(iSpeed);
message_end();
}

// https://wiki.alliedmods.net/CS_WeaponList_Message_Dump
stock set_msg_weaponlist(pPlayer, const sWeaponName[], iPrimaryAmmoID, iPrimaryAmmoMax, iSecondaryAmmoID, iSecondaryAmmoMax, iSlotID, iNumberInSlotID, any: iWeaponID, iFlags)
{
static iMsgWpnList;

if(!iMsgWpnList)
iMsgWpnList = get_user_msgid("WeaponList");

message_begin(pPlayer ? MSG_ONE : MSG_INIT, iMsgWpnList, .player = pPlayer);
write_string(sWeaponName);
write_byte(iPrimaryAmmoID);
write_byte(iPrimaryAmmoMax);
write_byte(iSecondaryAmmoID);
write_byte(iSecondaryAmmoMax);
write_byte(iSlotID)
write_byte(iNumberInSlotID);
write_byte(iWeaponID);
write_byte(iFlags);
message_end();
}

stock set_msg_svc_weaponanim(pPlayer, iAnimation)
{
set_entvar(pPlayer, var_weaponanim, iAnimation);

message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = pPlayer);
write_byte(iAnimation);
write_byte(get_entvar(pPlayer, var_body));
message_end();
}

enum _:
{
Plural,
Singular,
Nominative
};

stock correct_word_seconds(iSeconds, pPlayer, sWords[], iWordsLen)
{
switch(get_numerical_noun_form(iSeconds))
{
case Plural: format(sWords, iWordsLen, "%L", pPlayer, "SWU_NOUN_PLURAL");
case Singular: format(sWords, iWordsLen, "%L", pPlayer, "SWU_NOUN_SINGULAR");
case Nominative: format(sWords, iWordsLen, "%L", pPlayer, "SWU_NOUN_NOMINATIVE");
}
}

// https://dev-cs.ru/threads/222/#post-2364
// by hunter
stock get_numerical_noun_form(iNum)
{
if(iNum > 10 && ((iNum % 100) / 10) == 1)
return Plural;

switch (iNum % 10)
{
case 1: return Nominative;
case 2, 3, 4: return Singular;
}

return Plural;
}
Помогите с решением проблемы
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
494
Реакции
341
Помог
11 раз(а)
Опиши порядок действий, который приводит к такому сценарию. А лучше покажи, приложив видео.
Меню админа стандартное? В том плане, что в него изменения не вносились?
Логи хорошо было бы приложить.
 
Последнее редактирование:
Сообщения
678
Реакции
56
Помог
16 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
bizon, Админ меню - Menus Front-End - SKAJIbnEJIb 🤪
Меню смены карт - Maps Menu - AMXX Dev Team 💁‍♂️
 

RockTheStreet

Саппорт года
Сообщения
1,743
Реакции
344
Помог
40 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Сообщения
494
Реакции
341
Помог
11 раз(а)
XyLiGaN, пока что выяснили, что виновник не менюфронт скальпеля
 
Сообщения
494
Реакции
341
Помог
11 раз(а)
Был конфликт с другими плагинами.
Не касается общего релиза.
 
Статус
В этой теме нельзя размещать новые ответы.

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

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