CLEO Help Add toggle

CLEO related

ciceuc

Member
Joined
Mar 4, 2020
Messages
17
Reaction score
1
Location
Baia Mare
I want to press on the button I set and spam the command without holding itt down.
{$CLEO .cs}

//-------------MAIN---------------
thread 'TESTCLEO'

:TESTCLEO_19
wait 0
if and
key_down 46
SAMP.Available
else_jump @TESTCLEO_19
say "/testststst"
wait 325
jump @TESTCLEO_19
 

blvck0v

Active member
Joined
Feb 23, 2019
Messages
98
Reaction score
51
Location
ugbase.eu
try
PHP:
{$CLEO .cs}
0000:

wait 8500

31@ = 0

while true
wait 0

    if key_pressed 46 // delete
    then
        if 31@ == 0
        then 31@ = 1
        else 31@ = 0
        end           
        wait 1000
    end
    
    if 31@ == 1
    then
        say "/testststst"
        wait 325
    end

end

0A93: terminate_this_custom_script
 

Attachments

  • spam.cs
    17.6 KB · Views: 3

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
PHP:
{$CLEO .cs}

0000: NOP

WAIT 8500

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 0@
    IF 0AB0:   key_pressed 46 {Delete} 
    THEN
        IF 30@ == FALSE
        THEN
            30@ = TRUE
        ELSE
            30@ = FALSE
        END
        WAIT 137 {Anti-spam}
    END
    
    IF 30@ == TRUE
    THEN
        0AC8: 31@ = allocate_memory_size 1024
        0AD3: 31@ = format "/testststst"
        0AB1: @SEND_CMD 2 SampVersionID 0@ Command: 31@
        WAIT 325
    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 
END
0AB2: ret 1 30@

:SEND_CMD
// 0AB1: @SEND_CMD 2 SampVersionID 1 Command: 7@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN      
        0A8E: 3@ = 2@ + 0x65C60
    END
    IF 0@ == 2 // 0.3.7 R2
    THEN      
        0A8E: 3@ = 2@ + 0x65D30
    END

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

    IF 0@ == 4 // 0.3.7 R3
    THEN       
        0A8E: 3@ = 2@ + 0x69190
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN      
        0A8E: 3@ = 2@ + 0x698C0
    END
    
    IF 0@ == 6 // 0.3.7 R4 v2
    THEN      
        0AD1: "~r~send cmd for v2 idk" 1337
    END
    
    0AA5: call 3@ num_param 1 pop 0 1@
END
0AB2: 0
 
Top