Solved Targeting Logic

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
2,978
17
So my current logic requirements for firing are as follows:
-Aimbot key is pressed
-Is an enemy player
-Is not dead
-Is closer than 30 meters
-Is within 100pixels of crosshair
-Is aiming at a player
-> Then Fire.

The issue is that if multiple targets check all of the above requirements then it flicks between them. I can't use a 'lock onto player untill player is dead' because if they run out of the player's vision it leaves the bot spraying the wall.

Any suggestions?

https://www.youtube.com/watch?v=a9AvEbeu4Ig&feature=youtu.be

ps. I also used a 'Is Spotted' variable, however the game has a ~1 second update delay on that which makes it very inconsistent and slow to react for playing against real people.
 

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
2,978
17
Ok so the issue is fixed, works fine now. Implemented a Distance check alongside team, hp and mouse down



C++:
int getClosestEnemy() //Find closest player
{
	int closestPlayer = 5;
	float closestDistance = 999;

	for (int p = 1; p < 11; p++) //Have to skip 0 or else it targets self with closest distance of 0
	{
		if (getDistance(p) < closestDistance && PlayerList[p].hp != 0 && PlayerList[p].team != PlayerStruct.team)
		{
			closestDistance = getDistance(p);
			closestPlayer = p;

		}
	}

	return closestPlayer;
}
I know its baby stuff but i'll post the solution anyway cause i hate threads that close without sharing the answer.
 

Syntax Error

Coder
Silenced
Meme Tier VIP
Nov 6, 2014
239
2,928
6
Disclaimer : I've never made an aimbot

Could you possibly put an if statement in your while loop to check if these conditions are met to decrement your counter so you keep targeting the same player?
 

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
2,978
17
Disclaimer : I've never made an aimbot

Could you possibly put an if statement in your while loop to check if these conditions are met to decrement your counter so you keep targeting the same player?
Possibly, i'll give it a test and let you know how i go.

Edit: While this might have been the cleanest and most practical way to go about it, i ended up just using another while loop that breaks upon release of the aimbot key. Whilst inside the second while loop it just locks onto the indexed player and shoots.
 
Last edited:

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
Possibly, i'll give it a test and let you know how i go.

Edit: While this might have been the cleanest and most practical way to go about it, i ended up just using another while loop that breaks upon release of the aimbot key. Whilst inside the second while loop it just locks onto the indexed player and shoots.
Do you compare those enemies' distances to you and aim at the closer one?
 

GAFO666

Hacker
Meme Tier VIP
Aug 19, 2012
520
3,188
23
hmm eez way to fix that is a static bool combined with the keypress event.
once the key is pressed it aims to one target and then it locks there until the button is released or the player is dead.. or commonly known as target lock
 

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
2,978
17
hmm eez way to fix that is a static bool combined with the keypress event.
once the key is pressed it aims to one target and then it locks there until the button is released or the player is dead.. or commonly known as target lock
Yeah this is pretty much what i did, feels cheap and dirty though.
 

GAFO666

Hacker
Meme Tier VIP
Aug 19, 2012
520
3,188
23
hmm your looping from 1 to 10 on your playerlist, may reverse the maxplayers or the connected player ammount
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods