Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Code Created By Hacksorce
- //Other Code for getting the Positions of all clients
- int getClientState(int client)
- {
- return 0x830CBF80 + (client * 0x3700);
- }
- struct PlayerData
- {
- int Deaths;
- int Kills;
- float Location[2];
- float Current_Location[2];
- };
- PlayerData PData[18];
- void Monitering()
- {
- for(;;)
- {
- if(Dvar_GetBool("cl_ingame"))
- {
- for (int i = 0;i<18;i++)
- {
- PData[i].Current_Location[0] = *(float*)(getClientState(i) +0x1c);
- PData[i].Current_Location[1] = *(float*)(getClientState(i) +0x20);
- PData[i].Current_Location[2] = *(float*)(getClientState(i) +0x24);
- }
- }
- }
- }
- //Main Aimbot Code
- struct Distance
- {
- float x, y,z;
- };
- float PI = 3.14159265;
- float CompareDisatnce(Distance D1,Distance D2)
- {
- float X = D2.x - D1.x;
- float Y = D2.y - D1.y;
- float Z = D2.z - D1.z;
- float distance = sqrt(pow(X,2) + pow(Y,2)+pow(Z,2));
- return distance;
- }
- int ClosestClient(int Local_client)
- {
- float Closest = 99999999999;
- int Closest_Client = -1;
- Distance Loc;
- Distance Cur;
- Loc.x = PData[Local_client].Current_Location[0];
- Loc.y = PData[Local_client].Current_Location[1];
- Loc.z = PData[Local_client].Current_Location[2];
- for(int i = 0;i<18;i++)
- {
- if(i == Local_client)
- continue;
- Cur.x = PData[i].Current_Location[0];
- Cur.y = PData[i].Current_Location[1];
- Cur.z = PData[i].Current_Location[2];
- if(CompareDisatnce(Loc,Cur) < Closest)
- {
- Closest = CompareDisatnce(Loc,Cur);
- Closest_Client = i;
- }
- }
- return Closest_Client;
- }
- void Aimbot(int Local_Client,int Target_Client)
- {
- Distance Loc, Cur;
- Loc.x = PData[Local_Client].Current_Location[0];
- Loc.y = PData[Local_Client].Current_Location[1];
- Loc.z = PData[Local_Client].Current_Location[2];
- Cur.x = PData[Target_Client].Current_Location[0];
- Cur.y = PData[Target_Client].Current_Location[1];
- Cur.z = PData[Target_Client].Current_Location[2];
- float AimX = atan2f(PData[Target_Client].Current_Location[2] - PData[Local_Client].Current_Location[2],CompareDisatnce(Loc,Cur)) * 180/PI;
- float AimY = atan2f(PData[Target_Client].Current_Location[0] - PData[Local_Client].Current_Location[0],PData[Target_Client].Current_Location[1] - PData[Local_Client].Current_Location[1]) / PI * 180+180;
- *(float*)(getClientState(Local_Client) + 0x214) = AimX;
- *(float*)(getClientState(Local_Client) + 0x218) = AimY;
- }
- void StartAimbot()
- {
- int Button;
- for(;;)
- {
- Button = Buttons(getHost());
- if(Button & 0x80800)
- {
- Aimbot(getHost(),ClosestClient(getHost()));
- }
- }
- }
- //OP: https://pastebin.com/TG9cvAjh#
- //BaSs_HaXoR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement