unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > First-Person Shooters > Other FPS Games

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 04-15-2010, 04:56 AM
disco disco is offline
Administrator
 
Join Date: Feb 2010
Posts: 271
Default AssaultCube Aimbot Source

Posted by Roverturbo.




Just a basic aimbot i wrote using the SDK for a free game called AssaultCude that some people were having fun with. My projects going in the recycle bin hence i thought i would atleast post something. If you don't want 360 degree then uncomment the commented piece of code. And you can easily expand on this like i did.

Code:
#include "pch.h"
#include "cube.h"
#include "bot/bot.h"

VOID aimbot(VOID)
{
  if(player1->state == CS_ALIVE)
  {
    playerent* Target_Player = NULL;

    FLOAT Enemy_Distance;
    FLOAT Nearest_Enemy_Distance = 99999.9f;
        
    SHORT Enemy_Distance_Rating;
    SHORT Best_Enemy_Distance_Rating = -100;

    loopv(players)
    {
      if(players[i] == player1 || !players[i] ||
         isteam(players[i]->team, player1->team) || (players[i]->state != CS_ALIVE))
      continue;
      
      vec Target_Player_Vector;
      vec Forward_Vector;
      vec Right_Vector;
      vec Up_Vector;

      AnglesToVectors(vec(player1->pitch, player1->yaw, player1->roll), Forward_Vector, Right_Vector, Up_Vector);

      Target_Player_Vector = players[i]->o;
      Target_Player_Vector.sub(player1->o);
      
      Target_Player_Vector.z = 0.0f;
      Target_Player_Vector   = Normalize(Target_Player_Vector);

      Forward_Vector.z = 0;    
      FLOAT Dot_Product = Target_Player_Vector.dot(Forward_Vector);

      traceresult_s Tracer_Result;
      TraceLine(player1->o, players[i]->o, NULL, FALSE, &Tracer_Result, FALSE);

      if(!Tracer_Result.collided == TRUE
         // && Dot_Product >= 0.5f
       )
      {    
        Enemy_Distance = players[i]->o.dist(player1->o);
        Enemy_Distance_Rating = 1;
          
        if(Enemy_Distance < Nearest_Enemy_Distance)
        {
          Enemy_Distance_Rating += 2;
          Nearest_Enemy_Distance = Enemy_Distance;
        }
              
        if(Enemy_Distance_Rating > Best_Enemy_Distance_Rating)
        {
          Target_Player = players[i];
          Best_Enemy_Distance_Rating = Enemy_Distance_Rating;
        }
      }
    }

    if(Target_Player != NULL)
    {
      player1->pitch = atan2(Target_Player->o.z - player1->o.z, Target_Player->o.dist(player1->o)) * 180 / PI;
      player1->yaw = -(FLOAT)atan2(Target_Player->o.x - player1->o.x, Target_Player->o.y - player1->o.y) / PI * 180 + 180;
              
      vec Forward_Vector;
      vec Right_Vector;
      vec Up_Vector;
      vec Destination_Vector;
              
      AnglesToVectors(vec(player1->pitch, player1->yaw, player1->roll), Forward_Vector, Right_Vector, Up_Vector);
              
      Destination_Vector = Target_Player->o;
      Forward_Vector.mul(1000);
      Destination_Vector.add(Forward_Vector);

      traceresult_s Tracer_Result;        
      TraceLine(player1->o, Destination_Vector, player1, FALSE, &Tracer_Result);

      player1->attacking = TRUE;
      shoot(player1, Tracer_Result.end);
      player1->attacking = FALSE;
    }
  }
}
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
aimbot, assaultcube, source

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 02:03 PM.