CLEO Help Question

CLEO related
Status
Not open for further replies.

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
Question: When the cleo read from chat "Abana avenue" will type "/aaa" ("/aaa" is a cleo which press key ENTER). The problem is the key ENTER will be pressed forever. I want after the cleo will type /aaa, i want to do that just once, not looping. After every "Abana avenue" in chat, send "/aaa" ONLY ONCE. i have this cleo
{$CLEO .cs}

0000:

REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY

WHILE TRUE
WAIT 0

IF
0B61: samp is_local_player_spawned
THEN
0AC8: 0@ = allocate_memory_size 260
0AC8: 1@ = allocate_memory_size 260
0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
IF
0C29: $NOT_USED = stristr string1 0@ string2 "Abana avenue"
THEN
0c8f: samp process_chat_input "/aaa" 4@
END
END

END
what i tried is replacing "while true" with ":re" and add after last end jump @re
i m not so good at cleo but i think :re is a label. i try what i can find and what i have in mind.. but i can t figured it out
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,719
Solutions
1
Reaction score
111
It's probably because doing /aaa has no output chat message so chatline 99 will be equal to "abana avenue" for some time until another message pops up. Cheap way to beat this is to just add a message to chat after you sent the cmd (0AF8) such as blank line so chatline 99 just becomes some blank text
 

Parazitas

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

0000:

REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY

WHILE TRUE
WAIT 0

IF and
30@ == false
0B61: samp is_local_player_spawned
THEN
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
    IF
    0C29: $NOT_USED = stristr string1 0@ string2 "Abana avenue"
    THEN
        0C8F: samp process_chat_input "/aaa" 
        30@ = true // disable code permently
    END
END

END
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
PHP:
{$CLEO .cs}

0000:

REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY

WHILE TRUE
WAIT 0

IF and
30@ == false
0B61: samp is_local_player_spawned
THEN
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
    IF
    0C29: $NOT_USED = stristr string1 0@ string2 "Abana avenue"
    THEN
        0C8F: samp process_chat_input "/aaa"
        30@ = true // disable code permently
    END
END

END
yes but if will disable permanently, next time when i type in chat Abana avenue will type /aaa?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Activate by yourself
PHP:
{$CLEO .cs}

0000:

REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY

WHILE TRUE
WAIT 0

if
0AB0: 113 // F2
then
    if
    30@ == false
    then    
        30@ = true
        0AF8: "ON" -1
    else
        30@ = false
        0AF8: "OFF" -1
    end
end

IF and
30@ == true
0B61: samp is_local_player_spawned
THEN
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
    IF
    0C29: $NOT_USED = stristr string1 0@ string2 "Abana avenue"
    THEN
        0C8F: samp process_chat_input "/aaa" 
        30@ = false // disable code 
    END
END

END
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
It's probably because doing /aaa has no output chat message so chatline 99 will be equal to "abana avenue" for some time until another message pops up. Cheap way to beat this is to just add a message to chat after you sent the cmd (0AF8) such as blank line so chatline 99 just becomes some blank text
it s working, thanks

@Parazitas also thank you man for your time! but i created something and for my way has to be automatic, not with on/off because i am beginner and i am trying not to get complicated more than i really am )
but please send in pm or post here link for
30@ = true // disable code permently
because i have some mods and i want to know about disable cod permanently
 
Status
Not open for further replies.
Top