Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Исходник Serverside fix for lag exploiters and instant defuse

5 ночей на aim_ag_texture2
Эксперт
Эксперт
Статус
Оффлайн
Регистрация
6 Апр 2017
Сообщения
846
Реакции
407
because original thread on UC got deleted
by Senator (SenatorII on UC)

What commands do what?
  • untrusted_enabled - enable untrusted system
  • untrusted_kick_for_oob_angles - kicks if a players angles are out of bounds
  • untrusted_kick_for_lag_exploit - kicks if a players abusing lag exploit
And example of your servers configuration file:

spread:
Код:
Expand Collapse Copy
untrusted_enabled 1
untrusted_kick_for_oob_angles 1
untrusted_kick_for_lag_exploit 1
nospread:
Код:
Expand Collapse Copy
untrusted_enabled 1
untrusted_kick_for_oob_angles 0
untrusted_kick_for_lag_exploit 1


An example video:
Source:
Код:
Expand Collapse Copy
///
/// untrusted system
/// written by senator
///

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

bool m_untrusted_enabled = false;

last_tickbase[MAXPLAYERS+1] = {0,...};
last_velocity[MAXPLAYERS+1] = {0.0,...};
badticks[MAXPLAYERS+1] = {0,...};
cooldown_ticks[MAXPLAYERS+1] = {0,...};
float old_defuse_time = -1.0;
int client_defusing = -1;

new Handle:m_untrusted_enabled_var;
new Handle:m_untrusted_kick_for_oob_angles_var;
new Handle:m_untrusted_kick_for_lag_exploit_var;

public Plugin myinfo =
{
    name = "Untrusted System",
    author = "senator",
    description = "",
    version = "1.0.0",
    url = ""
};
 
public void OnPluginStart()
{
    HookEvent("round_end", Event_RoundEnd);
    HookEvent("round_freeze_end", Event_Round_Freeze_End);
    HookEvent("bomb_begindefuse", Event_Defuse)
    
    m_untrusted_enabled_var = CreateConVar("untrusted_enabled", "0", "enable untrusted system");
    m_untrusted_kick_for_oob_angles_var = CreateConVar("untrusted_kick_for_oob_angles", "0", "kicks if a players angles are out of bounds");
    m_untrusted_kick_for_lag_exploit_var = CreateConVar("untrusted_kick_for_lag_exploit", "0", "kicks if a players abusing lag exploit");
}

public Action Event_Round_Freeze_End(Event event, const char[] name, bool dontBroadcast)
{
    old_defuse_time = -1.0;
    m_untrusted_enabled = true;
}
 
public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast)
{   
    old_defuse_time = -1.0;
    m_untrusted_enabled = false;
}

public Action Event_Defuse(Handle:event, const String:name[], bool:dontBroadcast)
{
    client_defusing = GetClientOfUserId(GetEventInt(event, "userid"));
}

stock abs(x)
{
   return x >= 0 ? x : -x;
}

public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
{
    if(!IsClientInGame(client) || !IsPlayerAlive(client) || IsFakeClient(client) || !GetConVarBool(m_untrusted_enabled_var) || !m_untrusted_enabled)
        return Plugin_Continue;
    
    // lag exploit fix
    if(GetConVarBool(m_untrusted_kick_for_lag_exploit_var))
    {
        int tickbase = GetEntData(client, FindSendPropOffs("CBasePlayer", "m_nTickBase"));
        new Float:velocity[3];
        
        GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", velocity);
        
        float final_velocity = velocity[0] + velocity[1] + velocity[2];
    
        if(tickbase == last_tickbase[client])
            badticks[client]++;
        else
            badticks[client] = 0;
    
        // bomb defuse fix
        if(client_defusing > 0 && (badticks[client_defusing] >= 1 || cooldown_ticks[client_defusing] > 0))
        {
            new bomb_entity = FindEntityByClassname(-1, "planted_c4");
            
            if(bomb_entity != -1)
            {
                //SetEntPropFloat(bomb_entity, Prop_Send, "m_flC4Blow", 0.0);
                SetEntPropFloat(bomb_entity, Prop_Send, "m_flDefuseCountDown", 9999.0);
                SetEntProp(bomb_entity, Prop_Send, "m_bBombDefused", 0);
            }
            else
                client_defusing = -1;
        }
    
        if(badticks[client] >= 1 || cooldown_ticks[client] > 0)
        {   
            SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 0.0);
            
            if(cooldown_ticks[client] > 0)
                cooldown_ticks[client]--;
            else
                cooldown_ticks[client] = 13; // 12.8 * 0.0078125 = 0.1s
        }
        else
            SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0);
        
        last_tickbase[client] = tickbase;
        last_velocity[client] = final_velocity;
    }
    
    // perform oob angles check
    if(GetConVarBool(m_untrusted_kick_for_oob_angles_var) && (angles[0] > 89.0 || angles[0] < -89.0 || angles[1] > 180.0 || angles[1] < -180.0 || angles[2] > 45.0 || angles[2] < -45.0))
        KickClient(client, "Kicked for angle violations");
    
    return Plugin_Continue;
}
потому что оригинальную тему на UC удалили
от Senator (SenatorII на UC)

Какие команды есть и что они делают?
  • untrusted_enabled - включить антраст систему
  • untrusted_kick_for_oob_angles - кикать игрока если за его углы на валв серверах дали бы антраст
  • untrusted_kick_for_lag_exploit - кикать игрока если он использует лаг эксплоит
Пример конфига плагина для вашего сервера:

spread:
Код:
Expand Collapse Copy
untrusted_enabled 1
untrusted_kick_for_oob_angles 1
untrusted_kick_for_lag_exploit 1
nospread:
Код:
Expand Collapse Copy
untrusted_enabled 1
untrusted_kick_for_oob_angles 0
untrusted_kick_for_lag_exploit 1


Примерное видео:

Исходник:
Код:
Expand Collapse Copy
///
/// untrusted system
/// written by senator
///

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

bool m_untrusted_enabled = false;

last_tickbase[MAXPLAYERS+1] = {0,...};
last_velocity[MAXPLAYERS+1] = {0.0,...};
badticks[MAXPLAYERS+1] = {0,...};
cooldown_ticks[MAXPLAYERS+1] = {0,...};
float old_defuse_time = -1.0;
int client_defusing = -1;

new Handle:m_untrusted_enabled_var;
new Handle:m_untrusted_kick_for_oob_angles_var;
new Handle:m_untrusted_kick_for_lag_exploit_var;

public Plugin myinfo =
{
    name = "Untrusted System",
    author = "senator",
    description = "",
    version = "1.0.0",
    url = ""
};
 
public void OnPluginStart()
{
    HookEvent("round_end", Event_RoundEnd);
    HookEvent("round_freeze_end", Event_Round_Freeze_End);
    HookEvent("bomb_begindefuse", Event_Defuse)
    
    m_untrusted_enabled_var = CreateConVar("untrusted_enabled", "0", "enable untrusted system");
    m_untrusted_kick_for_oob_angles_var = CreateConVar("untrusted_kick_for_oob_angles", "0", "kicks if a players angles are out of bounds");
    m_untrusted_kick_for_lag_exploit_var = CreateConVar("untrusted_kick_for_lag_exploit", "0", "kicks if a players abusing lag exploit");
}

public Action Event_Round_Freeze_End(Event event, const char[] name, bool dontBroadcast)
{
    old_defuse_time = -1.0;
    m_untrusted_enabled = true;
}
 
public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast)
{   
    old_defuse_time = -1.0;
    m_untrusted_enabled = false;
}

public Action Event_Defuse(Handle:event, const String:name[], bool:dontBroadcast)
{
    client_defusing = GetClientOfUserId(GetEventInt(event, "userid"));
}

stock abs(x)
{
   return x >= 0 ? x : -x;
}

public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
{
    if(!IsClientInGame(client) || !IsPlayerAlive(client) || IsFakeClient(client) || !GetConVarBool(m_untrusted_enabled_var) || !m_untrusted_enabled)
        return Plugin_Continue;
    
    // lag exploit fix
    if(GetConVarBool(m_untrusted_kick_for_lag_exploit_var))
    {
        int tickbase = GetEntData(client, FindSendPropOffs("CBasePlayer", "m_nTickBase"));
        new Float:velocity[3];
        
        GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", velocity);
        
        float final_velocity = velocity[0] + velocity[1] + velocity[2];
    
        if(tickbase == last_tickbase[client])
            badticks[client]++;
        else
            badticks[client] = 0;
    
        // bomb defuse fix
        if(client_defusing > 0 && (badticks[client_defusing] >= 1 || cooldown_ticks[client_defusing] > 0))
        {
            new bomb_entity = FindEntityByClassname(-1, "planted_c4");
            
            if(bomb_entity != -1)
            {
                //SetEntPropFloat(bomb_entity, Prop_Send, "m_flC4Blow", 0.0);
                SetEntPropFloat(bomb_entity, Prop_Send, "m_flDefuseCountDown", 9999.0);
                SetEntProp(bomb_entity, Prop_Send, "m_bBombDefused", 0);
            }
            else
                client_defusing = -1;
        }
    
        if(badticks[client] >= 1 || cooldown_ticks[client] > 0)
        {   
            SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 0.0);
            
            if(cooldown_ticks[client] > 0)
                cooldown_ticks[client]--;
            else
                cooldown_ticks[client] = 13; // 12.8 * 0.0078125 = 0.1s
        }
        else
            SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0);
        
        last_tickbase[client] = tickbase;
        last_velocity[client] = final_velocity;
    }
    
    // perform oob angles check
    if(GetConVarBool(m_untrusted_kick_for_oob_angles_var) && (angles[0] > 89.0 || angles[0] < -89.0 || angles[1] > 180.0 || angles[1] < -180.0 || angles[2] > 45.0 || angles[2] < -45.0))
        KickClient(client, "Kicked for angle violations");
    
    return Plugin_Continue;
}
 
А можно плагином скинуть?
скомпиль сам (я смог через
Пожалуйста, авторизуйтесь для просмотра ссылки.
скомпилить)
Дожили... Кодеры софта, фиксят баги кс.
ну если валв не хотят фиксить, а всех это уже РЕАЛЬНО заебало то почему бы и нет
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
лучше бы сделали тему как делать этот lag exploit
 
Назад
Сверху Снизу