CLEO Help Auto command

CLEO related

r0yal1

Active member
Joined
Jun 20, 2019
Messages
28
Reaction score
3
Hi,
I am looking for a basic CLEO file template that sends a command when I go/stand at a XYZ coordinate. This should work like how auto_getmats.cs works or any other auto job command does. Basically, I just want to swap the command and the XYZ coordinate according to my use. I'm using 0.3.7 R1 with sampfuncs, if it matters. Thanks in advance.

I'm trying to automate a job with a route recorder along with this, so please help.
Thanks in advance
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Hi,
I am looking for a basic CLEO file template that sends a command when I go/stand at a XYZ coordinate. This should work like how auto_getmats.cs works or any other auto job command does. Basically, I just want to swap the command and the XYZ coordinate according to my use. I'm using 0.3.7 R1 with sampfuncs, if it matters. Thanks in advance.

I'm trying to automate a job with a route recorder along with this, so please help.
Thanks in advance
Well explained.
I will do after job
 

blvck0v

Active member
Joined
Feb 23, 2019
Messages
98
Reaction score
51
Location
ugbase.eu
This should help, let us know if anything unclear.

PHP:
{$CLEO}
0000:

wait 8000 // wait for samp to load

0@ = 1 // enabled by default

0B34: "SendCommands" @Enable

while true
wait 0   

    if 0@ == 1
    then
    
        if 00EC: actor $PLAYER_ACTOR sphere 0 near_point 0.0 0.0 radius 3.0 3.0 // change 0.0 0.0 to X - Y of wanted position
        then
            
            0AF9: samp say_msg "/command" // change to wanted cmmd
            wait 5000 // avoid spam
                
        end
        
        // copy paste as many as you need for as many locations
        if 00EC: actor $PLAYER_ACTOR sphere 0 near_point 0.0 0.0 radius 3.0 3.0 // change 0.0 0.0 to X - Y of wanted position
        then
            
            0AF9: samp say_msg "/command" // change to wanted cmmd
            wait 5000 // avoid spam
                
        end
        
        if 00EC: actor $PLAYER_ACTOR sphere 0 near_point 0.0 0.0 radius 3.0 3.0 // change 0.0 0.0 to X - Y of wanted position
        then
            
            0AF9: samp say_msg "/command" // change to wanted cmmd
            wait 5000 // avoid spam
                
        end       
        
    end

end

end_thread

:Enable
if 0@ == 0
then
    0@ = 1
    chatmsg "Now Sending Commands at location."
else
    0@ = 0
    chatmsg "NOT Sending any commands." -1
end
SAMP.CmdRet()
 

Attachments

  • SendCommandsAtLocation.cs
    18.8 KB · Views: 25

r0yal1

Active member
Joined
Jun 20, 2019
Messages
28
Reaction score
3
This should help, let us know if anything unclear.

PHP:
{$CLEO}
0000:

wait 8000 // wait for samp to load

0@ = 1 // enabled by default

0B34: "SendCommands" @Enable

while true
wait 0  

    if 0@ == 1
    then
   
        if 00EC: actor $PLAYER_ACTOR sphere 0 near_point 0.0 0.0 radius 3.0 3.0 // change 0.0 0.0 to X - Y of wanted position
        then
           
            0AF9: samp say_msg "/command" // change to wanted cmmd
            wait 5000 // avoid spam
               
        end
       
        // copy paste as many as you need for as many locations
        if 00EC: actor $PLAYER_ACTOR sphere 0 near_point 0.0 0.0 radius 3.0 3.0 // change 0.0 0.0 to X - Y of wanted position
        then
           
            0AF9: samp say_msg "/command" // change to wanted cmmd
            wait 5000 // avoid spam
               
        end
       
        if 00EC: actor $PLAYER_ACTOR sphere 0 near_point 0.0 0.0 radius 3.0 3.0 // change 0.0 0.0 to X - Y of wanted position
        then
           
            0AF9: samp say_msg "/command" // change to wanted cmmd
            wait 5000 // avoid spam
               
        end      
       
    end

end

end_thread

:Enable
if 0@ == 0
then
    0@ = 1
    chatmsg "Now Sending Commands at location."
else
    0@ = 0
    chatmsg "NOT Sending any commands." -1
end
SAMP.CmdRet()

Hey bro, thanks for making this. Instructions included inside the file are clear. I swapped the XYZ coordinates but it shows error when compiling.

zSsi4MI.png
 

r0yal1

Active member
Joined
Jun 20, 2019
Messages
28
Reaction score
3
I tried removing that line to see if it would compile successfully without it but it showed the same error with "SAMP.Cmdret()" as well.
 

blvck0v

Active member
Joined
Feb 23, 2019
Messages
98
Reaction score
51
Location
ugbase.eu
I tried removing that line to see if it would compile successfully without it but it showed the same error with "SAMP.Cmdret()" as well.
I see, besides Sanny Builder you also need SampFuncs SDK, you can do as Parazitas said or follow intructions in this topic to be able to compile:
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
458
Solutions
9
Reaction score
166
Location
Poland
Any SAMP versions and without SAMPFUNCS.
PHP:
{$CLEO .cs}
{$USE bitwise}
0000:

WHILE TRUE
WAIT 0

IF 0ADC:   test_cheat "CMD"
THEN
    0B12: 30@ = 30@ XOR 1        
    IF 0039:   30@ == 1
    THEN 0AD1: show_formatted_text_highpriority "~w~Script ~g~ON" time 1337
    ELSE 0AD1: show_formatted_text_highpriority "~w~Script ~r~OFF" time 137
    END
END

IF 30@ == 1
THEN
    IF 0256:   player $PLAYER_CHAR defined
    THEN
        0AB1: @get_samp_version_id 0 _returned: ID 0@         
        IF 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1300.0 1278.0 10.82 radius 10.0 10.0
        THEN
            0AC8: 1@ = allocate_memory_size 1024
            0AD3: 1@ = format "/v"
            0AB1: @SEND_CMD 2 SampVersionID 0@ Text 1@
            0AD1: show_formatted_text_highpriority "~y~CMD: %s" time 1337 1@ 
            0AC9: free_allocated_memory 1@                  
        END
        IF 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1315.0 1278.0 10.82 radius 10.0 10.0
        THEN
            0AC8: 1@ = allocate_memory_size 1024
            0AD3: 1@ = format "/s"
            0AB1: @SEND_CMD 2 SampVersionID 0@ Text 1@
            0AD1: show_formatted_text_highpriority "~y~CMD: %s" time 1337 1@ 
            0AC9: free_allocated_memory 1@           
        END
        IF 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1330.0 1278.0 10.82 radius 10.0 10.0
        THEN
            0AC8: 1@ = allocate_memory_size 1024
            0AD3: 1@ = format "/w2"
            0AB1: @SEND_CMD 2 SampVersionID 0@ Text 1@
            0AD1: show_formatted_text_highpriority "~y~CMD: %s" time 1337 1@ 
            0AC9: free_allocated_memory 1@           
        END
        IF 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1345.0 1278.0 10.82 radius 10.0 10.0
        THEN
            0AC8: 1@ = allocate_memory_size 1024
            0AD3: 1@ = format "/goto"
            0AB1: @SEND_CMD 2 SampVersionID 0@ Text 1@
            0AD1: show_formatted_text_highpriority "~y~CMD: %s" time 1337 1@ 
            0AC9: free_allocated_memory 1@           
        END        
        WAIT 3000                   
    END 
END

END
0A93: terminate_this_custom_script
 

Attachments

  • Script.cs
    22.3 KB · Views: 25

r0yal1

Active member
Joined
Jun 20, 2019
Messages
28
Reaction score
3
Any SAMP versions and without SAMPFUNCS.
PHP:
{$CLEO .cs}
{$USE bitwise}
0000:

WHILE TRUE
WAIT 0

IF 0ADC:   test_cheat "CMD"
THEN
    0B12: 30@ = 30@ XOR 1       
    IF 0039:   30@ == 1
    THEN 0AD1: show_formatted_text_highpriority "~w~Script ~g~ON" time 1337
    ELSE 0AD1: show_formatted_text_highpriority "~w~Script ~r~OFF" time 137
    END
END

IF 30@ == 1
THEN
    IF 0256:   player $PLAYER_CHAR defined
    THEN
        0AB1: @get_samp_version_id 0 _returned: ID 0@        
        IF 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1300.0 1278.0 10.82 radius 10.0 10.0
        THEN
            0AC8: 1@ = allocate_memory_size 1024
            0AD3: 1@ = format "/v"
            0AB1: @SEND_CMD 2 SampVersionID 0@ Text 1@
            0AD1: show_formatted_text_highpriority "~y~CMD: %s" time 1337 1@
            0AC9: free_allocated_memory 1@                 
        END
        IF 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1315.0 1278.0 10.82 radius 10.0 10.0
        THEN
            0AC8: 1@ = allocate_memory_size 1024
            0AD3: 1@ = format "/s"
            0AB1: @SEND_CMD 2 SampVersionID 0@ Text 1@
            0AD1: show_formatted_text_highpriority "~y~CMD: %s" time 1337 1@
            0AC9: free_allocated_memory 1@          
        END
        IF 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1330.0 1278.0 10.82 radius 10.0 10.0
        THEN
            0AC8: 1@ = allocate_memory_size 1024
            0AD3: 1@ = format "/w2"
            0AB1: @SEND_CMD 2 SampVersionID 0@ Text 1@
            0AD1: show_formatted_text_highpriority "~y~CMD: %s" time 1337 1@
            0AC9: free_allocated_memory 1@          
        END
        IF 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1345.0 1278.0 10.82 radius 10.0 10.0
        THEN
            0AC8: 1@ = allocate_memory_size 1024
            0AD3: 1@ = format "/goto"
            0AB1: @SEND_CMD 2 SampVersionID 0@ Text 1@
            0AD1: show_formatted_text_highpriority "~y~CMD: %s" time 1337 1@
            0AC9: free_allocated_memory 1@          
        END       
        WAIT 3000                  
    END
END

END
0A93: terminate_this_custom_script

Thanks bro. You're the PRO <3
 
Top