Участник
Пользователь
- Сообщения
- 34
- Реакции
- 6
- Ошибка
-
Плагин не кикает человека который не выбрал команду 1-2-6
после смены карты забиваются спектры и плагин их не трогает
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.10.0.5406 (http://www.amxmodx.org)
Authors:
- Билд
-
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.776-dev
Build date: 19:37:50 Apr 20 2022 (2930)
- ReGamedll
-
ReGameDLL version: 5.21.0.546-dev
Build date: 15:32:48 Dec 28 2021
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
- Список метамодулей
-
[ 1] Reunion RUN - reunion.so v0.1.0.92c ini Start Never
[ 2] Revoice RUN - revoice.so v0.1.0.34 ini Start Never
[ 3] ReSRDetector RUN - resrdetector.so v0.1.0 ini Chlvl ANY
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5406 ini Start ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 7] Placeholders disabler RUN - plfix_mm_i386.so v0.0.3 ini Start Never
[ 8] YaPB RUN - yapb.so v4.0.0 ini Chlvl ANY
[ 9] HitBox Fix RUN - hitbox_fix.so v1.0.10 ini Start ANY
[10] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl5 ANY Never
[11] MySQL RUN - mysql_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[13] ReAPI RUN - reapi_amxx_i386.so v5.21.0.248-dev pl5 ANY Never
[14] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[15] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[16] Engine RUN - engine_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[17] CSX RUN - csx_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[18] Fun RUN - fun_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[19] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
- Список плагинов
-
нет необходимости
- Автор плагина
- Xramer
- Версия плагина
- 1.2
- Исходный код
-
#include <amxmodx>
#include <reapi>
#include <xs>
#define PLUGIN "AFK Manager"
#define VERSION "1.2"
#define AUTHOR "Xramer"
#define TASK_AFK_CHECK 139734
#define BIT_VALID(%1,%2) (%1 & (1 << (%2 & 31)))
#define BIT_ADD(%1,%2) %1 |= (1 << (%2 & 31))
#define BIT_SUB(%1,%2) %1 &= ~(1 << (%2 & 31))
new const g_szConfigName[] = "afk_manager";
new g_szFlag[32], Float:g_iTimeCheck, g_iMaxWarning, g_iMaxSpect, Float:g_iTimeCheckSpect
new g_iTrnsferBomb, g_iNoticeSpec, g_iNoticeKick, g_iNoticeTransfer
new Float:g_fOldOrigin[MAX_CLIENTS+1][3], Float:g_fOldAngles[MAX_CLIENTS+1][3];
new g_iBitClientValid, g_iWarning[MAX_CLIENTS+1];
new g_iMaxPlayers;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_dictionary("afk_manager.txt");
bind_pcvar_string(create_cvar(
"afk_immunity_flag",
"a", .description = "Flag of immunity from plugin actions"),
g_szFlag,
charsmax(g_szFlag))
bind_pcvar_float(create_cvar(
"afk_time_check",
"10.0",
.description = "Time to check"),
g_iTimeCheck)
bind_pcvar_num(create_cvar(
"afk_max_warning",
"3",
.description = "The maximum number of warnings after which the player will be kicked"),
g_iMaxWarning)
bind_pcvar_num(create_cvar(
"afk_num_check_spec",
"32",
.description = "The number of players at which it will kick, and not translate for spectators."),
g_iMaxSpect)
bind_pcvar_float(create_cvar(
"afk_time_check_spec",
"60.0",
.description = " Time to сheck spectators."),
g_iTimeCheckSpect)
bind_pcvar_num(create_cvar(
"afk_transfer_bomb",
"1",
.description = "Transfer bomb to allies."),
g_iTrnsferBomb)
bind_pcvar_num(create_cvar(
"afk_notice_spec",
"1",
.description = "Enable notification in the chat about the player transfer for spectators."),
g_iNoticeSpec)
bind_pcvar_num(create_cvar(
"afk_notice_kick",
"1",
.description = "Enable notification in chat about player kick."),
g_iNoticeKick)
bind_pcvar_num(create_cvar(
"afk_notice_transfer",
"1",
.description = "Enable notification in chat about transfer bomb."),
g_iNoticeTransfer)
AutoExecConfig(true, g_szConfigName)
RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn", true);
RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed", true);
set_task(g_iTimeCheckSpect, "SpectatorCheck", .flags = "b");
g_iMaxPlayers = MaxClients;
}
public client_putinserver(id)
{
if(is_user_bot(id) || is_user_hltv(id)) return;
BIT_ADD(g_iBitClientValid, id);
}
public client_disconnected(id)
{
if(task_exists(id+TASK_AFK_CHECK)) remove_task(id+TASK_AFK_CHECK);
BIT_SUB(g_iBitClientValid, id);
}
public CBasePlayer_Killed(id) remove_task(id+TASK_AFK_CHECK);
public CBasePlayer_Spawn(const id)
{
if(!is_user_alive(id)) return;
g_iWarning[id] = 0;
get_entvar(id, var_origin, g_fOldOrigin[id]);
get_entvar(id, var_angles, g_fOldAngles[id]);
if(task_exists(id+TASK_AFK_CHECK)) remove_task(id+TASK_AFK_CHECK);
set_task(g_iTimeCheck, "AfkCheck", id+TASK_AFK_CHECK, _, _, "b");
}
public AfkCheck(id)
{
id -= TASK_AFK_CHECK;
new Float:fNewOrigin[3], Float:fNewAngles[3];
get_entvar(id, var_origin, fNewOrigin);
get_entvar(id, var_angles, fNewAngles);
if(xs_vec_equal(g_fOldOrigin[id], fNewOrigin) && xs_vec_equal(g_fOldAngles[id], fNewAngles))
{
if(++g_iWarning[id] >= g_iMaxWarning)
{
user_kill(id,1)
rg_join_team(id, TEAM_SPECTATOR);
set_member(id, m_iTeam, TEAM_SPECTATOR);
if(g_iNoticeSpec){
client_print_color(0, print_team_red, "%l %l", "AFK_PREFIX", "AFK_ALL_TRANSFER_SPECTATOR", id);
}
}
else
{
client_print_color(id, print_team_red, "%l %l", "AFK_PREFIX", "AFK_ID_WARNING", g_iWarning[id], g_iMaxWarning);
}
if(get_entvar(id, var_weapons) & (1<<CSW_C4))
{
if(g_iTrnsferBomb){
for(new i = 1; i <= g_iMaxPlayers; i++)
{
if(i != id && is_user_alive(i) && (get_member(i, m_iTeam) == TEAM_TERRORIST)){
rg_transfer_c4(id,i)
if(g_iNoticeTransfer){
client_print_color(0, print_team_red,"%l %l", "AFK_PREFIX", "AFK_BOMB_TRANSFER", id, i);
}
break;
}
}
}
else
{
rg_drop_item(id, "weapon_c4");
if(g_iNoticeTransfer){
client_print_color(0, print_team_red, "%l %l", "AFK_PREFIX", "AFK_BOMB_DROP", id);
}
}
}
}
else
{
if(g_iWarning[id]) g_iWarning[id] = 0;
xs_vec_copy(fNewOrigin, g_fOldOrigin[id]);
xs_vec_copy(fNewAngles, g_fOldAngles[id]);
}
}
public SpectatorCheck()
{
if(get_playersnum() < g_iMaxSpect) return;
for(new i=1; i <= g_iMaxPlayers; i++){
if(BIT_VALID(g_iBitClientValid, i)){
if(get_user_flags(i) & read_flags(g_szFlag)) continue;
if(get_member(i, m_iTeam) == TEAM_SPECTATOR){
AfkPunishment(i);
break;
}
}
}
}
public AfkPunishment(i)
{
if(g_iNoticeKick){
client_print_color(0, print_team_red, "%l %l", "AFK_PREFIX", "AFK_ALL_KICK_SPECTATOR", i);
}
server_cmd("kick #%d ^"%l^"", get_user_userid(i), "AFK_ID_KICK_SPECTATOR");
}
Куплю исправление за адекватную сумму, или помогите пожалуйста найти решение для исправления