#include <amxmodx>
#include <reapi>
const IMMUNITY_ACCESS = ADMIN_LEVEL_A;
public plugin_init() {
RegisterHookChain(RG_CBasePlayer_DropIdlePlayer, "CBasePlayer_DropIdlePlayer_Pre", false);
}
public OnConfigsExecuted() {
set_cvar_num("mp_autokick", "1");
log_amx("m_fMaxIdlePeriod >>> %f", get_member_game(m_fMaxIdlePeriod));
}
public CBasePlayer_DropIdlePlayer_Pre(const id, const reason[]) {
log_amx("=================================^n\
CBasePlayer_DropIdlePlayer_Pre^n\
id >>> %d^n\
reason >>>%s^n\
m_flIdleCheckTime >>> %f^n\
m_fLastMovement >>> %f^n\
GameTime >>> %f",
id, reason, get_member(id, m_flIdleCheckTime), get_member(id, m_fLastMovement), get_gametime()
);
if(get_user_flags(id & IMMUNITY_ACCESS)) {
log_amx("CBasePlayer_DropIdlePlayer_Pre | Player %n has immunity flag", id)
return HC_SUPERCEDE;
}
SetHookChainArg(2, ATYPE_STRING, "Своя причина");
return HC_CONTINUE;
}