Results 1 to 8 of 8
  1. #1
    Sandwich's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Location
    client_panorama.dll
    Posts
    1,512
    Reputation
    98
    Thanks
    23,162
    My Mood
    Psychedelic

    Question RCS Snapping to one location

    I am currently working on an external recoil control system and it keeps snapping to one location instead of wherever I am shooting. I have been debugging for the last couple hours and have had no luck so if anyone could help me, it would be appreciated.

    Code:
    struct RCS {
    	void SetViewAngles(vect angle)
    	{
    		vect newAngle = angle;
    		if (newAngle.x >= -180 && newAngle.x <= 180 && newAngle.y >= -180 && newAngle.y <= 180)
    		{
    			mem.WriteMemory<vect>(var.clientState + offsets.dwClientState_ViewAngles, newAngle);
    		}
    
    	}
    	void Recoil() {
    		vect CurrentViewAngles, vPunch, NewViewAngles, OldAimPunch;
    		OldAimPunch.x = 0,  OldAimPunch.y = 0, OldAimPunch.z = 0;
    		var.shotsFired = mem.ReadMemory<int>(var.localPlayer + offsets.m_iShotsFired);
    		var.localPlayer = mem.ReadMemory<DWORD>(mod.Client.dwBase + offsets.dwLocalPlayer);
    		var.clientState = mem.ReadMemory<DWORD>(mod.Engine.dwBase + offsets.dwClientState);
    		if (var.RCS == true && var.shotsFired >= 1) {
    			vPunch = mem.ReadMemory<vect>(var.localPlayer + offsets.m_aimPunchAngle);
    			vPunch.x = vPunch.x * 2.f;
    			vPunch.y = vPunch.y * 2.f;
    			CurrentViewAngles = mem.ReadMemory<vect>(var.clientState + offsets.m_viewPunchAngle);
    			NewViewAngles.x = ((CurrentViewAngles.x + OldAimPunch.x) - vPunch.x);
    			NewViewAngles.y = ((CurrentViewAngles.y + OldAimPunch.y) - vPunch.y);
    			NewViewAngles.z = 0;
    
    			SetViewAngles(NewViewAngles);
    
    			OldAimPunch.x = vPunch.x;
    			OldAimPunch.y = vPunch.y;
    
    			Sleep(1);
    		}
    		else {
    			OldAimPunch.x = 0, OldAimPunch.y = 0, OldAimPunch.z = 0, NewViewAngles.x = 0, NewViewAngles.y = 0, NewViewAngles.z = 0;
    		}
    	}
    } RCS;

  2. #2
    lenny69's Avatar
    Join Date
    Nov 2018
    Gender
    male
    Posts
    134
    Reputation
    10
    Thanks
    3,056
    My Mood
    Hot
    Code:
    CurrentViewAngles = mem.ReadMemory<vect>(var.clientState + offsets.m_viewPunchAngle);
    Are you trying to read your view punch angle into your current view angles?

  3. #3
    Sandwich's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Location
    client_panorama.dll
    Posts
    1,512
    Reputation
    98
    Thanks
    23,162
    My Mood
    Psychedelic
    Quote Originally Posted by lenny69 View Post
    Code:
    CurrentViewAngles = mem.ReadMemory<vect>(var.clientState + offsets.m_viewPunchAngle);
    Are you trying to read your view punch angle into your current view angles?
    Whether I use punch angles, eyes Angle, or client State View Angles, it still seems to snap to the center of the screen instead of where I am shooting.

  4. #4
    lenny69's Avatar
    Join Date
    Nov 2018
    Gender
    male
    Posts
    134
    Reputation
    10
    Thanks
    3,056
    My Mood
    Hot
    Quote Originally Posted by Sandwich View Post
    Whether I use punch angles, eyes Angle, or client State View Angles, it still seems to snap to the center of the screen instead of where I am shooting.
    Try using "cl_showpos 1" and see what your angles are. Also, print out all values to your console/cmd window and see what's going wrong. What I see with your code is that you're only working with the viewpunch angles and not the actual player viewangles.

    I think it works something like this:
    Vector3 oldpunch;

    Vector3 viewAngles = rpm(player+dwClientState_ViewAngles)
    Vector3 punchAngles = rpm(player+m_aimPunchAngle)
    punchAngles *= Vector3(2f,2f,0)

    Vector3 newViewAngles = Vector3(
    viewAngles.x - (punchAngles.x - oldpunch.x),
    viewAngles.y - (punchAngles.y - oldpunch.y),
    0
    )

  5. The Following User Says Thank You to lenny69 For This Useful Post:

    PurpleWirez (12-14-2018)

  6. #5
    Sandwich's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Location
    client_panorama.dll
    Posts
    1,512
    Reputation
    98
    Thanks
    23,162
    My Mood
    Psychedelic
    Now it drags down to your feet despite angle parameters. Do I need to change the parameters for x and y?
    Code:
    if (newAngle.x >= -180 && newAngle.x <= 180 && newAngle.y >= -180 && newAngle.y <= 180)
    		{
    			mem.WriteMemory<vect>(var.clientState + offsets.dwClientState_ViewAngles, newAngle);
    		}

  7. #6
    lenny69's Avatar
    Join Date
    Nov 2018
    Gender
    male
    Posts
    134
    Reputation
    10
    Thanks
    3,056
    My Mood
    Hot
    Is there any chance you could post the full code you created? Also try going in-game and debugging your viewangles. You can also try flipping the X and Y values and see if that fixes it.

  8. #7
    Sandwich's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Location
    client_panorama.dll
    Posts
    1,512
    Reputation
    98
    Thanks
    23,162
    My Mood
    Psychedelic
    Solved, thanks lenny. Can someone close this please.

  9. #8
    keve11's Avatar
    Join Date
    Feb 2019
    Gender
    male
    Posts
    17
    Reputation
    10
    Thanks
    1
    My Mood
    Dead
    when it will come out

Similar Threads

  1. [WTB] The Quest for the Impossible - 80 Fitbit's - One location
    By ImALegend2013 in forum User Services
    Replies: 4
    Last Post: 11-03-2016, 07:20 PM
  2. [Help] Aimbot + RCS snaps when using full auto machine guns?
    By CatInTh3Hat in forum Counter-Strike 2 Coding & Resources
    Replies: 2
    Last Post: 10-30-2016, 01:49 AM
  3. Teleport All Player in Server to One Location
    By doom14 in forum DayZ Mod & Standalone Hacks & Cheats
    Replies: 0
    Last Post: 08-18-2012, 08:19 AM
  4. Model One
    By Chronologix in forum Art & Graphic Design
    Replies: 6
    Last Post: 02-05-2006, 01:53 PM
  5. Yay another one xD
    By h0ang in forum Art & Graphic Design
    Replies: 4
    Last Post: 01-27-2006, 04:01 PM

Tags for this Thread