- Ошибка
-
нету
- ОС
- Windows
- Amx Mod X
-
AMX Mod X 1.9.0.5271
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.767-dev
Build date: 03:14:15 Oct 25 2021 (2753)
Build from: https://github.com/dreamstalker/rehlds/commit/471158b
- ReGamedll
-
ReGameDLL version: 5.21.0.556-dev
Build date: 08:44:42 Jul 22 2022
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/1081301
- Версия Metamod
-
Metamod-r v1.3.0.131, API (5:13)
Metamod-r build: 18:51:28 Jul 11 2022
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/adc9414
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] SafeNameAndChat RUN - safenameandchat.dll v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.92d ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm.dll v0.1.6 ini Start Never
[ 4] VoiceTranscoder RUN - voicetranscoder.dll v2017RC5 ini ANY ANY
[ 5] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5271 ini Start ANY
[ 6] Rechecker RUN - rechecker_mm.dll v2.7 ini Chlvl ANY
[ 7] ReSemiclip RUN - resemiclip_mm.dll v2.3.9 ini Chlvl ANY
[ 8] WHBlocker RUN - whblocker_mm.dll v1.5.697 ini Chlvl ANY
[ 9] SQLite RUN - sqlite_amxx.dll v1.9.0.5271 pl5 ANY ANY
[10] GeoIP RUN - geoip_amxx.dll v1.9.0.5271 pl5 ANY ANY
[11] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5271 pl5 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5271 pl5 ANY ANY
[13] ReAPI RUN - reapi_amxx.dll v5.21.0.252-dev pl5 ANY Never
[14] ReAimDetector RUN - reaimdetector_amxx.dll v0.2.2 pl5 ANY Never
[15] CStrike RUN - cstrike_amxx.dll v1.9.0.5271 pl5 ANY ANY
[16] Fun RUN - fun_amxx.dll v1.9.0.5271 pl5 ANY ANY
[17] Engine RUN - engine_amxx.dll v1.9.0.5271 pl5 ANY ANY
17 plugins, 17 running
- Список плагинов
-
nightmode.amxx
- Автор плагина
- не указан
- Версия плагина
- не указано
- Исходный код
-
#include <amxmodx>
#tryinclude <reapi>
#if !defined MAX_CLIENTS
const MAX_CLIENTS = 32
#endif
#if !defined MAX_NAME_LENGTH
const MAX_NAME_LENGTH = 32
#endif
#if !defined MAX_USER_INFO_LENGTH
const MAX_USER_INFO_LENGTH = 256
#endif
#if AMXX_VERSION_NUM < 183
new MaxClients
#include <colorchat>
#define engine_changelevel(%0) server_cmd("changelevel %s", %0)
#endif
#define START 00 /* Начало ночного режима. */
#define END 12 /* Конец ночного режима. */
#define AUTORR 0 /* Авто-рестарт карты (sv_restart 1) каждые n раундов. Установите 0 для отключения. */
//#define AUTO_SWAP_TEAMS /* Автоматическая смена сторон. (Только если AUTORR > 0) */
//#define STEAM_VIP /* Выдавать флаги только стим игрокам. */
new const FLAGS[2][] =
{
"p", "" /* 1) Выдаваемые флаги. 2) Какие флаги забираем на время ночного режима. */
}
new const SET_MAP[2][] =
{
"de_dust2", "de_dust2" /* 1) Карта ночного режима. 2) Карта которая будет после ночного режима. */
}
#define BLOCK_COMMANDS /* Блок команд чата или консоли в ночном режиме. */
#if defined BLOCK_COMMANDS
new const block_commands[][] =
{
"say rtv", "say_team rtv",
"say /rtv", "say_team rtv",
"say maps", "say_team maps", "say /maps"
}
#endif
//#define STOP_PLUGS /* Ставим плагины на паузу во время ночного режима. */
#if defined STOP_PLUGS
new g_arPlugins[][] =
{
"aknife.amxx"
}
#endif
//#define NIGHT_MODE_INFORMER /* Информер ночного режима. */
#if defined NIGHT_MODE_INFORMER
new const HUD_COLOR[3] = {100, 100, 100} /* Цвет сообщения в формате R, G, B */
new const Float:HUD_POSITION[2] = {-1.0, 0.20} /* Позиция сообщения по оси X, Y */
#endif
#if !defined _reapi_included
#if defined AUTO_SWAP_TEAMS
#include <fakemeta>
const PDATA_SAFE = 2
const OFFSET_LINUX = 5
#if cellbits == 32
const OFFSET_TEAMS = 114
#else
const OFFSET_TEAMS = 139
#endif
#endif
#endif
#if AUTORR > 0
new g_iRound
#endif
new FW_START, FW_END, FW_Result, szCurMap[MAX_NAME_LENGTH],
CurHour, bool:g_bNight, g_pTimeLimit, g_iOldTime, Float:g_flResetTime
public plugin_init()
{
#if AMXX_VERSION_NUM < 183
MaxClients = get_maxplayers()
#endif
#if defined BLOCK_COMMANDS
for (new i = 0; i < sizeof(block_commands); i ++)
register_clcmd(block_commands[i], "BlockHook")
#endif
#if defined NIGHT_MODE_INFORMER
set_task(1.0, "night_informer", _, _, _, "b")
#endif
g_pTimeLimit = get_cvar_pointer("mp_timelimit")
register_event("HLTV", "EventStartRound", "a", "1=0", "2=0")
register_event("TextMsg", "EventRestartRound", "a", "2=#Game_Commencing", "2=#Game_will_restart_in")
FW_START = CreateMultiForward("night_mode_start_event", ET_CONTINUE)
FW_END = CreateMultiForward("night_mode_end_event", ET_CONTINUE)
register_plugin("Lite Night Mode", "1.0", "neugomon ?")
}
public client_putinserver(id)
{
if (!g_bNight)
return PLUGIN_CONTINUE
if ((get_user_flags(id) & read_flags(FLAGS[0])) == read_flags(FLAGS[0]))
return PLUGIN_CONTINUE
remove_user_flags(id, read_flags(FLAGS[1]))
#if defined STEAM_VIP
if (!is_user_steam(id))
return PLUGIN_CONTINUE
#endif
set_user_flags(id, read_flags(FLAGS[0]))
return PLUGIN_CONTINUE
}
public plugin_end()
{
if (g_iOldTime)
set_pcvar_num(g_pTimeLimit, g_iOldTime)
}
public EventStartRound()
{
time(CurHour)
#if START > END
if (CurHour >= START || CurHour < END)
#else
if (START <= CurHour < END)
#endif
{
if (!szCurMap[0])
get_mapname(szCurMap, charsmax(szCurMap))
if (!equal(szCurMap, SET_MAP[0]))
engine_changelevel(SET_MAP[0])
else if (!g_bNight)
{
g_bNight = true
ExecuteForward(FW_START, FW_Result)
#if defined STOP_PLUGS
PluginController(1)
#endif
RemovePlayersFlags()
g_iOldTime = get_pcvar_num(g_pTimeLimit)
set_pcvar_num(g_pTimeLimit, 0)
}
#if AUTORR > 0
static iRound
iRound = AUTORR - ++ g_iRound + 1
if (iRound > 0)
client_print_color(0, print_team_default, "^1[^4UA^1] ^3Через ^3%d раундів ^1авто-рестарт карти. ^1[^4Тек. раунд: ^3%d^1|^4Всього: ^3%d^1]", iRound, g_iRound, AUTORR)
else
{
#if defined AUTO_SWAP_TEAMS
#if !defined _reapi_included
SwapTeams()
#else
rg_swap_all_players()
#endif
#endif
server_cmd("sv_restart 1")
}
#endif
}
else if (g_bNight)
{
set_pcvar_num(g_pTimeLimit, floatround(get_gametime() - g_flResetTime) / 60 +5)
g_bNight = false
ExecuteForward(FW_END, FW_Result)
#if defined STOP_PLUGS
PluginController(0)
#endif
engine_changelevel(SET_MAP[1])
}
}
public EventRestartRound()
{
#if AUTORR > 0
g_iRound = 0
#endif
g_flResetTime = get_gametime()
}
RemovePlayersFlags()
{
static players[MAX_CLIENTS], pcount
get_players(players, pcount, "ch")
for (new i; i < pcount; i ++)
{
client_putinserver(players[i])
remove_user_flags(players[i], read_flags(FLAGS[1]))
}
}
#if defined STOP_PLUGS
PluginController(stop)
{
for (new i; i < sizeof g_arPlugins; i ++)
{
if (stop) pause ("ac", g_arPlugins[i])
else unpause ("ac", g_arPlugins[i])
}
}
#endif
#if defined BLOCK_COMMANDS
public BlockHook(id)
{
if (!g_bNight) return PLUGIN_CONTINUE
client_print_color(id, print_team_default, "^1[^4UA^1] ^3Ця команда відключена в ^1[^4нічному режимі^1]")
return PLUGIN_HANDLED
}
#endif
#if defined NIGHT_MODE_INFORMER
public night_informer()
{
if (!g_bNight)
return PLUGIN_CONTINUE
static id, SyncHudMsg
static buffer[192], len
if (!SyncHudMsg)
SyncHudMsg = CreateHudSyncObj()
trim(buffer)
for (id = 1; id <= MaxClients; id ++)
{
if (!is_user_connected(id))
return PLUGIN_CONTINUE
ClearSyncHud(id, SyncHudMsg)
len += format(buffer, charsmax(buffer), "Увімкнено нічний режим!^n[з 00:00 до 12:00]", START, END)
set_hudmessage(HUD_COLOR[0], HUD_COLOR[1], HUD_COLOR[2], HUD_POSITION[0], HUD_POSITION[1], 0, 0.0, 1.0, _, _, -1)
ShowSyncHudMsg(id, SyncHudMsg, "%s", buffer)
}
return PLUGIN_HANDLED
}
#endif
#if !defined _reapi_included
#if defined AUTO_SWAP_TEAMS
public SwapTeams()
{
new players[MAX_CLIENTS], pnum
get_players(players, pnum, "h")
for (new i; i < pnum; i ++)
{
if (is_user_connected(players[i]))
{
switch(fm_get_user_team(players[i]))
{
case 1: fm_set_user_team(players[i], 2)
case 2: fm_set_user_team(players[i], 1)
}
}
}
}
stock fm_get_user_team(index)
return get_pdata_int(index, OFFSET_TEAMS, OFFSET_LINUX)
stock fm_set_user_team(index, team)
{
if (!(1 <= index <= MaxClients) || pev_valid(index) != PDATA_SAFE)
return 0
if (fm_get_user_team(index) != team)
{
set_pdata_int(index, OFFSET_TEAMS, team, OFFSET_LINUX)
dllfunc(DLLFunc_ClientUserInfoChanged, index, engfunc(EngFunc_GetInfoKeyBuffer, index))
}
return 1
}
#endif
#if defined STEAM_VIP
stock bool:is_user_steam(id)
{
server_cmd("dp_clientinfo %d", id); server_exec()
return get_pcvar_num(get_cvar_pointer("dp_r_id_provider")) == 2 ? true : false
}
#endif
#endif
Доброй ночи, почему-то когда менше 11 игоков на сервере, плагин циклично меняет карту указанная в исходнике, подскажите как исправить, или может есть рабочие аналоги данного плагина, буду благодарен