CLEO Help Rework code from 0.3.7 R1 to 0.3.7 R4

CLEO related

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
I tried to rework my code what worked on me on 0.3.7 R1 worked on 0.3.7 R4, but there I only see this
rainbowremoteblank.png
but it should look like this
rainbowremote.png
PHP:
{$CLEO .cs}

0000:

wait 8500
0AB1: @get_samp_version_id 0 _returned: id 0@   
$myvarghfgdfg = 0

WHILE TRUE
    WAIT 0

if
//0AB0:   key_pressed 101
0ADC:   test_cheat "rbor"
then
$myvarghfgdfg = 1
end

if
$myvarghfgdfg == 1
then
$myvarghfgdfg = 0
0AC9: free_allocated_memory $myvarghj1
0AC9: free_allocated_memory $myvarghj2
0AC9: free_allocated_memory $myvarghj3
0AC9: free_allocated_memory $myvarghj4
0AC9: free_allocated_memory $myvarghj5
0AC9: free_allocated_memory $myvarghj6
0AC9: free_allocated_memory $myvarghj7
0AC9: free_allocated_memory $myvarghj8
0AC9: free_allocated_memory $myvarghj9
0AC9: free_allocated_memory $myvarghj10
0AC9: free_allocated_memory $myvarghj11
0AC9: free_allocated_memory $myvarghjk1
0AC9: free_allocated_memory $myvarghjk2
0AC9: free_allocated_memory $myvarghjk3
0AC9: free_allocated_memory $myvarghjk4
0AC9: free_allocated_memory 9@
0AC9: free_allocated_memory 10@
0AC9: free_allocated_memory 11@
0AC9: free_allocated_memory 12@
0AC9: free_allocated_memory 13@
0AC9: free_allocated_memory 14@
0AC9: free_allocated_memory 16@
0AC9: free_allocated_memory 17@
0AC8: $myvarghj1 = allocate_memory_size 1024
0AC8: $myvarghj2 = allocate_memory_size 1024
0AC8: $myvarghj3 = allocate_memory_size 1024
0AC8: $myvarghj4 = allocate_memory_size 1024
0AC8: $myvarghj5 = allocate_memory_size 1024
0AC8: $myvarghj6 = allocate_memory_size 1024
0AC8: $myvarghj7 = allocate_memory_size 1024
0AC8: $myvarghj8 = allocate_memory_size 1024
0AC8: $myvarghj9 = allocate_memory_size 1024
0AC8: $myvarghj10 = allocate_memory_size 1024
0AC8: $myvarghj11 = allocate_memory_size 1024
0AC8: $myvarghjk1 = allocate_memory_size 1024
0AC8: $myvarghjk2 = allocate_memory_size 1024
0AC8: $myvarghjk3 = allocate_memory_size 1024
0AC8: $myvarghjk4 = allocate_memory_size 1024
0AF0: 9@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
0AF0: 10@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
0AF0: 11@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
0AF0: 12@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
0AF0: 13@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
0AF0: 14@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
0AF0: 16@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
0AF0: 17@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
0AF0: 18@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
0AF0: 19@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
0AF0: 20@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
if
9@ == 1
then
    0AD3: $myvarghj1 = format "{00ff00}SCRIPT - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj1 = format "{ff0000}SCRIPT - OFF" // Format text ' Dialog caption '
end
if
10@ == 1
then
    0AD3: $myvarghj2 = format "{00ff00}Text in chat input - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj2 = format "{ff0000}Text in chat input - OFF" // Format text ' Dialog caption '
end
if
11@ == 1
then
    0AD3: $myvarghj3 = format "{00ff00}Text in dialog input - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj3 = format "{ff0000}Text in dialog input - OFF" // Format text ' Dialog caption '
end
if
12@ == 1
then
    0AD3: $myvarghj4 = format "{00ff00}Money bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj4 = format "{ff0000}Money bar - OFF" // Format text ' Dialog caption '
end
if
13@ == 1
then
    0AD3: $myvarghj5 = format "{00ff00}Wanted stats - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj5 = format "{ff0000}Wanted stats - OFF" // Format text ' Dialog caption '
end
if
14@ == 1
then
    0AD3: $myvarghj6 = format "{00ff00}HP bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj6 = format "{ff0000}HP bar - OFF" // Format text ' Dialog caption '
end
if
18@ == 1
then
    0AD3: $myvarghj9 = format "{00ff00}Armour bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj9 = format "{ff0000}Armour bar - OFF" // Format text ' Dialog caption '
end
if
16@ == 1
then
    0AD3: $myvarghj7 = format "{00ff00}Vehicle lights - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj7 = format "{ff0000}Vehicle lights - OFF" // Format text ' Dialog caption '
end
if
17@ == 1
then
    0AD3: $myvarghj8 = format "{00ff00}Crosshair coloring - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj8 = format "{ff0000}Crosshair coloring - OFF" // Format text ' Dialog caption '
end
if
19@ == 1
then
    0AD3: $myvarghj10 = format "{00ff00}OTHER - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj10 = format "{ff0000}OTHER - OFF" // Format text ' Dialog caption '
end
if
20@ == 1
then
    0AD3: $myvarghj11 = format "{00ff00}Vehicle coloring - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj11 = format "{ff0000}Vehicle coloring - OFF" // Format text ' Dialog caption '
end
0AD3: $myvarghjk1 = format "{FFA500}Rainbow remote" // Format text ' Dialog caption '
0AD3: $myvarghjk2 = format "%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c" $myvarghj1 0xA $myvarghj2 0xA $myvarghj3 0xA $myvarghj4 0xA $myvarghj5 0xA $myvarghj6 0xA $myvarghj9 0xA $myvarghj7 0xA $myvarghj8 0xA $myvarghj10 0xA $myvarghj11 0x0
0AD3: $myvarghjk3 = format "OK" // Format text ' Okay '
0AD3: $myvarghjk4 = format "Close" // Format text ' Close ' 
0AB1: @ShowDialog 6 id 1005 caption $myvarghjk1 text $myvarghjk2 button_1 $myvarghjk3 button_2 $myvarghjk4 style 4
wait 300 
end

if
0AB1: @isDialogResponded 0 _Returned: ID $myvargh0 Type $myvargh1 ListboxItem $myvargh2 Button $myvargh3 Text $myvargh4 InputText $myvargh5 Caption $myvargh6 LeftButtonText $myvargh7 RightButtonText $myvargh8
then
    if
    $myvargh0 == 1005
    then
        if
        $myvargh3 == 0 // OK button
        then 
            if
            $myvargh2 == 0
            then   
                0AF0: 9@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                if
                9@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 1
            then   
                0AF0: 10@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                if
                10@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 2
            then   
                0AF0: 11@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                if
                11@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 3
            then   
                0AF0: 12@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                if
                12@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 4
            then   
                0AF0: 13@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                if
                13@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 5
            then   
                0AF0: 14@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                if
                14@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 6
            then   
                0AF0: 18@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                if
                18@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 7
            then   
                0AF0: 16@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                if
                16@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 8
            then   
                0AF0: 17@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                if
                17@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 9
            then   
                0AF0: 19@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                if
                19@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 10
            then   
                0AF0: 20@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                if
                20@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                end
                $myvarghfgdfg = 1
            end
        end
    end
end

if and
0039:   9@ == 1 // onoff
0039:   20@ == 1 // vehiclecoloring
then
    if
    0449:   actor $PLAYER_ACTOR in_a_car
    then
        03C0: 5@ = actor $PLAYER_ACTOR car
        0209: 3@ = random_int_in_ranges 0 255
        0209: 4@ = random_int_in_ranges 0 255
        0229: set_car 5@ primary_color_to 3@ secondary_color_to 4@ 
    end
end   
    
END // WHILE TRUE

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
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@

:ShowDialog
{
    0.3.7 - R1
    0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
}
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6B9C0 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0

:isDialogResponded
{
    0.3.7 - R1
    0AB1: @isDialogResponded 0 _Returned: ID 0@ Type 1@ ListboxItem 2@ Button 3@ Text 4@ InputText 5@ Caption 6@ LeftButtonText 7@ RightButtonText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0B8 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 29@ == TRUE // DIALOG OPEN
    THEN
      
        0A8E: 28@ = 30@ + 0x30 // DIALOG_ID_OFFSET
        0A8D: 28@ = readMem 28@ sz 4 vp 0
      
        0A8E: 27@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
        0A8D: 27@ = readMem 27@ sz 4 vp 0
        IF OR
        27@ == 2 // DIALOG_STYLE_LIST
        27@ == 4 // DIALOG_STYLE_TABLIST
        27@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
        THEN
            0A8E: 26@ = 30@ + 0x20 // DIALOG_WITH_LIST_OFFSET             
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x84850 // DIALOG_GET_LIST_ITEM_OFFSET
            0AA8: call_function_method 25@ struct 26@ num_params 1 pop 0 -1 _Returned: ListboxItem 24@
        ELSE 24@ = -1
        END
      
        IF OR
        27@ == 0 // DIALOG_STYLE_MSGBOX
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 14@ = 30@ + 0x34 // DIALOG_TEXT_OFFSET
            0A8D: 14@ = readMem 14@ sz 4 vp 0
        ELSE 14@ = 0
        END
      
        IF OR
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 23@ = 30@ + 0x24 // DIALOG_EDIT_BOX_OFFSET             
            0A8D: 23@ = readMem 23@ sz 4 vp 0
            0A8E: 22@ = 31@ + 0x81030 // DIALOG_GET_EDIT_BOX_TEXT_OFFSET
            0AA8: call_function_method 22@ struct 23@ num_params 0 pop 0 _Returned: InputText 21@
        ELSE 21@ = 0
        END
      
        0A8E: 20@ = 30@ + 0x40 // DIALOG_CAPTION_OFFSET
      
        0A8E: 19@ = 30@ + 0x1C // DIALOG_SECOND_POINTER_OFFSET             
        0A8D: 19@ = readMem 19@ sz 4 vp 0
      
        0A8E: 18@ = 19@ + 0x4AD // DIALOG_LEFT_BUTTON_TEXT_OFFSET
        0A8D: 16@ = readMem 18@ sz 1 vp 0
        IF NOT 16@ > 0
        THEN 18@ = 0
        END
      
        0A8E: 17@ = 19@ + 0x1615 // DIALOG_RIGHT_BUTTON_TEXT_OFFSET
        0A8D: 15@ = readMem 17@ sz 1 vp 0
        IF NOT 15@ > 0
        THEN 17@ = 0
        END
      
        0A8E: 13@ = 19@ + 0x466 // DIALOG_LEFT_BUTTON_CLICKED_OFFSET
        0A8D: 13@ = readMem 13@ sz 1 vp 0
      
        0A8E: 12@ = 19@ + 0x15CE // DIALOG_RIGHT_BUTTON_CLICKED_OFFSET
        0A8D: 12@ = readMem 12@ sz 1 vp 0
        IF OR
        0AB0: 27 // ESC
        12@ == 1
        THEN 11@ = 1
        ELSE
            IF OR
            0AB0: 13 // ENTER
            13@ == 1
            THEN  11@ = 0
            ELSE 11@ = -1 // RESET_CLICKED_BUTTONS
            END
        END
    ELSE
        11@ = -1 // RESET_CLICKED_BUTTONS     
    END
END     
0AB2: 9 28@ 27@ 24@ 11@ 14@ 21@ 20@ 18@ 17@

: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
PHP:
{$CLEO .cs}     

0000:

wait 8500
0AB1: @get_samp_version_id 0 _returned: id 0@   
$myvarghfgdfg = 0

WHILE TRUE
    WAIT 0

if
//0AB0:   key_pressed 101
0ADC:   test_cheat "rbor"
then
$myvarghfgdfg = 1
end

if
$myvarghfgdfg == 1
then
$myvarghfgdfg = 0
0AC9: free_allocated_memory $myvarghj1
0AC9: free_allocated_memory $myvarghj2
0AC9: free_allocated_memory $myvarghj3
0AC9: free_allocated_memory $myvarghj4
0AC9: free_allocated_memory $myvarghj5
0AC9: free_allocated_memory $myvarghj6
0AC9: free_allocated_memory $myvarghj7
0AC9: free_allocated_memory $myvarghj8
0AC9: free_allocated_memory $myvarghj9
0AC9: free_allocated_memory $myvarghj10
0AC9: free_allocated_memory $myvarghj11
0AC9: free_allocated_memory $myvarghjk1
0AC9: free_allocated_memory $myvarghjk2
0AC9: free_allocated_memory $myvarghjk3
0AC9: free_allocated_memory $myvarghjk4
0AC9: free_allocated_memory 9@
0AC9: free_allocated_memory 10@
0AC9: free_allocated_memory 11@
0AC9: free_allocated_memory 12@
0AC9: free_allocated_memory 13@
0AC9: free_allocated_memory 14@
0AC9: free_allocated_memory 16@
0AC9: free_allocated_memory 17@
0AC8: $myvarghj1 = allocate_memory_size 1024
0AC8: $myvarghj2 = allocate_memory_size 1024
0AC8: $myvarghj3 = allocate_memory_size 1024
0AC8: $myvarghj4 = allocate_memory_size 1024
0AC8: $myvarghj5 = allocate_memory_size 1024
0AC8: $myvarghj6 = allocate_memory_size 1024
0AC8: $myvarghj7 = allocate_memory_size 1024
0AC8: $myvarghj8 = allocate_memory_size 1024
0AC8: $myvarghj9 = allocate_memory_size 1024
0AC8: $myvarghj10 = allocate_memory_size 1024
0AC8: $myvarghj11 = allocate_memory_size 1024
0AC8: $myvarghjk1 = allocate_memory_size 1024
0AC8: $myvarghjk2 = allocate_memory_size 1024
0AC8: $myvarghjk3 = allocate_memory_size 1024
0AC8: $myvarghjk4 = allocate_memory_size 1024
0AF0: 9@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
0AF0: 10@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
0AF0: 11@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
0AF0: 12@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
0AF0: 13@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
0AF0: 14@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
0AF0: 16@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
0AF0: 17@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
0AF0: 18@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
0AF0: 19@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
0AF0: 20@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
if
9@ == 1
then
    0AD3: $myvarghj1 = format "{00ff00}SCRIPT - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj1 = format "{ff0000}SCRIPT - OFF" // Format text ' Dialog caption '
end
if
10@ == 1
then
    0AD3: $myvarghj2 = format "{00ff00}Text in chat input - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj2 = format "{ff0000}Text in chat input - OFF" // Format text ' Dialog caption '
end
if
11@ == 1
then
    0AD3: $myvarghj3 = format "{00ff00}Text in dialog input - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj3 = format "{ff0000}Text in dialog input - OFF" // Format text ' Dialog caption '
end
if
12@ == 1
then
    0AD3: $myvarghj4 = format "{00ff00}Money bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj4 = format "{ff0000}Money bar - OFF" // Format text ' Dialog caption '
end
if
13@ == 1
then
    0AD3: $myvarghj5 = format "{00ff00}Wanted stats - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj5 = format "{ff0000}Wanted stats - OFF" // Format text ' Dialog caption '
end
if
14@ == 1
then
    0AD3: $myvarghj6 = format "{00ff00}HP bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj6 = format "{ff0000}HP bar - OFF" // Format text ' Dialog caption '
end
if
18@ == 1
then
    0AD3: $myvarghj9 = format "{00ff00}Armour bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj9 = format "{ff0000}Armour bar - OFF" // Format text ' Dialog caption '
end
if
16@ == 1
then
    0AD3: $myvarghj7 = format "{00ff00}Vehicle lights - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj7 = format "{ff0000}Vehicle lights - OFF" // Format text ' Dialog caption '
end
if
17@ == 1
then
    0AD3: $myvarghj8 = format "{00ff00}Crosshair coloring - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj8 = format "{ff0000}Crosshair coloring - OFF" // Format text ' Dialog caption '
end
if
19@ == 1
then
    0AD3: $myvarghj10 = format "{00ff00}OTHER - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj10 = format "{ff0000}OTHER - OFF" // Format text ' Dialog caption '
end
if
20@ == 1
then
    0AD3: $myvarghj11 = format "{00ff00}Vehicle coloring - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj11 = format "{ff0000}Vehicle coloring - OFF" // Format text ' Dialog caption '
end
0AD3: $myvarghjk1 = format "{FFA500}Rainbow remote" // Format text ' Dialog caption '
0AD3: $myvarghjk2 = format "%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c" $myvarghj1 0xA $myvarghj2 0xA $myvarghj3 0xA $myvarghj4 0xA $myvarghj5 0xA $myvarghj6 0xA $myvarghj9 0xA $myvarghj7 0xA $myvarghj8 0xA $myvarghj10 0xA $myvarghj11 0x0
0AD3: $myvarghjk3 = format "OK" // Format text ' Okay '
0AD3: $myvarghjk4 = format "Close" // Format text ' Close ' 
0AB1: @ShowDialog 6 id 1005 caption $myvarghjk1 text $myvarghjk2 button_1 $myvarghjk3 button_2 $myvarghjk4 style 4
wait 300 
end

if
0AB1: @isDialogResponded 0 _Returned: ID $myvargh0 Type $myvargh1 ListboxItem $myvargh2 Button $myvargh3 Text $myvargh4 InputText $myvargh5 Caption $myvargh6 LeftButtonText $myvargh7 RightButtonText $myvargh8
then
    if
    $myvargh0 == 1005
    then
        if
        $myvargh3 == 0 // OK button
        then 
            if
            $myvargh2 == 0
            then   
                0AF0: 9@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                if
                9@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 1
            then   
                0AF0: 10@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                if
                10@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 2
            then   
                0AF0: 11@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                if
                11@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 3
            then   
                0AF0: 12@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                if
                12@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 4
            then   
                0AF0: 13@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                if
                13@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 5
            then   
                0AF0: 14@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                if
                14@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 6
            then   
                0AF0: 18@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                if
                18@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 7
            then   
                0AF0: 16@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                if
                16@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 8
            then   
                0AF0: 17@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                if
                17@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 9
            then   
                0AF0: 19@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                if
                19@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 10
            then   
                0AF0: 20@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                if
                20@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                end
                $myvarghfgdfg = 1
            end
        end
    end
end

if and
0039:   9@ == 1 // onoff
0039:   20@ == 1 // vehiclecoloring
then
    if
    0449:   actor $PLAYER_ACTOR in_a_car
    then
        03C0: 5@ = actor $PLAYER_ACTOR car
        0209: 3@ = random_int_in_ranges 0 255
        0209: 4@ = random_int_in_ranges 0 255
        0229: set_car 5@ primary_color_to 3@ secondary_color_to 4@ 
    end
end   
    
END // WHILE TRUE

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
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@

:ShowDialog
{
    0.3.7 - R4
    0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
}
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6FFE0 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0

:isDialogResponded
{
    0.3.7 - R4
    0AB1: @isDialogResponded 0 _Returned: ID 0@ Type 1@ ListboxItem 2@ Button 3@ Text 4@ InputText 5@ Caption 6@ LeftButtonText 7@ RightButtonText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E9C8 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 29@ == TRUE // DIALOG OPEN
    THEN

        0A8E: 28@ = 30@ + 0x30 // DIALOG_ID_OFFSET
        0A8D: 28@ = readMem 28@ sz 4 vp 0

        0A8E: 27@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
        0A8D: 27@ = readMem 27@ sz 4 vp 0
        IF OR
        27@ == 2 // DIALOG_STYLE_LIST
        27@ == 4 // DIALOG_STYLE_TABLIST
        27@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
        THEN
            0A8E: 26@ = 30@ + 0x20 // DIALOG_WITH_LIST_OFFSET       
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x88EA0 // DIALOG_GET_LIST_ITEM_OFFSET
            0AA8: call_function_method 25@ struct 26@ num_params 1 pop 0 -1 _Returned: ListboxItem 24@
        ELSE 24@ = -1
        END

        IF OR
        27@ == 0 // DIALOG_STYLE_MSGBOX
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 14@ = 30@ + 0x34 // DIALOG_TEXT_OFFSET
            0A8D: 14@ = readMem 14@ sz 4 vp 0
        ELSE 14@ = 0
        END

        IF OR
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 23@ = 30@ + 0x24 // DIALOG_EDIT_BOX_OFFSET       
            0A8D: 23@ = readMem 23@ sz 4 vp 0
            0A8E: 22@ = 31@ + 0x85680 // DIALOG_GET_EDIT_BOX_TEXT_OFFSET
            0AA8: call_function_method 22@ struct 23@ num_params 0 pop 0 _Returned: InputText 21@
        ELSE 21@ = 0
        END

        0A8E: 20@ = 30@ + 0x40 // DIALOG_CAPTION_OFFSET

        0A8E: 19@ = 30@ + 0x20 // DIALOG_FIRST_POINTER_OFFSET       
        0A8D: 19@ = readMem 19@ sz 4 vp 0

        0A8E: 18@ = 19@ + 0x1AD // DIALOG_LEFT_BUTTON_TEXT_OFFSET
        0A8D: 16@ = readMem 18@ sz 1 vp 0
        IF NOT 16@ > 0
        THEN 18@ = 0
        END

        0A8E: 10@ = 19@ + 0x20
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        10@ += 0x50
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        0A8E: 17@ = 10@ + 0x4D // DIALOG_RIGHT_BUTTON_TEXT_OFFSET
        0A8D: 15@ = readMem 17@ sz 1 vp 0
        IF NOT 15@ > 0
        THEN 17@ = 0
        END

        0A8E: 13@ = 19@ + 0x166 // DIALOG_LEFT_BUTTON_CLICKED_OFFSET
        0A8D: 13@ = readMem 13@ sz 1 vp 0

        0A8E: 12@ = 10@ + 0x6 // DIALOG_RIGHT_BUTTON_CLICKED_OFFSET
        0A8D: 12@ = readMem 12@ sz 1 vp 0
        IF OR
        0AB0: 27 // ESC
        12@ == 1
        THEN 11@ = 0 // RIGHT_BUTTON_WAS_CLICKED
        ELSE
            IF OR
            0AB0: 13 // ENTER
            13@ == 1
            THEN  11@ = 1 // LEFT_BUTTON_WAS_CLICKED
            ELSE 11@ = -1 // RESET_CLICKED_BUTTONS
            END
        END
    ELSE
        11@ = -1 // RESET_CLICKED_BUTTONS
    END
END
0AB2: 9 28@ 27@ 24@ 11@ 14@ 21@ 20@ 18@ 17@

: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
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
I tried to rework my code what worked on me on 0.3.7 R1 worked on 0.3.7 R4, but there I only see this
but it should look like this
PHP:
{$CLEO .cs}

0000:

wait 8500
0AB1: @get_samp_version_id 0 _returned: id 0@  
$myvarghfgdfg = 0

WHILE TRUE
    WAIT 0

if
//0AB0:   key_pressed 101
0ADC:   test_cheat "rbor"
then
$myvarghfgdfg = 1
end

if
$myvarghfgdfg == 1
then
$myvarghfgdfg = 0
0AC9: free_allocated_memory $myvarghj1
0AC9: free_allocated_memory $myvarghj2
0AC9: free_allocated_memory $myvarghj3
0AC9: free_allocated_memory $myvarghj4
0AC9: free_allocated_memory $myvarghj5
0AC9: free_allocated_memory $myvarghj6
0AC9: free_allocated_memory $myvarghj7
0AC9: free_allocated_memory $myvarghj8
0AC9: free_allocated_memory $myvarghj9
0AC9: free_allocated_memory $myvarghj10
0AC9: free_allocated_memory $myvarghj11
0AC9: free_allocated_memory $myvarghjk1
0AC9: free_allocated_memory $myvarghjk2
0AC9: free_allocated_memory $myvarghjk3
0AC9: free_allocated_memory $myvarghjk4
0AC9: free_allocated_memory 9@
0AC9: free_allocated_memory 10@
0AC9: free_allocated_memory 11@
0AC9: free_allocated_memory 12@
0AC9: free_allocated_memory 13@
0AC9: free_allocated_memory 14@
0AC9: free_allocated_memory 16@
0AC9: free_allocated_memory 17@
0AC8: $myvarghj1 = allocate_memory_size 1024
0AC8: $myvarghj2 = allocate_memory_size 1024
0AC8: $myvarghj3 = allocate_memory_size 1024
0AC8: $myvarghj4 = allocate_memory_size 1024
0AC8: $myvarghj5 = allocate_memory_size 1024
0AC8: $myvarghj6 = allocate_memory_size 1024
0AC8: $myvarghj7 = allocate_memory_size 1024
0AC8: $myvarghj8 = allocate_memory_size 1024
0AC8: $myvarghj9 = allocate_memory_size 1024
0AC8: $myvarghj10 = allocate_memory_size 1024
0AC8: $myvarghj11 = allocate_memory_size 1024
0AC8: $myvarghjk1 = allocate_memory_size 1024
0AC8: $myvarghjk2 = allocate_memory_size 1024
0AC8: $myvarghjk3 = allocate_memory_size 1024
0AC8: $myvarghjk4 = allocate_memory_size 1024
0AF0: 9@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
0AF0: 10@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
0AF0: 11@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
0AF0: 12@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
0AF0: 13@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
0AF0: 14@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
0AF0: 16@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
0AF0: 17@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
0AF0: 18@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
0AF0: 19@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
0AF0: 20@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
if
9@ == 1
then
    0AD3: $myvarghj1 = format "{00ff00}SCRIPT - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj1 = format "{ff0000}SCRIPT - OFF" // Format text ' Dialog caption '
end
if
10@ == 1
then
    0AD3: $myvarghj2 = format "{00ff00}Text in chat input - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj2 = format "{ff0000}Text in chat input - OFF" // Format text ' Dialog caption '
end
if
11@ == 1
then
    0AD3: $myvarghj3 = format "{00ff00}Text in dialog input - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj3 = format "{ff0000}Text in dialog input - OFF" // Format text ' Dialog caption '
end
if
12@ == 1
then
    0AD3: $myvarghj4 = format "{00ff00}Money bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj4 = format "{ff0000}Money bar - OFF" // Format text ' Dialog caption '
end
if
13@ == 1
then
    0AD3: $myvarghj5 = format "{00ff00}Wanted stats - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj5 = format "{ff0000}Wanted stats - OFF" // Format text ' Dialog caption '
end
if
14@ == 1
then
    0AD3: $myvarghj6 = format "{00ff00}HP bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj6 = format "{ff0000}HP bar - OFF" // Format text ' Dialog caption '
end
if
18@ == 1
then
    0AD3: $myvarghj9 = format "{00ff00}Armour bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj9 = format "{ff0000}Armour bar - OFF" // Format text ' Dialog caption '
end
if
16@ == 1
then
    0AD3: $myvarghj7 = format "{00ff00}Vehicle lights - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj7 = format "{ff0000}Vehicle lights - OFF" // Format text ' Dialog caption '
end
if
17@ == 1
then
    0AD3: $myvarghj8 = format "{00ff00}Crosshair coloring - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj8 = format "{ff0000}Crosshair coloring - OFF" // Format text ' Dialog caption '
end
if
19@ == 1
then
    0AD3: $myvarghj10 = format "{00ff00}OTHER - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj10 = format "{ff0000}OTHER - OFF" // Format text ' Dialog caption '
end
if
20@ == 1
then
    0AD3: $myvarghj11 = format "{00ff00}Vehicle coloring - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj11 = format "{ff0000}Vehicle coloring - OFF" // Format text ' Dialog caption '
end
0AD3: $myvarghjk1 = format "{FFA500}Rainbow remote" // Format text ' Dialog caption '
0AD3: $myvarghjk2 = format "%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c" $myvarghj1 0xA $myvarghj2 0xA $myvarghj3 0xA $myvarghj4 0xA $myvarghj5 0xA $myvarghj6 0xA $myvarghj9 0xA $myvarghj7 0xA $myvarghj8 0xA $myvarghj10 0xA $myvarghj11 0x0
0AD3: $myvarghjk3 = format "OK" // Format text ' Okay '
0AD3: $myvarghjk4 = format "Close" // Format text ' Close '
0AB1: @ShowDialog 6 id 1005 caption $myvarghjk1 text $myvarghjk2 button_1 $myvarghjk3 button_2 $myvarghjk4 style 4
wait 300
end

if
0AB1: @isDialogResponded 0 _Returned: ID $myvargh0 Type $myvargh1 ListboxItem $myvargh2 Button $myvargh3 Text $myvargh4 InputText $myvargh5 Caption $myvargh6 LeftButtonText $myvargh7 RightButtonText $myvargh8
then
    if
    $myvargh0 == 1005
    then
        if
        $myvargh3 == 0 // OK button
        then
            if
            $myvargh2 == 0
            then  
                0AF0: 9@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                if
                9@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 1
            then  
                0AF0: 10@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                if
                10@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 2
            then  
                0AF0: 11@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                if
                11@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 3
            then  
                0AF0: 12@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                if
                12@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 4
            then  
                0AF0: 13@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                if
                13@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 5
            then  
                0AF0: 14@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                if
                14@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 6
            then  
                0AF0: 18@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                if
                18@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 7
            then  
                0AF0: 16@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                if
                16@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 8
            then  
                0AF0: 17@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                if
                17@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 9
            then  
                0AF0: 19@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                if
                19@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 10
            then  
                0AF0: 20@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                if
                20@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                end
                $myvarghfgdfg = 1
            end
        end
    end
end

if and
0039:   9@ == 1 // onoff
0039:   20@ == 1 // vehiclecoloring
then
    if
    0449:   actor $PLAYER_ACTOR in_a_car
    then
        03C0: 5@ = actor $PLAYER_ACTOR car
        0209: 3@ = random_int_in_ranges 0 255
        0209: 4@ = random_int_in_ranges 0 255
        0229: set_car 5@ primary_color_to 3@ secondary_color_to 4@
    end
end  
   
END // WHILE TRUE

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
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@

:ShowDialog
{
    0.3.7 - R1
    0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
}
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6B9C0 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0

:isDialogResponded
{
    0.3.7 - R1
    0AB1: @isDialogResponded 0 _Returned: ID 0@ Type 1@ ListboxItem 2@ Button 3@ Text 4@ InputText 5@ Caption 6@ LeftButtonText 7@ RightButtonText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0B8 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 29@ == TRUE // DIALOG OPEN
    THEN
     
        0A8E: 28@ = 30@ + 0x30 // DIALOG_ID_OFFSET
        0A8D: 28@ = readMem 28@ sz 4 vp 0
     
        0A8E: 27@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
        0A8D: 27@ = readMem 27@ sz 4 vp 0
        IF OR
        27@ == 2 // DIALOG_STYLE_LIST
        27@ == 4 // DIALOG_STYLE_TABLIST
        27@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
        THEN
            0A8E: 26@ = 30@ + 0x20 // DIALOG_WITH_LIST_OFFSET            
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x84850 // DIALOG_GET_LIST_ITEM_OFFSET
            0AA8: call_function_method 25@ struct 26@ num_params 1 pop 0 -1 _Returned: ListboxItem 24@
        ELSE 24@ = -1
        END
     
        IF OR
        27@ == 0 // DIALOG_STYLE_MSGBOX
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 14@ = 30@ + 0x34 // DIALOG_TEXT_OFFSET
            0A8D: 14@ = readMem 14@ sz 4 vp 0
        ELSE 14@ = 0
        END
     
        IF OR
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 23@ = 30@ + 0x24 // DIALOG_EDIT_BOX_OFFSET            
            0A8D: 23@ = readMem 23@ sz 4 vp 0
            0A8E: 22@ = 31@ + 0x81030 // DIALOG_GET_EDIT_BOX_TEXT_OFFSET
            0AA8: call_function_method 22@ struct 23@ num_params 0 pop 0 _Returned: InputText 21@
        ELSE 21@ = 0
        END
     
        0A8E: 20@ = 30@ + 0x40 // DIALOG_CAPTION_OFFSET
     
        0A8E: 19@ = 30@ + 0x1C // DIALOG_SECOND_POINTER_OFFSET            
        0A8D: 19@ = readMem 19@ sz 4 vp 0
     
        0A8E: 18@ = 19@ + 0x4AD // DIALOG_LEFT_BUTTON_TEXT_OFFSET
        0A8D: 16@ = readMem 18@ sz 1 vp 0
        IF NOT 16@ > 0
        THEN 18@ = 0
        END
     
        0A8E: 17@ = 19@ + 0x1615 // DIALOG_RIGHT_BUTTON_TEXT_OFFSET
        0A8D: 15@ = readMem 17@ sz 1 vp 0
        IF NOT 15@ > 0
        THEN 17@ = 0
        END
     
        0A8E: 13@ = 19@ + 0x466 // DIALOG_LEFT_BUTTON_CLICKED_OFFSET
        0A8D: 13@ = readMem 13@ sz 1 vp 0
     
        0A8E: 12@ = 19@ + 0x15CE // DIALOG_RIGHT_BUTTON_CLICKED_OFFSET
        0A8D: 12@ = readMem 12@ sz 1 vp 0
        IF OR
        0AB0: 27 // ESC
        12@ == 1
        THEN 11@ = 1
        ELSE
            IF OR
            0AB0: 13 // ENTER
            13@ == 1
            THEN  11@ = 0
            ELSE 11@ = -1 // RESET_CLICKED_BUTTONS
            END
        END
    ELSE
        11@ = -1 // RESET_CLICKED_BUTTONS    
    END
END    
0AB2: 9 28@ 27@ 24@ 11@ 14@ 21@ 20@ 18@ 17@

: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
PHP:
{$CLEO .cs}    

0000:

wait 8500
0AB1: @get_samp_version_id 0 _returned: id 0@  
$myvarghfgdfg = 0

WHILE TRUE
    WAIT 0

if
//0AB0:   key_pressed 101
0ADC:   test_cheat "rbor"
then
$myvarghfgdfg = 1
end

if
$myvarghfgdfg == 1
then
$myvarghfgdfg = 0
0AC9: free_allocated_memory $myvarghj1
0AC9: free_allocated_memory $myvarghj2
0AC9: free_allocated_memory $myvarghj3
0AC9: free_allocated_memory $myvarghj4
0AC9: free_allocated_memory $myvarghj5
0AC9: free_allocated_memory $myvarghj6
0AC9: free_allocated_memory $myvarghj7
0AC9: free_allocated_memory $myvarghj8
0AC9: free_allocated_memory $myvarghj9
0AC9: free_allocated_memory $myvarghj10
0AC9: free_allocated_memory $myvarghj11
0AC9: free_allocated_memory $myvarghjk1
0AC9: free_allocated_memory $myvarghjk2
0AC9: free_allocated_memory $myvarghjk3
0AC9: free_allocated_memory $myvarghjk4
0AC9: free_allocated_memory 9@
0AC9: free_allocated_memory 10@
0AC9: free_allocated_memory 11@
0AC9: free_allocated_memory 12@
0AC9: free_allocated_memory 13@
0AC9: free_allocated_memory 14@
0AC9: free_allocated_memory 16@
0AC9: free_allocated_memory 17@
0AC8: $myvarghj1 = allocate_memory_size 1024
0AC8: $myvarghj2 = allocate_memory_size 1024
0AC8: $myvarghj3 = allocate_memory_size 1024
0AC8: $myvarghj4 = allocate_memory_size 1024
0AC8: $myvarghj5 = allocate_memory_size 1024
0AC8: $myvarghj6 = allocate_memory_size 1024
0AC8: $myvarghj7 = allocate_memory_size 1024
0AC8: $myvarghj8 = allocate_memory_size 1024
0AC8: $myvarghj9 = allocate_memory_size 1024
0AC8: $myvarghj10 = allocate_memory_size 1024
0AC8: $myvarghj11 = allocate_memory_size 1024
0AC8: $myvarghjk1 = allocate_memory_size 1024
0AC8: $myvarghjk2 = allocate_memory_size 1024
0AC8: $myvarghjk3 = allocate_memory_size 1024
0AC8: $myvarghjk4 = allocate_memory_size 1024
0AF0: 9@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
0AF0: 10@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
0AF0: 11@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
0AF0: 12@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
0AF0: 13@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
0AF0: 14@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
0AF0: 16@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
0AF0: 17@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
0AF0: 18@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
0AF0: 19@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
0AF0: 20@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
if
9@ == 1
then
    0AD3: $myvarghj1 = format "{00ff00}SCRIPT - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj1 = format "{ff0000}SCRIPT - OFF" // Format text ' Dialog caption '
end
if
10@ == 1
then
    0AD3: $myvarghj2 = format "{00ff00}Text in chat input - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj2 = format "{ff0000}Text in chat input - OFF" // Format text ' Dialog caption '
end
if
11@ == 1
then
    0AD3: $myvarghj3 = format "{00ff00}Text in dialog input - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj3 = format "{ff0000}Text in dialog input - OFF" // Format text ' Dialog caption '
end
if
12@ == 1
then
    0AD3: $myvarghj4 = format "{00ff00}Money bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj4 = format "{ff0000}Money bar - OFF" // Format text ' Dialog caption '
end
if
13@ == 1
then
    0AD3: $myvarghj5 = format "{00ff00}Wanted stats - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj5 = format "{ff0000}Wanted stats - OFF" // Format text ' Dialog caption '
end
if
14@ == 1
then
    0AD3: $myvarghj6 = format "{00ff00}HP bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj6 = format "{ff0000}HP bar - OFF" // Format text ' Dialog caption '
end
if
18@ == 1
then
    0AD3: $myvarghj9 = format "{00ff00}Armour bar - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj9 = format "{ff0000}Armour bar - OFF" // Format text ' Dialog caption '
end
if
16@ == 1
then
    0AD3: $myvarghj7 = format "{00ff00}Vehicle lights - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj7 = format "{ff0000}Vehicle lights - OFF" // Format text ' Dialog caption '
end
if
17@ == 1
then
    0AD3: $myvarghj8 = format "{00ff00}Crosshair coloring - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj8 = format "{ff0000}Crosshair coloring - OFF" // Format text ' Dialog caption '
end
if
19@ == 1
then
    0AD3: $myvarghj10 = format "{00ff00}OTHER - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj10 = format "{ff0000}OTHER - OFF" // Format text ' Dialog caption '
end
if
20@ == 1
then
    0AD3: $myvarghj11 = format "{00ff00}Vehicle coloring - ON" // Format text ' Dialog caption '
else
    0AD3: $myvarghj11 = format "{ff0000}Vehicle coloring - OFF" // Format text ' Dialog caption '
end
0AD3: $myvarghjk1 = format "{FFA500}Rainbow remote" // Format text ' Dialog caption '
0AD3: $myvarghjk2 = format "%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c" $myvarghj1 0xA $myvarghj2 0xA $myvarghj3 0xA $myvarghj4 0xA $myvarghj5 0xA $myvarghj6 0xA $myvarghj9 0xA $myvarghj7 0xA $myvarghj8 0xA $myvarghj10 0xA $myvarghj11 0x0
0AD3: $myvarghjk3 = format "OK" // Format text ' Okay '
0AD3: $myvarghjk4 = format "Close" // Format text ' Close '
0AB1: @ShowDialog 6 id 1005 caption $myvarghjk1 text $myvarghjk2 button_1 $myvarghjk3 button_2 $myvarghjk4 style 4
wait 300
end

if
0AB1: @isDialogResponded 0 _Returned: ID $myvargh0 Type $myvargh1 ListboxItem $myvargh2 Button $myvargh3 Text $myvargh4 InputText $myvargh5 Caption $myvargh6 LeftButtonText $myvargh7 RightButtonText $myvargh8
then
    if
    $myvargh0 == 1005
    then
        if
        $myvargh3 == 0 // OK button
        then
            if
            $myvargh2 == 0
            then  
                0AF0: 9@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                if
                9@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 1
            then  
                0AF0: 10@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                if
                10@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 2
            then  
                0AF0: 11@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                if
                11@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "dialoginput"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 3
            then  
                0AF0: 12@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                if
                12@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "moneybar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 4
            then  
                0AF0: 13@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                if
                13@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "wantedstats"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 5
            then  
                0AF0: 14@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                if
                14@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "hpbar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 6
            then  
                0AF0: 18@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                if
                18@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "armourbar"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 7
            then  
                0AF0: 16@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                if
                16@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclelights"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 8
            then  
                0AF0: 17@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                if
                17@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "crosshaircoloring"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 9
            then  
                0AF0: 19@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                if
                19@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "other"
                end
                $myvarghfgdfg = 1
            end
            if
            $myvargh2 == 10
            then  
                0AF0: 20@ = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                if
                20@ == 0
                then
                0AF1: write_int 1 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                else
                0AF1: write_int 0 to_ini_file "cleo\rainbow.ini" section "SETTINGS" key "vehiclecoloring"
                end
                $myvarghfgdfg = 1
            end
        end
    end
end

if and
0039:   9@ == 1 // onoff
0039:   20@ == 1 // vehiclecoloring
then
    if
    0449:   actor $PLAYER_ACTOR in_a_car
    then
        03C0: 5@ = actor $PLAYER_ACTOR car
        0209: 3@ = random_int_in_ranges 0 255
        0209: 4@ = random_int_in_ranges 0 255
        0229: set_car 5@ primary_color_to 3@ secondary_color_to 4@
    end
end  
   
END // WHILE TRUE

:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
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@

:ShowDialog
{
    0.3.7 - R4
    0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
}
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6FFE0 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0

:isDialogResponded
{
    0.3.7 - R4
    0AB1: @isDialogResponded 0 _Returned: ID 0@ Type 1@ ListboxItem 2@ Button 3@ Text 4@ InputText 5@ Caption 6@ LeftButtonText 7@ RightButtonText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E9C8 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 29@ == TRUE // DIALOG OPEN
    THEN

        0A8E: 28@ = 30@ + 0x30 // DIALOG_ID_OFFSET
        0A8D: 28@ = readMem 28@ sz 4 vp 0

        0A8E: 27@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
        0A8D: 27@ = readMem 27@ sz 4 vp 0
        IF OR
        27@ == 2 // DIALOG_STYLE_LIST
        27@ == 4 // DIALOG_STYLE_TABLIST
        27@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
        THEN
            0A8E: 26@ = 30@ + 0x20 // DIALOG_WITH_LIST_OFFSET      
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x88EA0 // DIALOG_GET_LIST_ITEM_OFFSET
            0AA8: call_function_method 25@ struct 26@ num_params 1 pop 0 -1 _Returned: ListboxItem 24@
        ELSE 24@ = -1
        END

        IF OR
        27@ == 0 // DIALOG_STYLE_MSGBOX
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 14@ = 30@ + 0x34 // DIALOG_TEXT_OFFSET
            0A8D: 14@ = readMem 14@ sz 4 vp 0
        ELSE 14@ = 0
        END

        IF OR
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 23@ = 30@ + 0x24 // DIALOG_EDIT_BOX_OFFSET      
            0A8D: 23@ = readMem 23@ sz 4 vp 0
            0A8E: 22@ = 31@ + 0x85680 // DIALOG_GET_EDIT_BOX_TEXT_OFFSET
            0AA8: call_function_method 22@ struct 23@ num_params 0 pop 0 _Returned: InputText 21@
        ELSE 21@ = 0
        END

        0A8E: 20@ = 30@ + 0x40 // DIALOG_CAPTION_OFFSET

        0A8E: 19@ = 30@ + 0x20 // DIALOG_FIRST_POINTER_OFFSET      
        0A8D: 19@ = readMem 19@ sz 4 vp 0

        0A8E: 18@ = 19@ + 0x1AD // DIALOG_LEFT_BUTTON_TEXT_OFFSET
        0A8D: 16@ = readMem 18@ sz 1 vp 0
        IF NOT 16@ > 0
        THEN 18@ = 0
        END

        0A8E: 10@ = 19@ + 0x20
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        10@ += 0x50
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        0A8E: 17@ = 10@ + 0x4D // DIALOG_RIGHT_BUTTON_TEXT_OFFSET
        0A8D: 15@ = readMem 17@ sz 1 vp 0
        IF NOT 15@ > 0
        THEN 17@ = 0
        END

        0A8E: 13@ = 19@ + 0x166 // DIALOG_LEFT_BUTTON_CLICKED_OFFSET
        0A8D: 13@ = readMem 13@ sz 1 vp 0

        0A8E: 12@ = 10@ + 0x6 // DIALOG_RIGHT_BUTTON_CLICKED_OFFSET
        0A8D: 12@ = readMem 12@ sz 1 vp 0
        IF OR
        0AB0: 27 // ESC
        12@ == 1
        THEN 11@ = 0 // RIGHT_BUTTON_WAS_CLICKED
        ELSE
            IF OR
            0AB0: 13 // ENTER
            13@ == 1
            THEN  11@ = 1 // LEFT_BUTTON_WAS_CLICKED
            ELSE 11@ = -1 // RESET_CLICKED_BUTTONS
            END
        END
    ELSE
        11@ = -1 // RESET_CLICKED_BUTTONS
    END
END
0AB2: 9 28@ 27@ 24@ 11@ 14@ 21@ 20@ 18@ 17@

: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

Try this if you use R4 - v2 samp version
PHP:
:ShowDialog
{
    0.3.7 R4 - v2 
    0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
}
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x70010 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0
 

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
Try this if you use R4 - v2 samp version
PHP:
:ShowDialog
{
    0.3.7 R4 - v2
    0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
}
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x70010 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0
only this ...
Rich (BB code):
Warning(s007): Exception 0xC0000005 at 0x3BE0010
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
only this ...
Rich (BB code):
Warning(s007): Exception 0xC0000005 at 0x3BE0010
Probably you use r4 v1

Here's full snippet for your project
 

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
I tried it and found out that there is a problem in this line but I don't know where, when I gave %d instead of %s so it wrote me in lines at least the letter D, but nothing more, so there is an error somewhere in this line
Code:
0AD3: $myvarghjk2 = format "%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c%s %c" $myvarghj1 0xA $myvarghj2 0xA $myvarghj3 0xA $myvarghj4 0xA $myvarghj5 0xA $myvarghj6 0xA $myvarghj9 0xA $myvarghj7 0xA $myvarghj8 0xA $myvarghj10 0xA $myvarghj11 0x0

I tried to write the script from the very beginning and the error is the same, somewhere in the same place

PHP:
{$CLEO .cs}

0000:

wait 8500
$rboropendialog = 0

WHILE TRUE
    WAIT 0

if
0ADC:   test_cheat "rbor"
then
$rboropendialog = 1
end

if
$rboropendialog == 1
then
    $rboropendialog = 0
    0AF0: $settingsonoff = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
    0AF0: $settingschatinput = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
    0AC8: $settingsonoffvalue = allocate_memory_size 1024
    0AC8: $settingschatinputvalue = allocate_memory_size 1024
    if
        $settingsonoff == 1
    then
        0AD3: $settingsonoffvalue = format "{00ff00}SCRIPT - ON" // Format text ' Dialog caption '
    else
        0AD3: $settingsonoffvalue = format "{ff0000}SCRIPT - OFF" // Format text ' Dialog caption '
    end
    if
        $settingschatinput == 1
    then
        0AD3: $settingschatinputvalue = format "{00ff00}Text in chat input - ON" // Format text ' Dialog caption '
    else
        0AD3: $settingschatinputvalue = format "{ff0000}Text in chat input - OFF" // Format text ' Dialog caption '
    end
    0AC8: $dialogcaption = allocate_memory_size 260   
    0AC8: $dialogtext = allocate_memory_size 260
    0AC8: $dialogbutton1 = allocate_memory_size 260
    0AC8: $dialogbutton2 = allocate_memory_size 260
    0AD3: $dialogcaption = format "{FFA500}Rainbow remote" // Format text ' Dialog caption '
    0AD3: $dialogtext = format "%s %c%s %c" $settingsonoffvalue 0xA $settingschatinputvalue 0xA // 0xA - NEW LINE
    0AD3: $dialogbutton1 = format "OK"
    0AD3: $dialogbutton2 = format "Close"
    0AB1: @ShowDialog 6 id 1000 caption $dialogcaption text $dialogtext button_1 $dialogbutton1 button_2 $dialogbutton2 style 4
    wait 300
end

end

:ShowDialog
{
    0.3.7 - R4
    0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
}
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6FFE0 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0
 

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
if there is no variable in the row, it displays everything
Code:
    0AD3: $dialogtext = format "{00ff00}SCRIPT - ON %c{00ff00}Text in chat input - ON %c{00ff00}Text in dialog input - ON" 0xA // 0xA - NEW LINE
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
if there is no variable in the row, it displays everything
Code:
    0AD3: $dialogtext = format "{00ff00}SCRIPT - ON %c{00ff00}Text in chat input - ON %c{00ff00}Text in dialog input - ON" 0xA // 0xA - NEW LINE
Try allocate biger size..
Try allocate to " 2024 " instead of " 1024 "
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
rainbow.cs (any samp version)
PHP:
{$CLEO .cs}
{$USE bitwise}
{$USE ini}
0000:

//wait 8500
//$rboropendialog = 0

WHILE TRUE
WAIT 0

if 0ADC:   test_cheat "rbor"
then $rboropendialog = 1
end

if $rboropendialog == 1
then    
    0AF0: $settingsonoff = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
    0AF0: $settingschatinput = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                      
    if $settingsonoff == 1
    then
        0AC8: $settingsonoffvalue = allocate_memory_size 260
        0AD3: $settingsonoffvalue = format "{00ff00}SCRIPT - ON"
    else
        0AC8: $settingsonoffvalue = allocate_memory_size 260
        0AD3: $settingsonoffvalue = format "{ff0000}SCRIPT - OFF"
    end
        
    if $settingschatinput == 1
    then
        0AC8: $settingschatinputvalue = allocate_memory_size 260
        0AD3: $settingschatinputvalue = format "{00ff00}Text in chat input - ON"
    else
        0AC8: $settingschatinputvalue = allocate_memory_size 260
        0AD3: $settingschatinputvalue = format "{ff0000}Text in chat input - OFF"
    end
               
    0AC8: $dialogcaption = allocate_memory_size 260
    0AD3: $dialogcaption = format "{FFA500}Rainbow remote" // Format text ' Dialog caption '    
    0AC8: $dialogtext = allocate_memory_size 260
    0AD3: $dialogtext = format "%s %c%s %c" $settingsonoffvalue 0xA $settingschatinputvalue 0xA // 0xA - NEW LINE    
    0AC8: $dialogbutton1 = allocate_memory_size 260
    0AD3: $dialogbutton1 = format "OK"    
    0AC8: $dialogbutton2 = allocate_memory_size 260
    0AD3: $dialogbutton2 = format "Close"
    0AB1: @get_samp_version_id 0 _returned: ID 0@    
    0AB1: @ShowDialog 7 0@ id 1000 caption $dialogcaption text $dialogtext button_1 $dialogbutton1 button_2 $dialogbutton2 style 4
    $rboropendialog = 0
end

END

:ShowDialog                    
// 0AB1: @ShowDialog 7 SampVersionID 0@ id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
IF 0AA2: 10@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 0@ 
    IF NOT 0@ < 0
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN      
            0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6B9C0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN      
            0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6BA70 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
    
        IF 0@ == 3 // 0.3.DL
        THEN      
            0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6FA50 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
    
        IF 0@ == 4 // 0.3.7 R3
        THEN       
            0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6F8C0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
    
        IF 0@ == 5 // 0.3.7 R4
        THEN      
            0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6FFE0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
        
        IF 0@ == 6 // 0.3.7 R4-v2
        THEN      
            0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x70010 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END        
    END
END
0AB2: 0

: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 
END
0AB2: ret 1 30@
rainbow.ini
PHP:
[SETTINGS]
onoff = 0
chatinput = 0
 

Attachments

  • rainbow.cs
    24 KB · Views: 4

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
... or only for 0.3.7 R4-v1
PHP:
{$CLEO .cs}
{$USE bitwise}
{$USE ini}
0000:

//wait 8500
//$rboropendialog = 0

WHILE TRUE
WAIT 0

if 0ADC:   test_cheat "rbor"
then $rboropendialog = 1
end

if $rboropendialog == 1
then    
    0AF0: $settingsonoff = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
    0AF0: $settingschatinput = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                      
    if $settingsonoff == 1
    then
        0AC8: $settingsonoffvalue = allocate_memory_size 260
        0AD3: $settingsonoffvalue = format "{00ff00}SCRIPT - ON"
    else
        0AC8: $settingsonoffvalue = allocate_memory_size 260
        0AD3: $settingsonoffvalue = format "{ff0000}SCRIPT - OFF"
    end
        
    if $settingschatinput == 1
    then
        0AC8: $settingschatinputvalue = allocate_memory_size 260
        0AD3: $settingschatinputvalue = format "{00ff00}Text in chat input - ON"
    else
        0AC8: $settingschatinputvalue = allocate_memory_size 260
        0AD3: $settingschatinputvalue = format "{ff0000}Text in chat input - OFF"
    end
               
    0AC8: $dialogcaption = allocate_memory_size 260
    0AD3: $dialogcaption = format "{FFA500}Rainbow remote" // Format text ' Dialog caption '    
    0AC8: $dialogtext = allocate_memory_size 260
    0AD3: $dialogtext = format "%s %c%s %c" $settingsonoffvalue 0xA $settingschatinputvalue 0xA // 0xA - NEW LINE    
    0AC8: $dialogbutton1 = allocate_memory_size 260
    0AD3: $dialogbutton1 = format "OK"    
    0AC8: $dialogbutton2 = allocate_memory_size 260
    0AD3: $dialogbutton2 = format "Close"  
    0AB1: @ShowDialog 7 5{0.3.7 R4} id 1000 caption $dialogcaption text $dialogtext button_1 $dialogbutton1 button_2 $dialogbutton2 style 4
    $rboropendialog = 0
end

END

:ShowDialog                    
// 0AB1: @ShowDialog 7 SampVersionID 0@ id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
IF 0AA2: 10@ = "samp.dll"
THEN
    IF NOT 0@ < 0
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN      
            0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6B9C0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN      
            0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6BA70 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
    
        IF 0@ == 3 // 0.3.DL
        THEN      
            0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6FA50 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
    
        IF 0@ == 4 // 0.3.7 R3
        THEN       
            0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6F8C0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
    
        IF 0@ == 5 // 0.3.7 R4
        THEN      
            0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6FFE0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
        
        IF 0@ == 6 // 0.3.7 R4-v2
        THEN      
            0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x70010 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END        
    END
END
0AB2: 0
 

Attachments

  • rainbow.zip
    8.1 KB · Views: 2

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
rainbow.cs (any samp version)
PHP:
{$CLEO .cs}
{$USE bitwise}
{$USE ini}
0000:

//wait 8500
//$rboropendialog = 0

WHILE TRUE
WAIT 0

if 0ADC:   test_cheat "rbor"
then $rboropendialog = 1
end

if $rboropendialog == 1
then   
    0AF0: $settingsonoff = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "onoff"
    0AF0: $settingschatinput = get_int_from_ini_file "cleo\rainbow.ini" section "SETTINGS" key "chatinput"
                     
    if $settingsonoff == 1
    then
        0AC8: $settingsonoffvalue = allocate_memory_size 260
        0AD3: $settingsonoffvalue = format "{00ff00}SCRIPT - ON"
    else
        0AC8: $settingsonoffvalue = allocate_memory_size 260
        0AD3: $settingsonoffvalue = format "{ff0000}SCRIPT - OFF"
    end
       
    if $settingschatinput == 1
    then
        0AC8: $settingschatinputvalue = allocate_memory_size 260
        0AD3: $settingschatinputvalue = format "{00ff00}Text in chat input - ON"
    else
        0AC8: $settingschatinputvalue = allocate_memory_size 260
        0AD3: $settingschatinputvalue = format "{ff0000}Text in chat input - OFF"
    end
              
    0AC8: $dialogcaption = allocate_memory_size 260
    0AD3: $dialogcaption = format "{FFA500}Rainbow remote" // Format text ' Dialog caption '   
    0AC8: $dialogtext = allocate_memory_size 260
    0AD3: $dialogtext = format "%s %c%s %c" $settingsonoffvalue 0xA $settingschatinputvalue 0xA // 0xA - NEW LINE   
    0AC8: $dialogbutton1 = allocate_memory_size 260
    0AD3: $dialogbutton1 = format "OK"   
    0AC8: $dialogbutton2 = allocate_memory_size 260
    0AD3: $dialogbutton2 = format "Close"
    0AB1: @get_samp_version_id 0 _returned: ID 0@   
    0AB1: @ShowDialog 7 0@ id 1000 caption $dialogcaption text $dialogtext button_1 $dialogbutton1 button_2 $dialogbutton2 style 4
    $rboropendialog = 0
end

END

:ShowDialog                   
// 0AB1: @ShowDialog 7 SampVersionID 0@ id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
IF 0AA2: 10@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 0@
    IF NOT 0@ < 0
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN     
            0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6B9C0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN     
            0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6BA70 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
   
        IF 0@ == 3 // 0.3.DL
        THEN     
            0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6FA50 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
   
        IF 0@ == 4 // 0.3.7 R3
        THEN      
            0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6F8C0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
   
        IF 0@ == 5 // 0.3.7 R4
        THEN     
            0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6FFE0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
       
        IF 0@ == 6 // 0.3.7 R4-v2
        THEN     
            0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x70010 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END       
    END
END
0AB2: 0

: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
END
0AB2: ret 1 30@
rainbow.ini
PHP:
[SETTINGS]
onoff = 0
chatinput = 0
Great, it works, but I found another problem when I try to compile the file so it throws me away
Rich (BB code):
Unknown directive {$USE bitwise}.
Unknown directive {$USE ini}.
don't know how to solve it?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Great, it works, but I found another problem when I try to compile the file so it throws me away
Rich (BB code):
Unknown directive {$USE bitwise}.
Unknown directive {$USE ini}.
don't know how to solve it?
It's for new version sanny builder.
If you have not latest, but older it not recognise this two lines, so just delete them.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
I could ask you to send the entire sanny builder folder, I would like the settings you have, thank you
I using 3.3 version if remember right and there's link:



Of course make sure you have right settings:
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
Download and install latest Sanny Builder v3.8.0 or delete {$USE bitwise} etc.
 

Attachments

  • SannyBuilder-v3.8.0.zip
    7.3 MB · Views: 0
Top