CLEO Help I want to make aimbot.

CLEO related
Status
Not open for further replies.

tested05

Active member
Joined
Jan 21, 2017
Messages
70
Reaction score
2
I have a question.
I can get the coordinates of the current target.
The question is, how do we convert these coordinates to mouse pointers?


For example, assuming that the coordinates of the target are at 1000,1000,1,
I wonder how to convert this 1000, 1000, and 1 coordinates to my mouse pointer
I would appreciate your teaching.
 

tested05

Active member
Joined
Jan 21, 2017
Messages
70
Reaction score
2


monday said:
dis
0B55: convert_3D_coords 1@ 2@ 3@ to_screen 4@ 5@

:me gusta:

I'm sorry. I do not use CLEO.
I am making it using Auto Hotkey.
Could you tell me by memory address or mathematical formula?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
idk autohotkey but below is what I used in c++, there's an internal gta function at 0x70CE30 address

monday said:
Code:
typedef bool (__cdecl *WorldCoords2ScreenCoords_t)(myVector*, myVector*, float * , float * , char, char);
WorldCoords2ScreenCoords_t WorldCoords2ScreenCoords = (WorldCoords2ScreenCoords_t)0x70CE30;

struct myVector
{
 float pos[3];
};


tuple<float, float, bool> Convert3DposTo2Dscreen(myVector inPoint)
{
    bool isOnScreen;
    float x, y;
    myVector outPoint;
    WorldCoords2ScreenCoords(&inPoint, &outPoint, &x, &y, 0, 0);//gta internal function

    outPoint.pos[0] /= x;
    outPoint.pos[0] /= outPoint.pos[2];
    outPoint.pos[1] /= y;
    outPoint.pos[1] /= outPoint.pos[2];
    outPoint.pos[0] *= resolutionX; 
    outPoint.pos[1] *= resolutionY;
    if(x > 0.0 && y > 0.0)
    {
        isOnScreen = true;
    }
    else
    {
        isOnScreen = false;
    }
    return make_tuple(outPoint.pos[0], outPoint.pos[1], isOnScreen);
}

+ how it's called (i returned tuple instead of something more handy like a struct pointer because I was learning but I guess it won't be a problem to you to change it)
Code:
myVector inPoint = { position.x, position.y, position.z};
tuple<float, float, bool> result = Convert3DposTo2Dscreen(inPoint);
if(get<2>(result) == true)//if on screen
{
    screenPos[0] = get<0>(result);
    screenPos[1] = get<1>(result);
}
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
There's a func. in MTA that does that and it doesn't require calling internal functions etc. Click here!.

So it's mainly multiplications and some memory reading, D3DXMATRIX is an array of 4x4 floats.
 

tested05

Active member
Joined
Jan 21, 2017
Messages
70
Reaction score
2
[quote pid='99770' dateline='1485143303']

monday said:
Code:
typedef bool (__cdecl *WorldCoords2ScreenCoords_t)(myVector*, myVector*, float * , float * , char, char);
WorldCoords2ScreenCoords_t WorldCoords2ScreenCoords = (WorldCoords2ScreenCoords_t)0x70CE30;

struct myVector
{
 float pos[3];
};


tuple<float, float, bool> Convert3DposTo2Dscreen(myVector inPoint)
{
    bool isOnScreen;
    float x, y;
    myVector outPoint;
    WorldCoords2ScreenCoords(&inPoint, &outPoint, &x, &y, 0, 0);//gta internal function

    outPoint.pos[0] /= x;
    outPoint.pos[0] /= outPoint.pos[2];
    outPoint.pos[1] /= y;
    outPoint.pos[1] /= outPoint.pos[2];
    outPoint.pos[0] *= resolutionX; 
    outPoint.pos[1] *= resolutionY;
    if(x > 0.0 && y > 0.0)
    {
        isOnScreen = true;
    }
    else
    {
        isOnScreen = false;
    }
    return make_tuple(outPoint.pos[0], outPoint.pos[1], isOnScreen);
}

+ how it's called (i returned tuple instead of something more handy like a struct pointer because I was learning but I guess it won't be a problem to you to change it)
Code:
myVector inPoint = { position.x, position.y, position.z};
tuple<float, float, bool> result = Convert3DposTo2Dscreen(inPoint);
if(get<2>(result) == true)//if on screen
{
    screenPos[0] = get<0>(result);
    screenPos[1] = get<1>(result);
}

[/quote]


Thank you for answer. I implemented this. The problem is, I want to know at what memory address this value should be entered.(CalcScreenCoords)
 

tested05

Active member
Joined
Jan 21, 2017
Messages
70
Reaction score
2
springfield said:
There's a func. in MTA that does that and it doesn't require calling internal functions etc. Click here!.

So it's mainly multiplications and some memory reading, D3DXMATRIX is an array of 4x4 floats.

Is it correct to use player coordinates(x,y,z) in parameters?
 

tested05

Active member
Joined
Jan 21, 2017
Messages
70
Reaction score
2
supahdupahnubah said:
tested05 said:
springfield said:
There's a func. in MTA that does that and it doesn't require calling internal functions etc. Click here!.

So it's mainly multiplications and some memory reading, D3DXMATRIX is an array of 4x4 floats.

Is it correct to use player coordinates(x,y,z) in parameters?

Yes, you can use it as a vector



Conversion to mouse coordinates succeeded.
I need to convert this value and put it into the coordinates of San Andreas. How do I do this?
 

Siedler

Active member
Joined
Oct 21, 2013
Messages
34
Reaction score
1
i made it like this

if playerOnAimAngle > myAngle
mousemoveto (mousepos-speed)

if playerOnAimAngle < myAngle
mousemoveto (mousepos+speed)


playerOnAim is just a little bit trigonometry, just paint it and you understand it easily.
https://i.imgur.com/SIb3bsS.png
 

tested05

Active member
Joined
Jan 21, 2017
Messages
70
Reaction score
2
Siedler은 said:
playerOnAimAngle> myAngle
mousemoveto (mousepos)

playerOnAimAngle는 <myAngle
mousemoveto (mousepos )


playerOnAim 
https://i.imgur.com/SIb3bsS.png


I think I made the answer strange.
Samp recognizes the current player's x, y, z as a point float.
6lcR8ux.jpg


In the picture above, the address 0xB6F258(gta_sa.exe+76F258) is the current x coordinate the player is viewing.
So, if the target's current mouse x-coordinate is 1000, what is the formula for converting it to a point float that the samp recognizes like a photo above it?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
This address contains your camera X angle from -Pi to Pi respectively (-3.14\3.14 ish)
You can look up for this snippet and opcode's explanation on that here : http://ugbase.eu/Thread-SNIPPET-AIM-AT-POSITION
I could explain you that, but the problem is that the last part of this I only understand at subconscious level lol

// I know you're on the way to make pixel aimbot, but you can also check this snippet with angle aimbot so you can understand some parts, as they are slightly simillar
 

tested05

Active member
Joined
Jan 21, 2017
Messages
70
Reaction score
2
supahdupahnubah said:
이 주소는 각각 파이에 -Pi에서 카메라 X 각도를 포함 (-3.14 분에 3.14 \)
현재이 조각과 그에 연산 코드의 설명을 찾아 볼 수 있습니다 : http://ugbase.eu/Thread-SNIPPET-AIM-AT α 위치는
당신을 것을 설명 할 수 있지만, 문제는이의 마지막 부분은 내가 단지 롤 잠재 의식 수준에서 이해하는 것입니다

당신은 또한 각 aimbot이 조각을 확인할 수 있습니다 // 당신이 픽셀 aimbot을 할 수있는 방법에있어 알고 있지만, 그래서 약간의 부분을 이해할 수 있습니다.


I finally succeeded in 20 hours. Thank you for your advice!
 
Status
Not open for further replies.
Top