CLEO Help Question

CLEO related
Status
Not open for further replies.

Parazitas

God
Joined
Jan 2, 2017
Messages
3,121
Solutions
5
Reaction score
882
Location
Lithuania
How detect when player going left or right?

@monday
@supahdupahnubah
@springfield

I tryed like that , but this not working :/

[shcode=cpp]

{$CLEO .cs}
0000:

wait 10000

WHILE TRUE
wait 0

if
0ab0: 90
then
    0AB1: call @GET_ON_FOOT_KEY_PAD 1 Active_Status true
end

end  

:GET_ON_FOOT_KEY_PAD 
IF
0@ == true
THEN
    1@ = 0xB73458
    1@ += 0x5 // look left
    0A8D: 5@ = read_memory 1@ size 1 virtual_protect 0 
    IF
    5@ == 128
    THEN
        4@ = 0xB73458
        4@ += 0x1 // left 
        0A8C: write_memory 4@ size 1 value 255 virtual_protect 0
    ELSE
        4@ = 0xB73458
        4@ += 0x1  // left off
        0A8C: write_memory 4@ size 1 value 0 virtual_protect 0
    END
    
    2@ = 0xB73458
    2@ += 0x4  // look right
    0A8D: 3@ = read_memory 2@ size 1 virtual_protect 0 
    IF
    3@ == 128
    THEN
        6@ = 0xB73458
        6@ += 0x0 // Right
        0A8C: write_memory 6@ size 1 value 255 virtual_protect 0
    ELSE
        6@ = 0xB73458
        6@ += 0x0  // Right off
        0A8C: write_memory 6@ size 1 value 0 virtual_protect 0
    END 
END
0AB2: ret 0

[/shcode]
 

_=Gigant=_

Well-known member
Joined
Mar 21, 2017
Messages
353
Reaction score
16
Code:
{$CLEO}
0000:

:shet
wait 0
056D:  actor $PLAYER_ACTOR defined
jf @shet
0@ = Actor.Angle($PLAYER_ACTOR)
Actor.Angle($PLAYER_ACTOR) = 0@
if 
0AB0: key_pressed 68 //D
then
00BC: show_text_highpriority GXT 'FEC_RFA' time 100 flag 1  //RIGHT
end
if 
0AB0: key_pressed 65 //A
then
00BC: show_text_highpriority GXT 'FEC_LEF' time 100 flag 1  // Left
end  
jump @shet
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,121
Solutions
5
Reaction score
882
Location
Lithuania
_=Gigant=_ said:
Code:
{$CLEO}
0000:

:shet
wait 0
056D:  actor $PLAYER_ACTOR defined
jf @shet
0@ = Actor.Angle($PLAYER_ACTOR)
Actor.Angle($PLAYER_ACTOR) = 0@
if 
0AB0: key_pressed 68 //D
then
00BC: show_text_highpriority GXT 'FEC_RFA' time 100 flag 1  //RIGHT
end
if 
0AB0: key_pressed 65 //A
then
00BC: show_text_highpriority GXT 'FEC_LEF' time 100 flag 1  // Left
end  
jump @shet

So you think this work when i run .path file?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Depends on why you need it, if you need it to record your character's movement and position then you might wanna try this :
CPed +0x558 = [float] Current rotation (Z angle)
CPed +0x55C = [float] Target rotation (Z angle)
CPed +0x560 = [float] Rotation speed (Z angle)
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,121
Solutions
5
Reaction score
882
Location
Lithuania
supahdupahnubah said:
Depends on why you need it, if you need it to record your character's movement and position then you might wanna try this :
CPed +0x558 = [float] Current rotation (Z angle)
CPed +0x55C = [float] Target rotation (Z angle)
CPed +0x560 = [float] Rotation speed (Z angle)

I mean this.:
[shcode=cpp]
0AB1: call @char_goto 4 XYZ 1234.0 4321.0 1243.0 sprint true

 :char_goto
repeat
    wait 0
    00A0: store_actor $PLAYER_ACTOR position_to 4@ 5@ 2@
    0063: 0@ -= 4@
    0063: 1@ -= 5@
    0604: get_Z_angle_for_point 0@ 1@ store_to 2@
    005B: 0@ += 4@
    005B: 1@ += 5@
    2@ *= 0.01745
    0A96: 4@ = actor $PLAYER_ACTOR struct
    4@ += 0x558
    0A8C: write_memory 4@ size 4 value 2@ virtual_protect 0
    0373: set_camera_directly_behind_player
    if
        3@ == false
    then
        4@ = 0xB73458
        4@ += 0x20
        0A8C: write_memory 4@ size 1 value 0 virtual_protect 0
        4@ = 0xB73458
        4@ += 0x3
        0A8C: write_memory 4@ size 1 value 255 virtual_protect 0
    else
        4@ = 0xB73458
        4@ += 0x20
        0A8C: write_memory 4@ size 1 value 255 virtual_protect 0
        4@ = 0xB73458
        4@ += 0x3
        0A8C: write_memory 4@ size 1 value 255 virtual_protect 0
    end
until 00ED: actor $PLAYER_ACTOR 0 near_point 0@ 1@ radius 0.4 0.4 on_foot
0AB2: ret 0
[/shcode]

If i correctly understand snippet. This snippet just going to poss, pressing  W and make char sprint , but not pressing A or D
So i wanna - add A And D Press
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Parazitas said:
If i correctly understand snippet. This snippet just going to poss, pressing  W and make char sprint , but not pressing A or D
So i wanna - add A And D Press

Well at first you said you need to detect (get if) that, anyways, you can just emulate A\D key presses at random time (there's opcode to pick a random number)
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,121
Solutions
5
Reaction score
882
Location
Lithuania
supahdupahnubah said:
Parazitas said:
If i correctly understand snippet. This snippet just going to poss, pressing  W and make char sprint , but not pressing A or D
So i wanna - add A And D Press

Well at first you said you need to detect (get if) that, anyways, you can just emulate A\D key presses at random time (there's opcode to pick a random number)

Thanks.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,121
Solutions
5
Reaction score
882
Location
Lithuania
How get car ratation?
@supahdupahnubah

I tryed use this , but failed or just doing wrong.:
[shcode=cpp]
+0 = [float] X-axis Rotation (Grad)
+4 = [float] Y-axis Rotation (Grad)
+8 = [float] Z-axis Rotation (Grad)
+16 = [float] X-axis Rotation (Looking)
+20 = [float] Y-axis Rotation (Looking)
+24 = [float] Z-axis Rotation (Looking)
[/shcode]

I wanna with memory change car ratation like.:
[shcode=cpp]
if
car is like that " ↑ "
then
    put car like that " → "
end

[/shcode]
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Parazitas said:
How get car ratation?

I tryed use this , but failed or just doing wrong.:
[shcode=cpp]
+0 = [float] X-axis Rotation (Grad)
+4 = [float] Y-axis Rotation (Grad)
+8 = [float] Z-axis Rotation (Grad)
+16 = [float] X-axis Rotation (Looking)
+20 = [float] Y-axis Rotation (Looking)
+24 = [float] Z-axis Rotation (Looking)
[/shcode]

I wanna with memory change car ratation like.:
[shcode=cpp]
if
car is like that " ↑ "
then
    put car like that " → "
end

[/shcode]

Honestly, never tried doing something like this, you might wanna calculate the Z angle and then simply sub\add it just like the aimbot
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,121
Solutions
5
Reaction score
882
Location
Lithuania
supahdupahnubah said:
Parazitas said:
How get car ratation?

I tryed use this , but failed or just doing wrong.:
[shcode=cpp]
+0 = [float] X-axis Rotation (Grad)
+4 = [float] Y-axis Rotation (Grad)
+8 = [float] Z-axis Rotation (Grad)
+16 = [float] X-axis Rotation (Looking)
+20 = [float] Y-axis Rotation (Looking)
+24 = [float] Z-axis Rotation (Looking)
[/shcode]

I wanna with memory change car ratation like.:
[shcode=cpp]
if
car is like that " ↑ "
then
    put car like that " → "
end

[/shcode]

Honestly, never tried doing something like this, you might wanna calculate the Z angle and then simply sub\add it just like the aimbot

You mean like this.:

[shcode=cpp]
{$CLEO .cs}

0000:

repeat
wait 0
until 0afa:

while true
wait 0

if 00DF: actor $PLAYER_ACTOR driving
then
    03C0: 0@ = actor $PLAYER_ACTOR car
    0407: coords 1@ 2@ 3@ car 0@ with_offset 0.0 0.0 -0.6 
    0AB1: @Zangle 2 1@ 2@
end

end

:Zangle
03C0: 4@ = actor $PLAYER_ACTOR car
0407: coords 2@ 3@ 4@ car 4@ with_offset 0.0 0.0 0.0
0063: 0@ -= 2@
0063: 1@ -= 3@
0604: get_Z_angle_for_point 0@ 1@ store_to 31@       
0172: 30@ = actor $PLAYER_ACTOR Z_angle
000F: 30@ -= 360.0
0097: make 30@ absolute_float
005B: 31@ += 30@
02F6: 30@ = sine 31@
02F7: 31@ = cosine 31@
0604: get_Z_angle_for_point 30@ 31@ store_to 31@ 
CHATMSG "%0.1d" -1 31@
0AB2: ret 0
[/shcode]
 
Status
Not open for further replies.
Top