You are viewing our Forum Archives. To view or take place in current topics click here.
AW aimbot script*
Posted:

AW aimbot script*Posted:

NextGenGamer
  • New Member
Status: Offline
Joined: Nov 10, 201410Year Member
Posts: 9
Reputation Power: 0
Status: Offline
Joined: Nov 10, 201410Year Member
Posts: 9
Reputation Power: 0
Well here is some code to work with this is in c++ so it runs through a dashlaunch plugin!

namespace Aimbot
{
   int G_Client(int clientIndex)   {return Offsets::G_Client + ( clientIndex * Offsets::G_Client_Size ); }
   int G_Entity(int clientIndex)   {return Offsets::G_Entity + ( clientIndex * Offsets::G_Entity_Size ); }

   opd_s SL_GetString_t = { Offsets::SL_GetString, TOC };
   int(*SL_GetString)(const char* str, unsigned int user, unsigned int type) = (int(*)(const char* str, unsigned int user, unsigned int type))&SL_GetString_t;

   opd_s G_DObjGetWorldTagPos_t = { Offsets::G_DObjGetWorldTagPos, TOC };
   void(*G_DObjGetWorldTagPos)(int* Entity, int TagId, float* Loaction) = (void(*)(int* Entity, int TagId, float* Loaction))&G_DObjGetWorldTagPos_t;

   bool CheckTeam(int Client, int OtherClient)
   {
      int Attacker = *(int*)(G_Client(Client) + Offsets::Team);
      int Victim = *(int*)(G_Client(OtherClient) + Offsets::Team);
      if(Attacker == Victim)
      {
         return true;
      }
      else
      {
         return false;
      }
   }

   float GetStance(int client)
   {
      if(*(int*)(G_Client(client) + 0x5A) == 262144 || *(int*)(G_Client(client) + 0x5A) == 393216)
      {
         return 24;//crouched
      }
      else if(*(int*)(G_Client(client) + 0x5A) == 655360 || *(int*)(G_Client(client) + 0x5A) == 524288)
      {
         return 42;//prone
      }
      else if(*(int*)(G_Client(client) + 0x5A) == 0 || *(int*)(G_Client(client) + 0x5A) == 131072)
      {
         return -3;//standing
      }
   }

   bool CheckIfLiving(int client)
   {
      if(*(int*)(G_Entity(client) + Offsets::Health) != 0)
      {
         return true;
      }
      else return false;
   }

   bool ClientIsInGame(int clientIndex)
   {
      if(*(int*)G_Client(clientIndex) != 0)
         return true;
      else return false;
   }

   struct Vec3
   {
      float x, y, z;
   };

   Vec3 Difference;
   Vec3 GetVec(Vec3 Attacker, Vec3 Target)
   {
      Difference.x = (Target.x - Attacker.x);
      Difference.y = (Target.y - Attacker.y);
      Difference.z = (Target.z - Attacker.z);
      return Difference;
   }

   float dx, dy, dz;
   float Get3dDistance( Vec3 c1, Vec3 c2 )
   {
      float dx = c2.x - c1.x;
      float dy = c2.y - c1.y;
      float dz = c2.z - c1.z;

      return sqrt((float)((dx * dx) + (dy * dy) + (dz * dz)));
   }

   Vec3 vec;
   Vec3 GetPlayerOrigin(int Client)
   {
      vec = *(Vec3*)(G_Client(Client) + Offsets::Origin);
      return vec;
   }

   Vec3 VecV;
   Vec3 GetPlayerOriginVictim(int Client)
   {
      VecV = *(Vec3*)(G_Client(Client) + Offsets::Origin);
      VecV.z -= GetStance(Client);
      return VecV;
   }

   int Nearest;
   int GetNearestPlayer(int Client)
   {
      float MaxDistance = 99999999;
      for (int i = 0; i < 12; i ++)
      {
         Vec3 Attacker = GetPlayerOrigin(Client);
         Vec3 Vic = GetPlayerOrigin(i);
         float ActualDistance = Get3dDistance(Attacker, Vic);
         if ((i != Client) && CheckIfLiving(i) && ClientIsInGame(i))
         {
            if(cstrcmp(Func::Dvar_GetString("ui_gametype"), "dm") == 0)
            {
               if (ActualDistance < MaxDistance)
               {
                  Nearest = i;
                  MaxDistance = ActualDistance;
               }
            }
            else
            {
               if(!CheckTeam(Client, i))
               {
                  if (ActualDistance < MaxDistance)
                  {
                     Nearest = i;
                     MaxDistance = ActualDistance;
                  }
               }
            }
         }
      }
      return Nearest;
   }

   float angles[3];
   float* vectoangles(Vec3 Angles)
   {
      float forward;
      float yaw, pitch;
      float PI = 3.1415926535897931;
      if (Angles.x == 0 && Angles.y == 0)
      {
         yaw = 0;
         if (Angles.z > 0) pitch = 90.00;
         else pitch = 270.00;
      }
      else
      {
         if (Angles.x != -1) yaw = (float)(atan2((double)Angles.y, (double)Angles.x) * 180.00 / PI);
         else if (Angles.y > 0) yaw = 90.00;
         else yaw = 270;
         if (yaw < 0) yaw += 360.00;

         forward = (float)sqrt((double)(Angles.x * Angles.x + Angles.y * Angles.y));
         pitch = (float)(atan2((double)Angles.z, (double)forward) * 180.00 / PI);
         if (pitch < 0) pitch += 360.00;
      }
      angles[0] = -pitch;
      angles[1] = yaw;
      angles[2] = 0;

      return angles;
   }
   
   opd_s Setangles_t = { Offsets::SetClientViewAngles, TOC };
   void(*SetClientViewAnlges)(int Ent, float* Angles) = (void(*)(int , float*))&Setangles_t;

   void SetViewAngles(int Client)
   {
      int Victim = GetNearestPlayer(Client);
      float* Angles = vectoangles(GetVec(GetPlayerOrigin(Client), GetPlayerOriginVictim(Victim)));
      SetClientViewAnlges(G_Entity(Client), Angles);
   }
};

The following 2 users thanked NextGenGamer for this useful post:

HypnoticLobbiez (11-18-2014), T-T (11-17-2014)
#2. Posted:
ISIS
  • Resident Elite
Status: Offline
Joined: Sep 11, 201410Year Member
Posts: 268
Reputation Power: 14
Status: Offline
Joined: Sep 11, 201410Year Member
Posts: 268
Reputation Power: 14
Edit: nvm I thought this was the offhost one.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.