CLEO Help Any Updated Version of this?

CLEO related

alvisalward

Member
Joined
Jun 15, 2023
Messages
10
Reaction score
0
I really need this but it crashed, any updated version for 0.3DL? And it will be great if someone could add some speed control in it. Thanks!
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Magic in the air :eek:
PHP:
{$CLEO .cs}

0000:

REPEAT
IF 8256:   player $PLAYER_CHAR defined
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0256:   player $PLAYER_CHAR defined

0AC8: 31@ = allocate_memory_size 1024
0AD3: 31@ = string_format "jobbot"
0AC7: 30@ = var 30@ pointer
0AC7: 29@ = var 29@ pointer
0AB1: @registerClientCommand 3 _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
30@ = 0 // default disabled
29@ = 0 // null ptr

0AC8: 28@ = allocate_memory_size 1024
0AD3: 28@ = string_format "killcs"
0AC7: 27@ = var 27@ pointer
0AC7: 26@ = var 26@ pointer
0AB1: @registerClientCommand 3 _CommandName 28@ _TogglingVar 27@ _ParamsPtrToVar 26@
27@ = 0 // default disabled
26@ = 0 // null ptr

19@ = 100.0

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    IF 30@ <> 0 // CMD - jobbot
    THEN
        30@ = 0 // disable indication of the cmd
        IF 25@ == FALSE
        THEN
            25@ = TRUE
            0AC8: 24@ = allocate_memory_size 1024
            0AD3: 24@ = format "{cecece}[JobBot]: Mod ON!"
            0AB1: @Chatmsg 2 text 24@ color -1
            0AC9: free_allocated_memory 24@
        ELSE
            25@ = FALSE
            0AC8: 24@ = allocate_memory_size 1024
            0AD3: 24@ = format "{cecece}[JobBot]: Mod OFF!"
            0AB1: @Chatmsg 2 text 24@ color -1
            0AC9: free_allocated_memory 24@
        END
    END
 
    IF 27@ <> 0 // CMD - killcs
    THEN
        27@ = 0 // disable indication of the cmd
        004E: end_thread
    END
 
    IF 8AAB:   file_not_exists "CLEO\JobBotSettings.ini"
    THEN 0AF3: write_float 100.0 to_ini_file "cleo\JobBotSettings.ini" section "Vehicle" key "MaxSpeed"
    ELSE 0AF2: 19@ = get_float_from_ini_file "cleo\JobBotSettings.ini" section "Vehicle" key "MaxSpeed"
    END
 
    IF AND
    25@ == TRUE
    00DF:   actor $PLAYER_ACTOR in_car // i'm in car
    THEN
        03C0: 23@ = actor $PLAYER_ACTOR car // my car, get car handle
        IF 23@ > 0
        THEN
            046C: 22@ = car 23@ driver // get car driver handle
            IF 003B:   22@ == $PLAYER_ACTOR // compare car driver handle with my handle, if it's matching that means i'm driver
            THEN
                IF 0AB1: @is_racecp_active 0 // is race checkpoint active
                THEN
                    0AB1: @get_racecp_pos 0 XYZ 4@ 5@ 6@ // get the coords of race checkpoint
                    IF AND
                    0AB0: 8 // SPACEBARD
                    0AB0: 38 // UP ARROW
                    THEN 19@ += 1.0
                    END
                    IF AND
                    0AB0: 8 // SPACEBARD
                    0AB0: 40 // DOWN ARROW
                    THEN 19@ -= 1.0
                    END
                    00AD: set_car 23@ max_speed_to 19@
                    00A7: car 23@ drive_to 4@ 5@ 6@ // drive car to race checkpoint
                END
 
                0AC8: 21@ = allocate_memory_size 144
                0AC8: 20@ = allocate_memory_size 144
                0AB1: @getChatString 1 ChatID 99 _Returned: Text 21@ PrefixText 20@ Color 19@ PrefixColor 18@ // get last chat string                                                                                                 
                IF 0AD4: $NOT_USED = scan_string 21@ format "Please stop in the checkpoint." // When i get in the checkpoint, this will be shown and i have to stop until the checkpoint disappears {it will show me another string so it won't be constantly stopped}
                THEN 0AB1: @BRAKE 0 // break if it says in chat to stop
                ELSE 0AB1: @GAS 0 // if it doesn't say to stop, accelerate
                END
                0AC9: free_allocated_memory 21@
                0AC9: free_allocated_memory 20@
            END
        END
    END
END     

END

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: ID 0@
30@ = 0
IF 0AA2: 31@ = "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
    IF 29@ == 0x6094ACAB
    THEN // 0.3.7 R4 - v2
        30@ = 6
    END
    IF 29@ == 0x6372C39E
    THEN // 0.3.7 R5
        30@ = 7
    END
END
0AB2: ret 1 30@

:registerClientCommand
{
    Credits:
        Parazitas - UGBASE
        kawa_operand - BlastHack
 
    Usage:
    0AC8: 31@ = allocate_memory_size 1024
    0AD3: 31@ = string_format "vr"
    0AC7: 30@ = var 30@ pointer
    0AC7: 29@ = var 29@ pointer
    0AB1: @registerClientCommand 3 _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
    30@ = 0 // default disabled
    29@ = 0 // null ptr
 
    Note:
        The Reference Pointers passed at _TogglingVar and _ParamPtrToVar are required to be treated as ReadOnly. Which means that the value of those two Reference Pointers should not be manually overwritten/changed.

    I am having a problem with opcode 0AB1, it permanently writes on the main thread's local variables. Maybe its because I directly writes on the passed variable's memory pointer. An example case:
        Passing _ParamPtrToVar = 31@ , _TogglingVar = 30@
            Opcode 0AB1 31@ == Main Thread's 31@
            Opcode 0AB1 30@ == Main Thread's 30@

    Thats why I decided to use global variables since they aren't that exposed on scripts.
}
CONST
    //    WARNING:
    //        Do not use Local Variables
    //        Do not recycle/use the three variables on any operation inside the script because these variables will always be used by this function and doesn't override outside the function. I promise you that even if you replace this with a local variable, It will cause overwriting mistakes that will mess the operation
    // You can Replace any of these variables into any UNIQUE GLOBAL VARIABLES
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    VAR5 = $2EBF
    VAR6 = $2FAA
END
IF 0AA2: VAR4 = "samp.dll"
THEN
        // ~~~~~~~~~~~~~ Create a New Callback Structure
        {
            51                      // push     ecx
            56                      // push     esi
            8B 74 24 0C             // mov     esi, [esp+0Ch]
            89 34 25 11 11 11 11    // mov     [11111111], esi // later: [11111111] becomes 1@
            83 35 11 11 11 11 01    // xor     [11111111], 01 // later: [11111111] becomes 2@
            5E                      // pop     esi
            59                      // pop     ecx
            C3 // retn
        }
            // Avoid using local variables by saving the values inside a global variables
    008A: VAR1 = 0@
    008A: VAR2 = 2@
    008A: VAR3 = 1@
            //
    0AC8: VAR5 = allocate_memory_size 23 // undeleteable memory region
    0084: VAR6 = VAR5
    0A8C: write_memory VAR6 size 4 value 0x748B5651 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 4 value 0x34890C24 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 1 value 0x25 virtual_protect 1
    VAR6++
    // 0A8C: write_memory VAR2 size 4 value 0 virtual_protect 0 // null string // NOT WORKING due to this function's varibles overriding
    0A8C: write_memory VAR6 size 4 value VAR2 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 2 value 0x3583 virtual_protect 1
    VAR6 += 2
    // 0A8C: write_memory VAR3 size 4 value 0 virtual_protect 0 // Zeroing TogglingVar // NOT WORKING due to this function's varibles overriding
    0A8C: write_memory VAR6 size 4 value VAR3 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 4 value 0xC3595E01 virtual_protect 1
        // ~~~~~~~~~~~~~ now callback struct VAR5 is ready
    10@ = @get_samp_version_id
    0AB1: 10@ 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: VAR6 = VAR4 + 0x21A0E8 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x65AD0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: VAR6 = VAR4 + 0x21A0F0 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x65BA0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: VAR6 = VAR4 + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x691B0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: VAR6 = VAR4 + 0x26E8CC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69000 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: VAR6 = VAR4 + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69730 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: VAR6 = VAR4 + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69770 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: VAR6 = VAR4 + 0x26EB84 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69770 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
 
        0AA6: call_method VAR4 struct VAR6 num_params 2 pop 0 VAR5 VAR1
    END
END
0AB2: ret 0

:is_racecp_active
//  0AB1: @is_racecp_active 0
IF 0AA2: 31@ = loadlib "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A10C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x49 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A114 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA3C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8F4 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x4D // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EBAC // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 30@ == TRUE
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
        0AA3: freelib 31@
    END
END
0AB2: ret 0

:get_racecp_pos
// 0AB1: @get_racecp_pos 0 XYZ 1@ 2@ 3@
IF 0AA2: 31@ = loadlib "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A10C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x2C // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x30 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x34 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A114 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA3C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8F4 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EBAC // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        0AA3: freelib 31@
    END
END
0AB2: ret 3 28@ 26@ 24@

:getChatString
{
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            31@ += 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            31@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            31@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 7 // 0.3.7 R5
        THEN
            31@ += 0x26EB80 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        0AA3: 31@
    END
END
0AB2: ret 4 30@ 29@ 27@ 24@

:Chatmsg
/*
     0AC8: 0@ = allocate_memory_size 1024
     0AD3: 0@ = format "{FFFFFF}Auto Accept: {00FF00}ON"
     0AB1: @Chatmsg 2 text 0@ color -1
     0AC9: free_allocated_memory 0@
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _Returned: ID 17@
    IF NOT 17@ < 1
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E4            // SAMP_CHAT_INFO_OFFSET (R1)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x64010             // FUNC_ADDTOCHATWND (R1)
        END

        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0EC            // SAMP_CHAT_INFO_OFFSET (R2)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x640E0            // FUNC_ADDTOCHATWND (R2)
        END

        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA10            // SAMP_CHAT_INFO_OFFSET (DL)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67650             // FUNC_ADDTOCHATWND (DL)
        END

        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8C8            // SAMP_CHAT_INFO_OFFSET (R3)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67460             // FUNC_ADDTOCHATWND (R3)
        END

        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BA0             // FUNC_ADDTOCHATWND (R4) 699D0
        END
   
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BE0            // FUNC_ADDTOCHATWND (R4)
        END
     
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB80            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BE0            // FUNC_ADDTOCHATWND (R4)
        END
             
        IF 1@ == -1
        THEN 1@ = 0xFFFFFFFF
        END
        0AA6: call 29@ struct 30@ num_params 5 pop 0 params 0 1@ 0 0@ 8
    END
END
0AB2: ret 0

:GAS
0@ = 0xB73458
0@ += 0x20
0A8C: write_memory 0@ size 1 value 255 virtual_protect 0
0AB2: 0

:BRAKE
0@ = 0xB73458
0@ += 0xC
0A8C: write_memory 0@ size 1 value 255 virtual_protect 0
0AB2: 0
 

Attachments

  • JobBOT.cs
    45.9 KB · Views: 23
Last edited:

alvisalward

Member
Joined
Jun 15, 2023
Messages
10
Reaction score
0
Magic in the air :eek:
PHP:
{$CLEO .cs}

0000:

REPEAT
IF 8256:   player $PLAYER_CHAR defined
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0256:   player $PLAYER_CHAR defined

0AC8: 31@ = allocate_memory_size 1024
0AD3: 31@ = string_format "jobbot"
0AC7: 30@ = var 30@ pointer
0AC7: 29@ = var 29@ pointer
0AB1: @registerClientCommand 3 _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
30@ = 0 // default disabled
29@ = 0 // null ptr

0AC8: 28@ = allocate_memory_size 1024
0AD3: 28@ = string_format "killcs"
0AC7: 27@ = var 27@ pointer
0AC7: 26@ = var 26@ pointer
0AB1: @registerClientCommand 3 _CommandName 28@ _TogglingVar 27@ _ParamsPtrToVar 26@
27@ = 0 // default disabled
26@ = 0 // null ptr

19@ = 100.0

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    IF 30@ <> 0 // CMD - jobbot
    THEN
        30@ = 0 // disable indication of the cmd
        IF 25@ == FALSE
        THEN
            25@ = TRUE
            0AC8: 24@ = allocate_memory_size 1024
            0AD3: 24@ = format "{cecece}[JobBot]: Mod ON!"
            0AB1: @Chatmsg 2 text 24@ color -1
            0AC9: free_allocated_memory 24@
        ELSE
            25@ = FALSE
            0AC8: 24@ = allocate_memory_size 1024
            0AD3: 24@ = format "{cecece}[JobBot]: Mod OFF!"
            0AB1: @Chatmsg 2 text 24@ color -1
            0AC9: free_allocated_memory 24@
        END
    END
 
    IF 27@ <> 0 // CMD - killcs
    THEN
        27@ = 0 // disable indication of the cmd
        004E: end_thread
    END
 
    IF 8AAB:   file_not_exists "CLEO\JobBotSettings.ini"
    THEN 0AF3: write_float 100.0 to_ini_file "cleo\JobBotSettings.ini" section "Vehicle" key "MaxSpeed"
    ELSE 0AF2: 19@ = get_float_from_ini_file "cleo\JobBotSettings.ini" section "Vehicle" key "MaxSpeed"
    END
 
    IF 00DF:   actor $PLAYER_ACTOR in_car // i'm in car
    THEN
        03C0: 23@ = actor $PLAYER_ACTOR car // my car, get car handle
        IF 23@ > 0
        THEN
            046C: 22@ = car 23@ driver // get car driver handle
            IF 003B:   22@ == $PLAYER_ACTOR // compare car driver handle with my handle, if it's matching that means i'm driver
            THEN
                IF 0AB1: @is_racecp_active 0 // is race checkpoint active
                THEN
                    0AB1: @get_racecp_pos 0 XYZ 4@ 5@ 6@ // get the coords of race checkpoint
                    IF AND
                    0AB0: 8 // SPACEBARD
                    0AB0: 38 // UP ARROW
                    THEN 19@ += 1.0
                    END
                    IF AND
                    0AB0: 8 // SPACEBARD
                    0AB0: 40 // DOWN ARROW
                    THEN 19@ -= 1.0
                    END
                    00AD: set_car 23@ max_speed_to 19@
                    00A7: car 23@ drive_to 4@ 5@ 6@ // drive car to race checkpoint
                END
 
                0AC8: 21@ = allocate_memory_size 144
                0AC8: 20@ = allocate_memory_size 144
                0AB1: @getChatString 1 ChatID 99 _Returned: Text 21@ PrefixText 20@ Color 19@ PrefixColor 18@ // get last chat string                                                                                                 
                IF 0AD4: $NOT_USED = scan_string 21@ format "Please stop in the checkpoint." // When i get in the checkpoint, this will be shown and i have to stop until the checkpoint disappears {it will show me another string so it won't be constantly stopped}
                THEN 0AB1: @BRAKE 0 // break if it says in chat to stop
                ELSE 0AB1: @GAS 0 // if it doesn't say to stop, accelerate
                END
                0AC9: free_allocated_memory 21@
                0AC9: free_allocated_memory 20@
            END
        END
    END
END     

END

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: ID 0@
30@ = 0
IF 0AA2: 31@ = "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
    IF 29@ == 0x6094ACAB
    THEN // 0.3.7 R4 - v2
        30@ = 6
    END
    IF 29@ == 0x6372C39E
    THEN // 0.3.7 R5
        30@ = 7
    END
END
0AB2: ret 1 30@

:registerClientCommand
{
    Credits:
        Parazitas - UGBASE
        kawa_operand - BlastHack
 
    Usage:
    0AC8: 31@ = allocate_memory_size 1024
    0AD3: 31@ = string_format "vr"
    0AC7: 30@ = var 30@ pointer
    0AC7: 29@ = var 29@ pointer
    0AB1: @registerClientCommand 3 _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
    30@ = 0 // default disabled
    29@ = 0 // null ptr
 
    Note:
        The Reference Pointers passed at _TogglingVar and _ParamPtrToVar are required to be treated as ReadOnly. Which means that the value of those two Reference Pointers should not be manually overwritten/changed.

    I am having a problem with opcode 0AB1, it permanently writes on the main thread's local variables. Maybe its because I directly writes on the passed variable's memory pointer. An example case:
        Passing _ParamPtrToVar = 31@ , _TogglingVar = 30@
            Opcode 0AB1 31@ == Main Thread's 31@
            Opcode 0AB1 30@ == Main Thread's 30@

    Thats why I decided to use global variables since they aren't that exposed on scripts.
}
CONST
    //    WARNING:
    //        Do not use Local Variables
    //        Do not recycle/use the three variables on any operation inside the script because these variables will always be used by this function and doesn't override outside the function. I promise you that even if you replace this with a local variable, It will cause overwriting mistakes that will mess the operation
    // You can Replace any of these variables into any UNIQUE GLOBAL VARIABLES
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    VAR5 = $2EBF
    VAR6 = $2FAA
END
IF 0AA2: VAR4 = "samp.dll"
THEN
        // ~~~~~~~~~~~~~ Create a New Callback Structure
        {
            51                      // push     ecx
            56                      // push     esi
            8B 74 24 0C             // mov     esi, [esp+0Ch]
            89 34 25 11 11 11 11    // mov     [11111111], esi // later: [11111111] becomes 1@
            83 35 11 11 11 11 01    // xor     [11111111], 01 // later: [11111111] becomes 2@
            5E                      // pop     esi
            59                      // pop     ecx
            C3 // retn
        }
            // Avoid using local variables by saving the values inside a global variables
    008A: VAR1 = 0@
    008A: VAR2 = 2@
    008A: VAR3 = 1@
            //
    0AC8: VAR5 = allocate_memory_size 23 // undeleteable memory region
    0084: VAR6 = VAR5
    0A8C: write_memory VAR6 size 4 value 0x748B5651 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 4 value 0x34890C24 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 1 value 0x25 virtual_protect 1
    VAR6++
    // 0A8C: write_memory VAR2 size 4 value 0 virtual_protect 0 // null string // NOT WORKING due to this function's varibles overriding
    0A8C: write_memory VAR6 size 4 value VAR2 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 2 value 0x3583 virtual_protect 1
    VAR6 += 2
    // 0A8C: write_memory VAR3 size 4 value 0 virtual_protect 0 // Zeroing TogglingVar // NOT WORKING due to this function's varibles overriding
    0A8C: write_memory VAR6 size 4 value VAR3 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 4 value 0xC3595E01 virtual_protect 1
        // ~~~~~~~~~~~~~ now callback struct VAR5 is ready
    10@ = @get_samp_version_id
    0AB1: 10@ 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: VAR6 = VAR4 + 0x21A0E8 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x65AD0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: VAR6 = VAR4 + 0x21A0F0 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x65BA0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: VAR6 = VAR4 + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x691B0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: VAR6 = VAR4 + 0x26E8CC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69000 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: VAR6 = VAR4 + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69730 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: VAR6 = VAR4 + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69770 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: VAR6 = VAR4 + 0x26EB84 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
            VAR4 += 0x69770 // SAMP_REGISTER_CLIENT_CMD_OFFSET
        END
 
        0AA6: call_method VAR4 struct VAR6 num_params 2 pop 0 VAR5 VAR1
    END
END
0AB2: ret 0

:is_racecp_active
//  0AB1: @is_racecp_active 0
IF 0AA2: 31@ = loadlib "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A10C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x49 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A114 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA3C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8F4 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x4D // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EBAC // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 30@ == TRUE
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
        0AA3: freelib 31@
    END
END
0AB2: ret 0

:get_racecp_pos
// 0AB1: @get_racecp_pos 0 XYZ 1@ 2@ 3@
IF 0AA2: 31@ = loadlib "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A10C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x2C // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x30 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x34 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A114 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA3C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8F4 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EBAC // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        0AA3: freelib 31@
    END
END
0AB2: ret 3 28@ 26@ 24@

:getChatString
{
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            31@ += 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            31@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 3 // 0.3.DL
        THEN
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 4 // 0.3.7 R3
        THEN
            31@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 5 // 0.3.7 R4
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
     
        IF 17@ == 7 // 0.3.7 R5
        THEN
            31@ += 0x26EB80 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            0@ *= 0xFC
            005A: 31@ += 0@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        0AA3: 31@
    END
END
0AB2: ret 4 30@ 29@ 27@ 24@

:Chatmsg
/*
     0AC8: 0@ = allocate_memory_size 1024
     0AD3: 0@ = format "{FFFFFF}Auto Accept: {00FF00}ON"
     0AB1: @Chatmsg 2 text 0@ color -1
     0AC9: free_allocated_memory 0@
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _Returned: ID 17@
    IF NOT 17@ < 1
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E4            // SAMP_CHAT_INFO_OFFSET (R1)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x64010             // FUNC_ADDTOCHATWND (R1)
        END

        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0EC            // SAMP_CHAT_INFO_OFFSET (R2)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x640E0            // FUNC_ADDTOCHATWND (R2)
        END

        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA10            // SAMP_CHAT_INFO_OFFSET (DL)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67650             // FUNC_ADDTOCHATWND (DL)
        END

        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8C8            // SAMP_CHAT_INFO_OFFSET (R3)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67460             // FUNC_ADDTOCHATWND (R3)
        END

        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BA0             // FUNC_ADDTOCHATWND (R4) 699D0
        END
   
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BE0            // FUNC_ADDTOCHATWND (R4)
        END
     
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB80            // SAMP_CHAT_INFO_OFFSET (R4)
            0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
            0A8E: 29@ = 31@ + 0x67BE0            // FUNC_ADDTOCHATWND (R4)
        END
             
        IF 1@ == -1
        THEN 1@ = 0xFFFFFFFF
        END
        0AA6: call 29@ struct 30@ num_params 5 pop 0 params 0 1@ 0 0@ 8
    END
END
0AB2: ret 0

:GAS
0@ = 0xB73458
0@ += 0x20
0A8C: write_memory 0@ size 1 value 255 virtual_protect 0
0AB2: 0

:BRAKE
0@ = 0xB73458
0@ += 0xC
0A8C: write_memory 0@ size 1 value 255 virtual_protect 0
0AB2: 0
The cleo works perfectly fine, but the vehicle automatically drive when Race Checkpoint shows, isn't supposed to be toggleable?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
The cleo works perfectly fine, but the vehicle automatically drive when Race Checkpoint shows, isn't supposed to be toggleable?
Edited code.
So copy code and compile.

Also speed is controlled by Press SPACEBAR + UP ARROW OR DOWN ARROW
 

Attachments

  • JobBot.cs
    45.9 KB · Views: 30
Last edited:
Top