Help CLEO help

veonzq

New member
Joined
Jan 25, 2020
Messages
2
Reaction score
0
Location
Krakow
Hello, i'm kinda new in this stuff, I'm trying to automatize something on server and i found this CLEO script that automatically types command if player is near some coordinates. So, I'm getting this shitty error in Sanny Builder 4, does anyone know how to fix this? Ty guysScreenshot_1.png
 

veonzq

New member
Joined
Jan 25, 2020
Messages
2
Reaction score
0
Location
Krakow
This is the script
{$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
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,724
Solutions
1
Reaction score
112
Sannybuilder 4 doesn't seem to parse sampfuncs SDK (no matter what you do), I tried it before and it wasn't reading SDK files properly for some reason. Try Sannybuilder 3 and then install the sampfuncs SDK shit, here's version 3.2.2 same as my version and works. That should allow you to compile.

It would of crashed anyway as your command label wasn't terminated with 0B43 opcode or "Samp.cmdret()".
Code:
{$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 << this has no purpose??

: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() // << This is required at end of cmd label to prevent crash.
Also use forum code function to paste code.
 
Top