CLEO Help help

CLEO related

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
603.3316,881.1383,-43.0400 - this is my position

1330.9824,1353.9567,10.8203 - this is checkpoint position

how can i turn my character to the checkpoint position

Code:
0AB1: @AIM_AT_POS 4 XYZ: 1@ 2@ 3@ ADD_CAMERA_OFFSET 0.04253
wait 100
06BA: AS_actor $PLAYER_ACTOR turn_to_and_look_at 1@ 2@ 3@
but it is not straight..it has to go a little bit to the left
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
IF 80EC: not_actor $PLAYER_ACTOR sphere 0 near_point 1@ 2@ radius 1.0 1.0
THEN
    0AB1: @AIM_AT_POS 4 XYZ: 1@ 2@ 3@ ADD_CAMERA_OFFSET 0.04253
    00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@
END
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
Code:
{$CLEO .cs}
thread "exam"
wait 0


0B34: samp register_client_command "sss" to_label @Noname_132
0B34: samp register_client_command "tpx" to_label @Noname_1323




:re
    wait 0
    IF 0AB0:   key_pressed 88
    then
    wait 0
    0AB1: @get_cp_pos 0 1@ 2@ 3@
      0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@
     wait 100
      06BA: AS_actor $PLAYER_ACTOR turn_to_and_look_at 1@ 2@ 3@
      0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@
     wait 100
      06BA: AS_actor $PLAYER_ACTOR turn_to_and_look_at 1@ 2@ 3@
      0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@
     wait 100
      06BA: AS_actor $PLAYER_ACTOR turn_to_and_look_at 1@ 2@ 3@
      0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@
     wait 100
      06BA: AS_actor $PLAYER_ACTOR turn_to_and_look_at 1@ 2@ 3@
      wait 1000
       0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
       wait 30
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
        wait 2000
        while 0AB1: @is_cp_active 0
        Actor.StorePos($PLAYER_ACTOR, 7@,8@,9@)
    wait 100
    Actor.LockInCurrentPosition($PLAYER_ACTOR) = TRUE
    //000F: 8@ -= 10.0
    000B: 7@ += 10.1
    wait 100
      Actor.PutAt($PLAYER_ACTOR, 7@,8@,9@)
    end
    end
jump @re
    

:Noname_1323
0B12: 31@ = 31@ XOR 1
SAMP.CmdRet()

{
    call @getTargetMarkerHandle 0 returnTo: 0@
}
:get_cp_pos
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0xC
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
0AB2: ret 3 2@ 3@ 4@


//0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@
:AIM_AT_POS
0087: 8@ = 3@
068D: get_camera_position_to 3@ 4@ 5@
0063: 0@ -= 3@
0063: 1@ -= 4@
0604: get_Z_angle_for_point 0@ 1@ store_to 6@
6@ -= 90.0
0017: 6@ /= 57.2957795           
005B: 6@ += 8@  // (float)                           
0A8D: 7@ = read_memory 0xB6F248 size 4 virtual_protect 0
0A25: set_camera_on_players_X_angle 7@ Z_angle 6@
0661: "by Opcode.eXe | UGBASE.EU"
0AB2: 0

:Set_Virtual_Key
{
    255 = true
    0 = false
    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
}
2@ = 0xB72CC8
0@ *= 2
005A: 2@ += 0@  // (int)
0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0
0AB2: ret 0


:is_cp_active
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
IF 1@ == TRUE
THEN 0485:  return_true
ELSE 059A:  return_false
END
0AA3: freelib 0@
0AB2: ret 0

:Noname_132
chatmsg "reloading waypoint" -1
004E:
0B43: samp cmd_ret
this one it is working good..but not best..i want my char to go straight into the checkpoint by moving 10 by 10 meters. i have X: 20 and if i activate the code then X coord will be 30 then 40 then 50 and so on until i reach the checkpoint. i know how to move my char with X coord and Y coord but not both to get the correct way..
 
Top