CLEO Help Cleo script lock on only one nickname

CLEO related
Status
Not open for further replies.

Angel9

Active member
Joined
May 6, 2021
Messages
65
Reaction score
2
Location
Belgrade, Serbia
Is it possible to set a script to work on only one nickname?
and how?
Code:
{$CLEO .cs}

0000: NOP

wait 10000 // wait until samp is ready

while true
wait 0

if
0ADC:   test_cheat "ON" // if press keys O AND N
then
    0@ = true
    0AD1: show_formatted_text_highpriority "Walking...." time 2000
end

if
0@ == true
then // 1
    if
    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1303.3429 1272.8828 radius 1.0 1.0 on_foot // start position
    then // 2
        repeat
        wait 0
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
        0AB1: @CAMERA_AT_POS 3 XYZ: 1308.2167 1291.9474 10.8203
        until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot    /// repeat until reach position
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
        if
        00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot // if reached position
        then // 3
            repeat
            wait 0
            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
            0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203
            until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position
            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
            if
            00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position
            then // 4
                repeat
                wait 0
                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
                0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203
                until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position
                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
                if
                00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position
                then // 5
                    repeat
                    wait 0
                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
                    0AB1: @CAMERA_AT_POS 3 XYZ: 1295.8840 1288.2472 10.8203
                    until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot    /// repeat until reach position
                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
                    if
                    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot // if reached position
                    then // 6 , so we have 6 - then , that means  we need 6 end
                        1@ += 1 // counter
                        0AD1: show_formatted_text_highpriority "~w~You reached last position ~n~ ~r~Current runing time: %d" time 2000 1@
                    end
                end
            end
        end
    end
end

if 1@ >= 10 // if runned 10 or more times then disable code
then
    0@ = false // disable bot
end
          
end // also while true always must have - end

: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

//0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@
:CAMERA_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
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
using Sampfuncs:
PHP:
0AC8: 0@ = allocate_memory_size 128
0B2B: samp 1@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B36: samp 0@ = get_player_nickname 1@
if 0C14: strcmp string1 0@ string2 "your_nickname"   // <-- case sensitive!
then
    //same nickname
else
    004E: end_thread //kill cleo
     // u can make a crash here if you don't want to leave remnants in memory
end

if you want w/o sampfuncs let me know your samp version...
 
Last edited:

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
Version samp 0.3.7
How do I put this in the code above?

Without sampfuncs:
PHP:
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 1000
0A8D: 0@ = readMem 0xC8D4C0 sz 4 vp 0
UNTIL 0@ == 9 // SAMP_IS_READY

:verifyNickname
wait 5000
0AC8: 0@ = allocate_memory_size 128
0AC8: 1@ = allocate_memory_size 128
0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@
0AD3: 1@ = format "nickname_you_want_to_acess" //case sensitive <----
if 0AB1: compare @StrCmp 2 str1 0@ str2 1@
then
    0AC9: free_allocated_memory 0@
    0AC9: free_allocated_memory 1@
    jump @main //--> loaded
else
    004E: end_thread //--> unloaded
end
jump @verifyNickname

:main
while true
wait 0
if
0ADC:   test_cheat "ON" // if press keys O AND N
then
    0@ = true
    0AD1: show_formatted_text_highpriority "Walking...." time 2000
end

if
0@ == true
then // 1
    if
    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1303.3429 1272.8828 radius 1.0 1.0 on_foot // start position
    then // 2
        repeat
        wait 0
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
        0AB1: @CAMERA_AT_POS 3 XYZ: 1308.2167 1291.9474 10.8203
        until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot    /// repeat until reach position
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
        if
        00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot // if reached position
        then // 3
            repeat
            wait 0
            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
            0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203
            until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position
            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
            if
            00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position
            then // 4
                repeat
                wait 0
                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
                0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203
                until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position
                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
                if
                00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position
                then // 5
                    repeat
                    wait 0
                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
                    0AB1: @CAMERA_AT_POS 3 XYZ: 1295.8840 1288.2472 10.8203
                    until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot    /// repeat until reach position
                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
                    if
                    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot // if reached position
                    then // 6 , so we have 6 - then , that means  we need 6 end
                        1@ += 1 // counter
                        0AD1: show_formatted_text_highpriority "~w~You reached last position ~n~ ~r~Current runing time: %d" time 2000 1@
                    end
                end
            end
        end
    end
end

if 1@ >= 10 // if runned 10 or more times then disable code
then
    0@ = false // disable bot
end
       
end // also while true always must have - end

: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

//0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@
:CAMERA_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

:Get_LocalPlayer_Name
/// 0AB1: call_scm_func @Get_My_NickName 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset    
0@ += 0x21A0F8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3CD
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x18
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools
0@ += 0xA //szLocalPlayerName
0AB2: ret 1 0@

:StrCmp
{
    Compares two strings to determine if they are the same. The comparison is case-sensitive.
    if 0AB1: compare @StrCmp 2 str1 0@ str2 1@
    then
    end
}
if 0AA2: 31@ = load_library "shlwapi.dll"
then
    if 0AA4: 30@ = get_proc_address "StrCmpW" library 31@
    then
        29@ = -1 // to prevent false alarm =)
        0AA7: _Call 30@ num_params 2 pop 0 str2 1@ str1 0@ _Result 29@
        if 29@ == 0
        then 0485:  return_true
        else 059A:  return_false
        end
    end
    0AA3: free_library 31@
end
0AB2: 0
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
Without sampfuncs:
PHP:
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 1000
0A8D: 0@ = readMem 0xC8D4C0 sz 4 vp 0
UNTIL 0@ == 9 // SAMP_IS_READY

:verifyNickname
wait 5000
0AC8: 0@ = allocate_memory_size 128
0AC8: 1@ = allocate_memory_size 128
0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@
0AD3: 1@ = format "nickname_you_want_to_acess" //case sensitive <----
if 0AB1: compare @StrCmp 2 str1 0@ str2 1@
then
    0AC9: free_allocated_memory 0@
    0AC9: free_allocated_memory 1@
    jump @main //--> loaded
else
    004E: end_thread //--> unloaded
end
jump @verifyNickname

:main
while true
wait 0
if
0ADC:   test_cheat "ON" // if press keys O AND N
then
    0@ = true
    0AD1: show_formatted_text_highpriority "Walking...." time 2000
end

if
0@ == true
then // 1
    if
    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1303.3429 1272.8828 radius 1.0 1.0 on_foot // start position
    then // 2
        repeat
        wait 0
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
        0AB1: @CAMERA_AT_POS 3 XYZ: 1308.2167 1291.9474 10.8203
        until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot    /// repeat until reach position
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
        if
        00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot // if reached position
        then // 3
            repeat
            wait 0
            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
            0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203
            until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position
            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
            if
            00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position
            then // 4
                repeat
                wait 0
                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
                0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203
                until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position
                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
                if
                00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position
                then // 5
                    repeat
                    wait 0
                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
                    0AB1: @CAMERA_AT_POS 3 XYZ: 1295.8840 1288.2472 10.8203
                    until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot    /// repeat until reach position
                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
                    if
                    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot // if reached position
                    then // 6 , so we have 6 - then , that means  we need 6 end
                        1@ += 1 // counter
                        0AD1: show_formatted_text_highpriority "~w~You reached last position ~n~ ~r~Current runing time: %d" time 2000 1@
                    end
                end
            end
        end
    end
end

if 1@ >= 10 // if runned 10 or more times then disable code
then
    0@ = false // disable bot
end
   
end // also while true always must have - end

: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

//0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@
:CAMERA_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

:Get_LocalPlayer_Name
/// 0AB1: call_scm_func @Get_My_NickName 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset
0@ += 0x21A0F8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3CD
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x18
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools
0@ += 0xA //szLocalPlayerName
0AB2: ret 1 0@

:StrCmp
{
    Compares two strings to determine if they are the same. The comparison is case-sensitive.
    if 0AB1: compare @StrCmp 2 str1 0@ str2 1@
    then
    end
}
if 0AA2: 31@ = load_library "shlwapi.dll"
then
    if 0AA4: 30@ = get_proc_address "StrCmpW" library 31@
    then
        29@ = -1 // to prevent false alarm =)
        0AA7: _Call 30@ num_params 2 pop 0 str2 1@ str1 0@ _Result 29@
        if 29@ == 0
        then 0485:  return_true
        else 059A:  return_false
        end
    end
    0AA3: free_library 31@
end
0AB2: 0


Little upgrade for snippet
PHP:
:StrCmp
{
    if 0AB1: compare @StrCmp 2 str1 0@ str2 1@
    then
        // do something..
    end
}
if 0AA2: 31@ = load_library "shlwapi.dll"
then
    if 0AA4: 30@ = get_proc_address "StrCmpW" library 31@
    then
        0AA5: call 0x718740 num_params 1 pop 1 0@ // lowercase selfReturn
        0AA5: call 0x718740 num_params 1 pop 1 1@ // lowercase selfReturn
        29@ = -1 // to prevent false alarm =)
        0AA7: _Call 30@ num_params 2 pop 0 str2 1@ str1 0@ _Result 29@
        if 29@ == 0
        then 0485:  return_true
        else 059A:  return_false
        end
    end
    0AA3: free_library 31@
end
0AB2: 0


And more in future.:
C++:
0x718600 - char *__cdecl CStr__gtaStrCpy(const char *szSource char *szDest)

0x718630 - char *__cdecl CStr__gtaStrCat(char *szDest const char *szSource)

0x718660 - char *__cdecl CStr__gtaStrCpy(char *szDest const char *szSource)

0x718690 - DWORD __cdecl CStr__gtaStrLen(const char *szString)

0x7186B0 - char *__cdecl CStr__gtaStrReplace(char *szDest const char *szSource, DWORD dwPos)

0x7186E0 - char *__cdecl CStr__gtaUCasePtr(char *szDest const char *szSource)

0x718710 - void __cdecl CStr__gtaUCase(const char *szString)

0x718740 - void __cdecl CStr__gtaLCase(const char *szString)
 
Last edited:

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
hmm i needed that too for my scripts but i know that it crashes the game when u shoot, can u make it like not to crash, just when someone uses other nickname, the cleo just to not work.
 

Angel9

Active member
Joined
May 6, 2021
Messages
65
Reaction score
2
Location
Belgrade, Serbia
Without sampfuncs:
PHP:
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 1000
0A8D: 0@ = readMem 0xC8D4C0 sz 4 vp 0
UNTIL 0@ == 9 // SAMP_IS_READY

:verifyNickname
wait 5000
0AC8: 0@ = allocate_memory_size 128
0AC8: 1@ = allocate_memory_size 128
0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@
0AD3: 1@ = format "nickname_you_want_to_acess" //case sensitive <----
if 0AB1: compare @StrCmp 2 str1 0@ str2 1@
then
    0AC9: free_allocated_memory 0@
    0AC9: free_allocated_memory 1@
    jump @main //--> loaded
else
    004E: end_thread //--> unloaded
end
jump @verifyNickname

:main
while true
wait 0
if
0ADC:   test_cheat "ON" // if press keys O AND N
then
    0@ = true
    0AD1: show_formatted_text_highpriority "Walking...." time 2000
end

if
0@ == true
then // 1
    if
    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1303.3429 1272.8828 radius 1.0 1.0 on_foot // start position
    then // 2
        repeat
        wait 0
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
        0AB1: @CAMERA_AT_POS 3 XYZ: 1308.2167 1291.9474 10.8203
        until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot    /// repeat until reach position
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
        if
        00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot // if reached position
        then // 3
            repeat
            wait 0
            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
            0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203
            until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position
            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
            if
            00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position
            then // 4
                repeat
                wait 0
                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
                0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203
                until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position
                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
                if
                00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position
                then // 5
                    repeat
                    wait 0
                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
                    0AB1: @CAMERA_AT_POS 3 XYZ: 1295.8840 1288.2472 10.8203
                    until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot    /// repeat until reach position
                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
                    if
                    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot // if reached position
                    then // 6 , so we have 6 - then , that means  we need 6 end
                        1@ += 1 // counter
                        0AD1: show_formatted_text_highpriority "~w~You reached last position ~n~ ~r~Current runing time: %d" time 2000 1@
                    end
                end
            end
        end
    end
end

if 1@ >= 10 // if runned 10 or more times then disable code
then
    0@ = false // disable bot
end
      
end // also while true always must have - end

: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

//0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@
:CAMERA_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

:Get_LocalPlayer_Name
/// 0AB1: call_scm_func @Get_My_NickName 0 0@
0AA2: 0@ = loadLib "samp.dll" //samp base offset   
0@ += 0x21A0F8
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo
0@ += 0x3CD
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools
0@ += 0x18
0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools
0@ += 0xA //szLocalPlayerName
0AB2: ret 1 0@

:StrCmp
{
    Compares two strings to determine if they are the same. The comparison is case-sensitive.
    if 0AB1: compare @StrCmp 2 str1 0@ str2 1@
    then
    end
}
if 0AA2: 31@ = load_library "shlwapi.dll"
then
    if 0AA4: 30@ = get_proc_address "StrCmpW" library 31@
    then
        29@ = -1 // to prevent false alarm =)
        0AA7: _Call 30@ num_params 2 pop 0 str2 1@ str1 0@ _Result 29@
        if 29@ == 0
        then 0485:  return_true
        else 059A:  return_false
        end
    end
    0AA3: free_library 31@
end
0AB2: 0

Thx, Not work for nickname John_Cool
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
Any samp...
PHP:
{$CLEO .cs}

0000: NOP

wait 8500


while true
wait 0

if 0256:   player $PLAYER_CHAR defined
then
    0AB1: @Get_Local_Player_Name 0 _Returned: Name 0@
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = format "Big_Boy" // NICK TO COMPARE
    if 0AB1: @cmpString1andString2 2 String1 0@ String2 1@
    then
        if 0ADC:   test_cheat "ON" // if press keys O AND N
        then
            31@ = true // send enable bot
            0AD1: show_formatted_text_highpriority "~W~Bot: ~G~ON...." time 2000
        end
    else
        if 0ADC:   test_cheat "ON" // if press keys O AND N
        then
            0AD1: show_formatted_text_highpriority "~W~Bot: ~R~Nice try.. ~N~ ~B~Wrong nickname ~R~ access denied" time 2000
        end
    end
end
   
if 31@ == true
then // 1
    if
    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1303.3429 1272.8828 radius 1.0 1.0 on_foot // start position
    then // 2
        repeat
        wait 0
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
        0AB1: @CAMERA_AT_POS 3 XYZ: 1308.2167 1291.9474 10.8203
        until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot    /// repeat until reach position
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
        if
        00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot // if reached position
        then // 3
            repeat
            wait 0
            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
            0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203
            until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position
            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
            if
            00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position
            then // 4
                repeat
                wait 0
                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
                0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203
                until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position
                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
                if
                00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position
                then // 5
                    repeat
                    wait 0
                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
                    0AB1: @CAMERA_AT_POS 3 XYZ: 1295.8840 1288.2472 10.8203
                    until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot    /// repeat until reach position
                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0
                    if
                    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot // if reached position
                    then // 6 , so we have 6 - then , that means  we need 6 end
                        1@ += 1 // counter
                        0AD1: show_formatted_text_highpriority "~W~You reached last position ~N~ ~R~Current running time: %d" time 2000 1@
                    end
                end
            end
        end
    end
end

if 1@ >= 10 // if runned 10 or more times then disable code
then
    31@ = false // send disable bot
    1@ = 0 // reset counter
end
      
end // also while true always must have - end

: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

//0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@
:CAMERA_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

:Get_Local_Player_Name
/// 0AB1: @Get_Local_Player_Name 0 _Returned: Name 1@
0AB1: @get_samp_version_id 0 _returned: ID 0@
IF 0AA2: 1@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 2@ = 1@ + 0x219A6F
    END

    IF 0@ == 2 // 0.3.7 R2
    THEN
        0A8E: 2@ = 1@ + 0x219A77
    END

    IF 0@ == 3 // 0.3.DL
    THEN
        0A8E: 2@ = 1@ + 0x2AC187
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 2@ = 1@ + 0x26E03F
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 2@ = 1@ + 0x26E16F
    END
END
0AB2: ret 1 2@

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: ID 16@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@

:lowercase
0AA5: call 0x718740 num_params 1 pop 1 0@
0AB2: 0

:cmpString1andString2
{
    Example: 0AB1: @cmpString1andString2 2 String1 1@ String2 2@
    In: 0@, 1@ - strings
    Out: result 0/1
}
for 7@ = 0 to 1024
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0  
    0A8D: 3@ = read_memory 1@ size 1 virtual_protect 0
    0@ += 1
    1@ += 1
    if 003B: 2@ == 3@
    jf break
    if and
    2@ == 0
    3@ == 0
    then
        0485: return_true
        ret 0
    end
end
059A: return_false
ret 0
 
Status
Not open for further replies.
Top