Заказать игровой сервер Контакты (заказать плагин/исправить ошибки/другое) Поиск

[ вход ]
[ последние сообщения ]

  • Страница 1 из 1
  • 1
Форум » SourceMod >> CS:Source >> CSGO » Плагины (от пользователей) » WallHack Block (for plugin hide and seek) (Блокирует wallhack на серверах с плагином hide and seek.)
WallHack Block (for plugin hide and seek)
sssw Дата: Воскресенье, 05.08.2012, 00:08:38 | Сообщение # 1
Сообщений: 123
Репутация: 14 [ +/- ]
Данный плагин блокирует wallhack на серверах с плагином hide and seek.
А так же улучшает модель попадания (которую я не проверил)

Code

#pragma semicolon 1

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

#define PLUGIN_VERSION "1.0.0.0"

public Plugin:myinfo =
{
     name = "Hns No cheaters",
     author = "aktel",
     version = PLUGIN_VERSION,
     url = "http://holi-top.ru"
}

new Handle:h_OnCreateModel, Handle:g_hSecureOnlyRose;
new OnInformation[MAXPLAYERS+1][5], String:i_Model[MAXPLAYERS+1][PLATFORM_MAX_PATH], g_offsCollisionGroup;

public OnPluginStart()
{
  HookEvent("player_spawn", UpdateClient, EventHookMode_Post);
  HookEvent("player_disconnect", UpdateClient, EventHookMode_Post);
  HookEvent("player_death", UpdateClient, EventHookMode_Post);
  g_offsCollisionGroup = FindSendPropOffs("CBaseEntity", "m_CollisionGroup");
  if (g_offsCollisionGroup == -1)
     {
         SetFailState("Failed to get offset for CBaseEntity::m_CollisionGroup.");
     }
     g_hSecureOnlyRose = CreateConVar("hns_wallhack_more_optimally", "0");
}

public UpdateClient(Handle:event, const String:name[], bool:dontBroadcast)
{
  new client = GetClientOfUserId(GetEventInt(event, "userid"));
  if (StrEqual("player_disconnect", name))
  {
   DeleteModel(client);
   return;
  }
  SetEntityModel(client, "models/props/cs_assault/BarrelWarning.mdl");
  OnInformation[client][1] = GetClientTeam(client);
  if (IsPlayerAlive(client))
     {
      if (OnInformation[client][1])
      {
       if (!GetConVarBool(g_hSecureOnlyRose))
       {
        SetEntData(client, g_offsCollisionGroup, 2, 4, true);
           GetClientModel(client, i_Model[client], 4096);
        CreateModel(client);
        SetEntityRenderMode(client, RENDER_TRANSCOLOR);
        SetEntityRenderColor(client, 0, 0, 0, 0);
       }
      }
      HookElements(client);
  }
     else
     {
      DeleteModel(client);
     }
}

OnSecure(client)
{
  OnInformation[client][1] = GetClientTeam(client);
  GetClientModel(client, i_Model[client], 4096);
  CreateModel(client);
  SetEntityRenderMode(client, RENDER_TRANSCOLOR);
  SetEntityRenderColor(client, 0, 0, 0, 0);
}

OffSecure(client)
{
  DeleteModel(client);
  SetEntityRenderMode(client, RENDER_TRANSCOLOR);
  SetEntityRenderColor(client, 0, 0, 0, 255);
}

CreateModel(client)
{
  OnInformation[client][0] = CreateEntityByName("prop_dynamic_override");
  DispatchKeyValue(OnInformation[client][0], "model", i_Model[client]);
  DispatchSpawn(OnInformation[client][0]);
  SetEntProp(OnInformation[client][0], Prop_Data, "m_iHealth", 50);
    
  //Forward Start
  new Handle:result;
  Call_StartForward(h_OnCreateModel);
  Call_PushCell(client);Call_PushCell(OnInformation[client][0]);
  Call_Finish(_:result);
}

DeleteModel(client)
{
  UnhookElements(client);

  if (IsValidEntity(OnInformation[client][0]) && OnInformation[client][0] > MaxClients)
   RemoveEdict(OnInformation[client][0]);
   
  for (new i = 0; i<=5;i++)
   OnInformation[client][i] = 0;
}

public OnMapStart() PrecacheModel("models/props/cs_assault/BarrelWarning.mdl", true);

UpdateStatus(client)
{
  if (OnInformation[client][3])
  {
   DispatchKeyValue(OnInformation[client][0], "solid", "0");
   if (GetConVarBool(g_hSecureOnlyRose))
    OffSecure(client);
  }
  else
  {
   decl Float:vVelocity[3];
   GetClientAbsVelocity(client, vVelocity);
   if (IsVectorZero(vVelocity))
   {
    if (GetConVarBool(g_hSecureOnlyRose))
    {
     OnSecure(client);
     return;
    }
    DispatchKeyValue(OnInformation[client][0], "solid", "6");
   }
  }
}

UpdatePostion(client)
{
  decl Float:NewOrigin[3];
  GetClientAbsOrigin(client, NewOrigin);
  TeleportEntity(OnInformation[client][0],NewOrigin,NULL_VECTOR,NULL_VECTOR);
}

UpdateAngles(client, i, Float:NewValue)
{
  static Float:OldAngle[MAXPLAYERS+1][3];
  switch(i)
  {
   case 0:
   {
    OldAngle[client][0] = NewValue;
   }
    
   case 1:
   {
    if (!(GetClientButtons(client) & IN_USE))
    {
     if (OnInformation[client][2] == 0)
     {
      decl Float:NewAngles[3];
      GetClientEyeAngles(client, NewAngles);
      OldAngle[client][1] = NewAngles[1];
     }
    }
   }
    
   case 2:
   {
    OldAngle[client][2] = NewValue;
   }
  }
  TeleportEntity(OnInformation[client][0],NULL_VECTOR,OldAngle[client],NULL_VECTOR);
}

public OnGameFrame()
{
  for (new i = 1; i <= MaxClients; i++)
  {
   if (OnInformation[i][1] == 2 && IsPlayerAlive(i))
   {
    if (IsValidEntity(OnInformation[i][0]))
    {
     GetClientModel(i, i_Model[i], 4096);
     SetEntityModel(OnInformation[i][0], i_Model[i]);
     
     UpdateStatus(i);
     UpdatePostion(i);
     UpdateAngles(i, 1, 0.0);
    }
    else
    {
     CreateModel(i);
    }
    if (GetConVarBool(g_hSecureOnlyRose))
     UpdateStatus(i);
   }
  }
}

public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
  decl button;
  for (new i = 0; i < 24; i++)
     {
         button = (1 << i);
          
         if (buttons & button)
         {
        if (IsRightButton(button))
        {
         OnInformation[client][3] = 1;
        }
        else
        {
         OnInformation[client][3] = 0;
        }
         }
     }
     return Plugin_Continue;
}

bool:IsRightButton(button)
{
  if (button & IN_FORWARD || button & IN_BACK || button & IN_LEFT || button & IN_RIGHT || button & IN_JUMP)
   return true;
  return false;
}

HookElements(client)
{
  SDKHook(client, SDKHook_SetTransmit, SetTransmit);
  SDKHook(client, SDKHook_TraceAttack, TraceAttack);
  if (IsValidEntity(OnInformation[client][0]))
   SDKHook(OnInformation[client][0], SDKHook_TraceAttack, TraceAttack);
}

UnhookElements(client)
{
  SDKUnhook(client, SDKHook_SetTransmit, SetTransmit);
  SDKUnhook(client, SDKHook_TraceAttack, TraceAttack);
  if (IsValidEntity(OnInformation[client][0]))
   SDKUnhook(OnInformation[client][0], SDKHook_TraceAttack, TraceAttack);
}

/*
  Второстепенные функции
        */
       
stock bool:GetClientAbsVelocity(client, Float:velocity[3])
{
  static offset = -1;
  if (offset == -1 && (offset = FindDataMapOffs(client, "m_vecAbsVelocity")) == -1)
  {
   ZeroVector(velocity);
   return false;
  }
  GetEntDataVector(client, offset, velocity);
  return true;
}

stock ZeroVector(Float:vec[3])
{
  vec[0] = vec[1] = vec[2] = 0.0;
}

stock bool:IsVectorZero(const Float:vec[3])
{
  return vec[0] == 0.0 && vec[1] == 0.0 && vec[2] == 0.0;
}

/*
  Форварды и нативы
       */  
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
{
  CreateNative("SetSlopeModel", Native_SlopeModel);
  //CreateNative("GetStatusObject", Native_StatusObject);
  CreateNative("ToggleUpdateClient", Native_GProgres);
   
  //h_OnUpdatePosition = CreateGlobalForward("OnUpdatingTheCover", ET_Event, Param_Cell, Param_Cell);
  h_OnCreateModel = CreateGlobalForward("OnCreateModel", ET_Event, Param_Cell, Param_Cell);
  return APLRes_Success;
}

public Native_SlopeModel(Handle:plugin, numParams)
{
  decl String:Value[4096];
  GetNativeString(3, Value, 4096);
  UpdateAngles(GetNativeCell(1), GetNativeCell(2), StringToFloat(Value));
}

public Native_GProgres(Handle:plugin, numParams)
{
  new client = GetNativeCell(1);
  if (OnInformation[client][2])
  {
   return OnInformation[client][2] = 0;
  }
  return OnInformation[client][2] = 1;
}

/*
  SDKHOOKS калбеки
       */

public Action:SetTransmit(entity, client)
{  
  if (entity != client)
  {
   if (OnInformation[client][1] == 3 && OnInformation[client][1] == 3)
    return Plugin_Continue;
     
   return Plugin_Handled;
  }
  return Plugin_Continue;
}

public Action:TraceAttack(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup)
{
  if (GetConVarBool(g_hSecureOnlyRose))
   return Plugin_Continue;

  if (victim <= MaxClients)
  {
   decl Float:vVelocity[3];
   GetClientAbsVelocity(victim, vVelocity);
   if (!IsVectorZero(vVelocity))
    return Plugin_Continue;
  }
  SDKHooks_TakeDamage(victim, inflictor, attacker, damage, damagetype, -1, NULL_VECTOR, NULL_VECTOR);  
  return Plugin_Handled;
}

Гости не могут скачивать файлы
 
_wS_ Дата: Воскресенье, 05.08.2012, 02:28:33 | Сообщение # 2
Thanks
Я бы никогда не ставил подобное. OnPlayerRunCmd + OnGameFrame + SDKHook ( pipec ). Любой SM античит серьезно грузит сервер - я уверен. Лучше оставить только нужные плагины и набрать нормальных админов. Ибо античиты это просто лишние лаги. А за тему - спасибо, может кому и понадобится.
 
sssw Дата: Воскресенье, 05.08.2012, 13:40:27 | Сообщение # 3
Сообщений: 123
Репутация: 14 [ +/- ]
Quote (_wS_)
Я бы никогда не ставил подобное. OnPlayerRunCmd + OnGameFrame + SDKHook ( pipec ). Любой SM античит серьезно грузит сервер - я уверен. Лучше оставить только нужные плагины и набрать нормальных админов. Ибо античиты это просто лишние лаги. А за тему - спасибо, может кому и понадобится.

Согласен например smac_wallhack очень сильно грузит сервер, его лучше не ставить на игровые хостинги, так как такая нагрузка там не предусмотрена.
 
Форум » SourceMod >> CS:Source >> CSGO » Плагины (от пользователей) » WallHack Block (for plugin hide and seek) (Блокирует wallhack на серверах с плагином hide and seek.)
  • Страница 1 из 1
  • 1
Поиск: