Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 47
  1. #16
    Epik's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    1,144
    Reputation
    263
    Thanks
    12,120
    My Mood
    Amused
    Quote Originally Posted by ImWhacky View Post


    Lol i put that in to test it and this is what happened
    Each time the function is called 'vOldPunchAngle' will overwritten to 0. Did you make this yourself? Make the variable static or move it outside.
    Also, I would recommend normalizing your angles after every angle operation and clamp it in the end.

  2. The Following User Says Thank You to Epik For This Useful Post:

    ImStyL (05-22-2016)

  3. #17
    ImWhacky's Avatar
    Join Date
    Sep 2015
    Gender
    male
    Posts
    509
    Reputation
    56
    Thanks
    4,059
    My Mood
    Breezy
    Quote Originally Posted by Epik- View Post


    Each time the function is called 'vOldPunchAngle' will overwritten to 0. Did you make this yourself? Make the variable static or move it outside.
    Also, I would recommend normalizing your angles after every angle operation and clamp it in the end.
    where is it overwritten to 0? i dont ever see vOldPunchAngle being written to at all, it seems like it already has a value. I did not make this myself, @ImStyL wrote it. what variable do i make static and how do i do it.

    - - - Updated - - -

    Quote Originally Posted by ImStyL View Post
    This is what Epik was saying,
    It should work, as i already tested it.

    Code:
    			Vector vAimPunch;
    			Vector Fin;
    
    			DWORD Player = Mem.Read<DWORD>(Client.dwBase + LocalPlayer);
    			DWORD EngineBleh = Mem.Read<DWORD>(Engine.dwBase + 0x00610334); //0x00610334 = ClientState
    			vAimPunch = Mem.Read<Vector>(Player + VectorPunch);
    			Vector vOldPunchAngle;
    
    			if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
    			{
    				vAimPunch.x = vAimPunch.x * 2.f;
    				vAimPunch.y = vAimPunch.y * 2.f;
    				Vector ViewAngles = Mem.Read<Vector>(EngineBleh + ViewAngle);
    				Mem.NormalizeAngles(Fin);
    				Fin.x = ViewAngles.x - (vAimPunch.x - vOldPunchAngle.x);
    				Fin.y = ViewAngles.y - (vAimPunch.y - vOldPunchAngle.y);
    				NormalizeAngles(Fin);
    				Mem.Write<Vector>(EngineBleh + ViewAngle, Fin);
    			}
    			vOldPunchAngle = vAimPunch;
    ALSO THIS IS MY 69 POST, AYYLMAO
    tried this, its doing the same thing as the last one


     

    Steam-TriggeredFemenazi
    CS:GO Rank-MG (but I'm a dirty cheater so who cares)
    Discord-ImWhacky#6260

    P.M. me if you have any questions.


  4. #18
    Yemiez's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Sweden
    Posts
    2,566
    Reputation
    731
    Thanks
    16,279
    My Mood
    Devilish
    Quote Originally Posted by ImWhacky View Post
    where is it overwritten to 0? i dont ever see vOldPunchAngle being written to at all, it seems like it already has a value. I did not make this myself, @ImStyL wrote it. what variable do i make static and how do i do it.
    It's a local variable, it does not have static storage duration, only local storage duration.

    Example:
    Code:
    int increment_local()
    {
        int i = 0;
        return ++i;
    }
    
    int increment_static()
    {
       static int i = 0; /* thread_local will do the same, but it has a different storage location for each thread that calls it */
       return ++i;
    }
    increment_local will always return 1, increment_static will not (Only the first time it's called).
    Last edited by Yemiez; 05-22-2016 at 01:49 PM.

  5. #19
    ImWhacky's Avatar
    Join Date
    Sep 2015
    Gender
    male
    Posts
    509
    Reputation
    56
    Thanks
    4,059
    My Mood
    Breezy
    Quote Originally Posted by Yamiez View Post
    It's a local variable, it does not have static storage duration, only local storage duration.
    OMG DAD IS HERE, ok that makes sense but why is it making my player have turrets every time i need to shoot?


     

    Steam-TriggeredFemenazi
    CS:GO Rank-MG (but I'm a dirty cheater so who cares)
    Discord-ImWhacky#6260

    P.M. me if you have any questions.


  6. #20
    Yemiez's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Sweden
    Posts
    2,566
    Reputation
    731
    Thanks
    16,279
    My Mood
    Devilish
    Quote Originally Posted by ImWhacky View Post
    OMG DAD IS HERE, ok that makes sense but why is it making my player have turrets every time i need to shoot?
    See my edit.

  7. #21
    Epik's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    1,144
    Reputation
    263
    Thanks
    12,120
    My Mood
    Amused
    Code:
    void RCS()
    {
        Vector vOldPunchAngle;
    }
    Everytime RCS() is called, 'vOldPunchAngle' will be set to 0.
    You don't want this to happen so make the variable static by adding the keyword 'static' behind Vector or alternately move it outside the function.
    Last edited by Epik; 05-22-2016 at 01:53 PM.

  8. #22
    Yemiez's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Sweden
    Posts
    2,566
    Reputation
    731
    Thanks
    16,279
    My Mood
    Devilish
    Quote Originally Posted by Epik- View Post
    Everytime RCS() is called, 'vOldPunchAngle' will be set to 0.
    Hehe I dont mean to be annoying but it actually depends on the constructor :P (since he did not provide a constructor the compiler will automatically create one, it depends on what compiler he is using wether or not it will be initialized to 0)
    Last edited by Yemiez; 05-22-2016 at 01:54 PM.

  9. #23
    Epik's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    1,144
    Reputation
    263
    Thanks
    12,120
    My Mood
    Amused
    Quote Originally Posted by Yamiez View Post
    Hehe I dont mean to be annoying but it actually depends on the constructor :P
    Yeah, I'm making a big assumption but in this case it doesn't really matter since it will be overwritten in his function.
    Edit: nvm it better be 0

  10. #24
    Yemiez's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Sweden
    Posts
    2,566
    Reputation
    731
    Thanks
    16,279
    My Mood
    Devilish
    Quote Originally Posted by Epik- View Post


    Yeah, I'm making a big assumption but in this case it doesn't really matter since it will be overwritten in his function.
    Yea but he didn't actually create a default constructor, so one will be created automatically, assuming he is using VC compiler it'll be initialized to 0, otherwise unknown. But yea that is the problem, a new instance is constructed everytime the function is called.

  11. #25
    ImWhacky's Avatar
    Join Date
    Sep 2015
    Gender
    male
    Posts
    509
    Reputation
    56
    Thanks
    4,059
    My Mood
    Breezy
    Quote Originally Posted by Yamiez View Post
    Yea but he didn't actually create a default constructor, so one will be created automatically, assuming he is using VC compiler it'll be initialized to 0, otherwise unknown. But yea that is the problem, a new instance is constructed everytime the function is called.
    Ok this is what i have now
    Code:
    #pragma once
    #include "Offsets.h"
    #include <math.h>
    #include <iostream>
    #include <string>
    #include <ios>
    #include <iomanip>
    
    struct Vector {
    	float x, y, z;
    };
    
    
    Vector NormalizeAngles(Vector angle)
    {
    	if (!std::isfinite(angle.x)) {
    		angle.x = 0;
    	}
    	if (!std::isfinite(angle.y)) {
    		angle.y = 0;
    	}
    	while (angle.y < -180.0f) angle.y += 360.0f;
    	while (angle.y > 180.0f) angle.y -= 360.0f;
    	if (angle.x > 89.0f) angle.x = 89.0f;
    	if (angle.x < -89.0f) angle.x = -89.0f;
    	angle.z = 0;
    	return angle;
    }
    
    void RCS()
    {
    	if (RCSEnabled)
    	{
    		Vector vAimPunch;
    		Vector Fin;
    		static Vector vOldPunchAngle;
    
    		DWORD Player = Mem.Read<DWORD>(Client + LocalPlayer);
    		DWORD EngineBleh = Mem.Read<DWORD>(Engine + ClientState); //Engine is "Engine.dll"
    
    		if (GetAsyncKeyState(VK_LBUTTON))
    		{
    			vAimPunch = Mem.Read<Vector>(Player + Punch);
    			vAimPunch.x = vAimPunch.x * 2.f;
    			vAimPunch.y = vAimPunch.y * 2.f;
    
    			Vector ViewAngles = Mem.Read<Vector>(EngineBleh + ViewAngle);
    
    			Fin.x = ViewAngles.x - (vAimPunch.x - vOldPunchAngle.x);
    			Fin.y = ViewAngles.y - (vAimPunch.y - vOldPunchAngle.y);
    
    			NormalizeAngles(Fin);
    			Mem.Write<Vector>(EngineBleh + ViewAngle, Fin);
    			vOldPunchAngle = vAimPunch;
    		}
    		else
    		{
    			vOldPunchAngle.x = 0;
    			vOldPunchAngle.y = 0;
    			Fin.x = 0;
    			Fin.y = 0;
    		}
    
    	}
    	
    }
    and now its not doing anything again. its like the function isnt running but when i make it "un-static" it does the spaz thing again


     

    Steam-TriggeredFemenazi
    CS:GO Rank-MG (but I'm a dirty cheater so who cares)
    Discord-ImWhacky#6260

    P.M. me if you have any questions.


  12. #26
    Epik's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    1,144
    Reputation
    263
    Thanks
    12,120
    My Mood
    Amused
    Quote Originally Posted by ImWhacky View Post
    Ok this is what i have now
    Code:
    #pragma once
    #include "Offsets.h"
    #include <math.h>
    #include <iostream>
    #include <string>
    #include <ios>
    #include <iomanip>
    
    struct Vector {
    	float x, y, z;
    };
    
    
    Vector NormalizeAngles(Vector angle)
    {
    	if (!std::isfinite(angle.x)) {
    		angle.x = 0;
    	}
    	if (!std::isfinite(angle.y)) {
    		angle.y = 0;
    	}
    	while (angle.y < -180.0f) angle.y += 360.0f;
    	while (angle.y > 180.0f) angle.y -= 360.0f;
    	if (angle.x > 89.0f) angle.x = 89.0f;
    	if (angle.x < -89.0f) angle.x = -89.0f;
    	angle.z = 0;
    	return angle;
    }
    
    void RCS()
    {
    	if (RCSEnabled)
    	{
    		Vector vAimPunch;
    		Vector Fin;
    		static Vector vOldPunchAngle;
    
    		DWORD Player = Mem.Read<DWORD>(Client + LocalPlayer);
    		DWORD EngineBleh = Mem.Read<DWORD>(Engine + ClientState); //Engine is "Engine.dll"
    
    		if (GetAsyncKeyState(VK_LBUTTON))
    		{
    			vAimPunch = Mem.Read<Vector>(Player + Punch);
    			vAimPunch.x = vAimPunch.x * 2.f;
    			vAimPunch.y = vAimPunch.y * 2.f;
    
    			Vector ViewAngles = Mem.Read<Vector>(EngineBleh + ViewAngle);
    
    			Fin.x = ViewAngles.x - (vAimPunch.x - vOldPunchAngle.x);
    			Fin.y = ViewAngles.y - (vAimPunch.y - vOldPunchAngle.y);
    
    			NormalizeAngles(Fin);
    			Mem.Write<Vector>(EngineBleh + ViewAngle, Fin);
    			vOldPunchAngle = vAimPunch;
    		}
    		else
    		{
    			vOldPunchAngle.x = 0;
    			vOldPunchAngle.y = 0;
    			Fin.x = 0;
    			Fin.y = 0;
    		}
    
    	}
    	
    }
    and now its not doing anything again. its like the function isnt running but when i make it "un-static" it does the spaz thing again
    Code:
    static Vector vOldPunchAngle = Vector(0, 0, 0);

  13. #27
    ImWhacky's Avatar
    Join Date
    Sep 2015
    Gender
    male
    Posts
    509
    Reputation
    56
    Thanks
    4,059
    My Mood
    Breezy
    Quote Originally Posted by Epik- View Post


    Code:
    static Vector vOldPunchAngle = Vector(0, 0, 0);
    "no suitable constructor exists to convert int to vector"


     

    Steam-TriggeredFemenazi
    CS:GO Rank-MG (but I'm a dirty cheater so who cares)
    Discord-ImWhacky#6260

    P.M. me if you have any questions.


  14. #28
    Epik's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    1,144
    Reputation
    263
    Thanks
    12,120
    My Mood
    Amused
    Quote Originally Posted by ImWhacky View Post
    "no suitable constructor exists to convert int to vector"
    lol, can you show your Vector class

  15. #29
    ImWhacky's Avatar
    Join Date
    Sep 2015
    Gender
    male
    Posts
    509
    Reputation
    56
    Thanks
    4,059
    My Mood
    Breezy
    Quote Originally Posted by Epik- View Post


    lol, can you show your Vector class
    struct Vector {
    float x, y, z;
    };


     

    Steam-TriggeredFemenazi
    CS:GO Rank-MG (but I'm a dirty cheater so who cares)
    Discord-ImWhacky#6260

    P.M. me if you have any questions.


  16. #30
    Epik's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    1,144
    Reputation
    263
    Thanks
    12,120
    My Mood
    Amused
    Quote Originally Posted by ImWhacky View Post
    struct Vector {
    float x, y, z;
    };
    I thought it was a class..

    Code:
    struct Vector {
    	float x = y = z = 0;
    };
    Try that. No need to do Vector(0, 0, 0).
    Last edited by Epik; 05-22-2016 at 02:25 PM.

Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. [Help] External skinchanger not working.
    By KillTubeCZ in forum Counter-Strike 2 Coding & Resources
    Replies: 3
    Last Post: 01-14-2016, 10:19 AM
  2. [Solved] RCS Not Working
    By Skips in forum Counter-Strike 2 Help
    Replies: 5
    Last Post: 11-01-2015, 08:46 AM
  3. why warrock not working now??
    By tolik13 in forum WarRock - International Hacks
    Replies: 4
    Last Post: 07-09-2006, 03:27 PM
  4. WPE not work
    By trekpik in forum WarRock - International Hacks
    Replies: 3
    Last Post: 07-09-2006, 10:09 AM