Results 1 to 9 of 9
  1. #1
    hopsin15's Avatar
    Join Date
    May 2017
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0

    Can u help me with adding "nearest" to my ayyware.

    I dont know how to add nearest to ayyware's legitbot, can u help me?

  2. #2
    nertigelts's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    129
    Reputation
    10
    Thanks
    108
    scan for more hitboxes??

  3. #3
    Don Coderleone's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    Hungary
    Posts
    465
    Reputation
    17
    Thanks
    134
    My Mood
    Relaxed
    Nearest enemy to crosshair? Get the hitbox position, calculate fovs for all enemy, and pick the lowest.
    Also stop using ayyware as a base.

  4. #4
    affe2626's Avatar
    Join Date
    Apr 2015
    Gender
    male
    Location
    Sweden
    Posts
    552
    Reputation
    146
    Thanks
    151
    My Mood
    Angelic
    Nearest what?

    Always PM me when trading, I've been hacked on my Skype previously
    [img]https://**********.com/addskype/affe2626.png[/img]

  5. #5
    nertigelts's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    129
    Reputation
    10
    Thanks
    108
    Quote Originally Posted by affe2626 View Post
    Nearest what?
    nearest hitbox like in p2c ..

  6. #6
    affe2626's Avatar
    Join Date
    Apr 2015
    Gender
    male
    Location
    Sweden
    Posts
    552
    Reputation
    146
    Thanks
    151
    My Mood
    Angelic
    Quote Originally Posted by nertigelts View Post
    nearest hitbox like in p2c ..
    Oh, just iterate through every entity, get their and your position. Get an angle from your position to the desired target. (Hint, CalcAngle). Compare the distance from every angle to your viewangles. (if the distance is less than it was before then make that your maximum distance and reset it after you've iterated through every entity.) The distance can be measured using the pythagorean theoriem.



    Some code examples.
    Code:
    double dAimFov = MenuObjects::AimbotFOV.Get();
    	for (size_t i = 0; i < 32; i++)
    	{
    		KaninSDK::CBasePlayer* pEntity = reinterpret_cast<KaninSDK::CBasePlayer*>(pClientEntityList->GetClientEntity(i));
    		if (!pLocal)
    			continue;
    		if (!pEntity)
    			continue;
    		if (pEntity->GetHealth() < 1)
    			continue;
    		if (pEntity->GetTeam() == pLocal->GetTeam())
    			continue;
    		if (pEntity->bIsDormant())
    			continue;
    		Angle = CalcAngle(pLocal->GetHeadPosition(), pEntity->GetBonePosition(8));
    		NormalizeAngle(Angle);
    		double tempDist = GetDistanceToAngle(Angle, CurAngle);
    		if (tempDist < dAimFov)
    		{
    			dAimFov = tempDist;
    			vecTargetAngle = Angle;
    		}
    	}
    Code:
    double Get2DDistance(Vector vec1, Vector vec2)
    {
    	return sqrt(pow(vec1.x - vec2.x, 2) + pow(vec1.y - vec2.y, 2));
    }
    
    Vector CalcAngle(Vector vecSource, Vector vecDestination)
    {
    	Vector vecDelta = vecSource - vecDestination;
    	double Hypotenuse = sqrt(pow(vecDelta.x, 2) + pow(vecDelta.y, 2));
    
    	Vector vecTemp(
    		static_cast<float>(atanf(vecDelta.z / Hypotenuse) * RADPI),
    			static_cast<float>(atanf(vecDelta.y / vecDelta.x) * RADPI),
    			static_cast<float>(0.f));
    	if (vecDelta.x >= 0.f)
    	{
    		vecTemp.y += 180.f;
    	}
    	return vecTemp;
    }
    If you want the closest hitbox then I think that you can just iterate through every hitbox, same logic applies.
    Last edited by affe2626; 08-13-2017 at 11:27 AM.

    Always PM me when trading, I've been hacked on my Skype previously
    [img]https://**********.com/addskype/affe2626.png[/img]

  7. The Following User Says Thank You to affe2626 For This Useful Post:

    ThatPurpleGuy (08-19-2017)

  8. #7
    WildAssassinz's Avatar
    Join Date
    May 2016
    Gender
    male
    Posts
    502
    Reputation
    30
    Thanks
    467
    My Mood
    Angry
    Quote Originally Posted by affe2626 View Post
    Oh, just iterate through every entity, get their and your position. Get an angle from your position to the desired target. (Hint, CalcAngle). Compare the distance from every angle to your viewangles. (if the distance is less than it was before then make that your maximum distance and reset it after you've iterated through every entity.) The distance can be measured using the pythagorean theoriem.



    Some code examples.
    Code:
    double dAimFov = MenuObjects::AimbotFOV.Get();
    	for (size_t i = 0; i < 32; i++)
    	{
    		KaninSDK::CBasePlayer* pEntity = reinterpret_cast<KaninSDK::CBasePlayer*>(pClientEntityList->GetClientEntity(i));
    		if (!pLocal)
    			continue;
    		if (!pEntity)
    			continue;
    		if (pEntity->GetHealth() < 1)
    			continue;
    		if (pEntity->GetTeam() == pLocal->GetTeam())
    			continue;
    		if (pEntity->bIsDormant())
    			continue;
    		Angle = CalcAngle(pLocal->GetHeadPosition(), pEntity->GetBonePosition(8));
    		NormalizeAngle(Angle);
    		double tempDist = GetDistanceToAngle(Angle, CurAngle);
    		if (tempDist < dAimFov)
    		{
    			dAimFov = tempDist;
    			vecTargetAngle = Angle;
    		}
    	}
    Code:
    double Get2DDistance(Vector vec1, Vector vec2)
    {
    	return sqrt(pow(vec1.x - vec2.x, 2) + pow(vec1.y - vec2.y, 2));
    }
    
    Vector CalcAngle(Vector vecSource, Vector vecDestination)
    {
    	Vector vecDelta = vecSource - vecDestination;
    	double Hypotenuse = sqrt(pow(vecDelta.x, 2) + pow(vecDelta.y, 2));
    
    	Vector vecTemp(
    		static_cast<float>(atanf(vecDelta.z / Hypotenuse) * RADPI),
    			static_cast<float>(atanf(vecDelta.y / vecDelta.x) * RADPI),
    			static_cast<float>(0.f));
    	if (vecDelta.x >= 0.f)
    	{
    		vecTemp.y += 180.f;
    	}
    	return vecTemp;
    }
    If you want the closest hitbox then I think that you can just iterate through every hitbox, same logic applies.
    i think a float is good enough
    Current Projects:
    TurtleCheat GlowESP BunnyHop
    HelixGlow (With Permission from nullptr_t)

  9. #8
    affe2626's Avatar
    Join Date
    Apr 2015
    Gender
    male
    Location
    Sweden
    Posts
    552
    Reputation
    146
    Thanks
    151
    My Mood
    Angelic
    Quote Originally Posted by WildAssassinz View Post
    i think a float is good enough
    Yeah, doesn't matter really.

    Always PM me when trading, I've been hacked on my Skype previously
    [img]https://**********.com/addskype/affe2626.png[/img]

  10. #9
    WildAssassinz's Avatar
    Join Date
    May 2016
    Gender
    male
    Posts
    502
    Reputation
    30
    Thanks
    467
    My Mood
    Angry
    Quote Originally Posted by affe2626 View Post
    Yeah, doesn't matter really.
    true /2short
    Current Projects:
    TurtleCheat GlowESP BunnyHop
    HelixGlow (With Permission from nullptr_t)

Similar Threads

  1. [Help Request] Can anyone help me with server Anti-Hacks
    By Skilifa in forum DayZ Help & Requests
    Replies: 6
    Last Post: 03-31-2013, 09:23 PM
  2. [Help Request] Pls Can someone Help me with the Bowonky Hack
    By big james in forum DayZ Help & Requests
    Replies: 2
    Last Post: 03-06-2013, 07:01 AM
  3. [Help Request] can anyone help me with the basic of creating hacks
    By xhevanlyx in forum Crossfire Coding Help & Discussion
    Replies: 9
    Last Post: 01-17-2013, 12:50 PM
  4. [Help Request] Can any help me with this Cheat engine code?
    By vinvin148 in forum Alliance of Valiant Arms (AVA) Help
    Replies: 0
    Last Post: 07-17-2012, 12:48 PM
  5. [Help Request] Can someone help me with this code
    By L33tHaxorCod3r in forum Minecraft Help
    Replies: 3
    Last Post: 07-16-2012, 11:48 AM