CLEO Help Passing variable as an argument

CLEO related

dotaczik

Member
Joined
Jan 13, 2020
Messages
6
Reaction score
0
Location
Czech republic
Hello
I have a problem with passing variables to some text op codes such like "0AD1: show_formatted_text_highpriority " , " 0AF9: samp say_msg " , "0AF8: samp add_message_to_chat" ... I tried these posibilities to get my code work. But still I am not succsesful. Instead of number, I am passing, I am getting either 'D' ( "Hello D ") or text without that argument ("Hello") or empty text. I am using SAMP R1 and ofc SAMPFUNCS.

code link
 

dotaczik

Member
Joined
Jan 13, 2020
Messages
6
Reaction score
0
Location
Czech republic
Show your code to see what you're doing wrong
There is link to pastebin with code.

Here is the code:

PHP:
{$CLEO .cs}
 
0000: "TEST"
 
wait 20000          // Waiting to load SAMP
 
:Load
wait 200
if
    SAMP.Available
else_jump @Load
 
// Registering commands
 
0B34: samp register_client_command "activate" to_label @ACTIVATE
 
:loop
wait 0
 
if 31@==1
jf @loop
 
FOR $counter = 0 TO 20
   0AF9: samp say_msg "Hello %d" $counter
   0AD3: 2@v = format "Hello %d" $counter
   0AF9: samp say_msg 2@v
   0AF9: samp say_msg "%s" 2@v
 
   wait 1000
END
 
31@=0
jump @loop
 
:ACTIVATE
 
31@ = 1
0ACD: show_text_highpriority "activated" time 2000
018C: play_sound 1058 at 0.0 0.0 0.0
 
SAMP.CmdRet()
 

Parazitas

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

repeat
wait 0
until 0AFA: is_samp_structures_available

0B34: samp register_client_command "activate" to_label @ACTIVATE

while true
wait 0

FOR 30@ = 0 TO 20

if 31@ == true
then
   0AF9: samp say_msg "Hello %d" 30@
0AC8: 2@ = allocate_memory_size 1024
   0AD3: 2@ = format "Hello %d" 30@
   0AF9: samp say_msg "%s" 2@
wait 1000
31@ = false
end

end

end

:ACTIVATE
31@ = true
0ACD: show_text_highpriority "activated" time 200
018C: play_sound 1058 at 0.0 0.0 0.
SAMP.CmdRet()
 
Top