CLEO Help Perform an action only if the server sends a message

CLEO related

Sathiel

Member
Joined
Nov 16, 2021
Messages
14
Reaction score
1
Location
Chile
Its possible make a script read a text from the chat? and continue the script only if get an response after executing a command?
i want to make it loop 3 times after jump to :Noname_333 if the answer is different, u can read the script to make an idea of what i say

i been searching a lot and making proofs and i cant get it works

here part of the code.

Code:
0000: NOP
0006: 0@ = 0
0B34: samp register_client_command "selairetam" to_label @Noname_1185
0001: wait 2000 ms

:Noname_27
0001: wait 0 ms
00D6: if
0039:   0@ == 1
004D: jump_if_false @Noname_291
0001: wait 100 ms
0C8F: samp process_chat_input "(tp command)"
0001: wait 3200 ms
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.08 0.0
0A96: 4@ = actor $PLAYER_ACTOR struct
000A: 4@ += 20
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
000A: 4@ += 48
0A8C: write_memory 4@ size 4 value 1@ virtual_protect 0
000A: 4@ += 4
0A8C: write_memory 4@ size 4 value 2@ virtual_protect 0
000A: 4@ += 4
0A8C: write_memory 4@ size 4 value 3@ virtual_protect 0
0172: 10@ = actor $PLAYER_ACTOR Z_angle
000E: 10@ -= 90
04C4: store_coords_to 3@ 4@ 5@ from_actor $PLAYER_ACTOR with_offset 0.0 0.7 -1.12
0107: 6@ = create_object 2632 at 3@ 4@ 5@
0566: link_object 6@ to_interior 8
0177: set_object 6@ Z_angle_to 10@
0001: wait 2000 ms
:0AF9: samp say_msg "/comprar materiales"
                                                                                 \\ << here is where i want to make the script continue only if
                                                                                       \\the server says "Compraste {DBED15}50 materiales{FFFFFF} de armas por {00CC00}$1250{FFFFFF}.
                                                                                         \\ and repeat 3 times before to jump to @Noname_314 if i didnt get the spected answer

004D: jump_if_false @Noname_314    \\ jump to here only if the server says "Necesitas {00CC00}$1250{FFFFFF} para comprar los {DBED15}50 materiales{FFFFFF} de armas."

:Noname_1185
0B12: 0@ = 0@ XOR 1
00D6: if
0039:   0@ == 1
004D: jump_if_false @Noname_1238
0AF8: samp add_message_to_chat "Selairetam ON" color -1
0002: jump @Noname_1257

:Noname_1238
0AF8: samp add_message_to_chat "Selairetam OFF" color -1

:Noname_333
wait 1000
0AF8: samp add_message_to_chat "{FF2A00}Te quedaste sin dinero.{FFFFFF}" -1
wait 3000
0C8F: samp process_chat_input "(tp command)"
wait 3000
0AF8: samp add_message_to_chat "Vuelve a escribir {DBED15}/Selairetam{FFFFFF} cuando tengas más {00CC00}Dinero{FFFFFF}." -1
wait 1000
0@ = 0  
jump @Noname_1238

:Noname_1257
0B43: samp cmd_ret
 
Top