CLEO Help Stop running cleo script

CLEO related
Status
Not open for further replies.

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
If i have a cleo how do i make to stop it after reconnect to the server? It keeps running and i don t want that

i use Reconnect+

//edit: i am noob at cleo, so please an example for noobs
 

davidel

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

THREAD 'ExamenTP'

0662: printstring "By Zin"
0662: printstring "UGBASE.EU"
REPEAT
WAIT 0
UNTIL 0AFA:

0B34: samp register_client_command "+" to_label @EXAMEN @COLLECT
0C6A: $NOT_USED = create_custom_thread_at_label @COLLECT
0C6A: $NOT_USED = create_custom_thread_at_label @EXAMEN2


:EXAMEN2
WHILE TRUE
WAIT 0
IF AND
056D: actor $PLAYER_ACTOR defined
31@ == TRUE
THEN
Actor.PutAt($PLAYER_ACTOR, 1213.4475,-1844.3391,13.1157)
WAIT 500
Actor.PutAt($PLAYER_ACTOR, 1122.3832,-1849.7789,13.0848)
WAIT 500
Actor.PutAt($PLAYER_ACTOR, 1065.7902,-1846.9128,13.0950)
WAIT 500
Actor.PutAt($PLAYER_ACTOR, 1034.6388,-1800.4258,13.3683)
WAIT 500
Actor.PutAt($PLAYER_ACTOR, 899.4989,-1769.2505,13.0813)
WAIT 500
Actor.PutAt($PLAYER_ACTOR, 740.4611,-1758.5903,13.1118)
WAIT 500
Actor.PutAt($PLAYER_ACTOR, 634.0502,-1729.0344,13.5510)
WAIT 500
Actor.PutAt($PLAYER_ACTOR, 489.0085,-1707.8843,11.3474)
WAIT 500
Actor.PutAt($PLAYER_ACTOR, 278.9901,-1684.0265,7.4723)
WAIT 500
Actor.PutAt($PLAYER_ACTOR, 195.9078,-1606.3833,14.1030)
WAIT 500
Actor.PutAt($PLAYER_ACTOR, 165.9999,-1551.3953,11.3986)
wait 100
0A93: end_custom_thread
31@ = FALSE
END
END

:EXAMEN
0B12: 31@ = 31@ XOR 1
SAMP.CmdRet()

:COLLECT
0B12: 0@ = 0@ XOR 1
SAMP.CmdRet()

:COLLECT2
WHILE TRUE
WAIT 0
IF AND
056D: actor $PLAYER_ACTOR defined
0B61: samp is_local_player_spawned
0@ == TRUE
THEN
0af9: samp say_msg "/exam"
wait 5000
repeat
wait 5000
0af9: samp say_msg "/exam"
UNTIL Actor.Dead($PLAYER_ACTOR)
end
end
If I am at the coordinate number 3 and I reconnect, the time I log in is counted and then I teleport to the coordinate number 6.

For example, the time between teleportations should be 1 minute. I reach the coordinate number 3 after which I reconnect and the logging takes 5 minutes. After logging in, teleport me to the coordinate number 8 because those 5 minutes are calculated as teleport, it doesn't matter if I am logged in or not.
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
I am confused about what you are trying to do. So you want to have an interval of 1minute between teleportations?
+ u have one command for 2 labels.. im not sure if thats a mistake or not
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
no, the problem is the script keeps running even if i reconnect
when i reconnect i want to start over, not continue
for example, i login and i teleport until coordinate number 6. if i reconnect with RECONNECT+, the teleport keeps running and teleport me to coordinate number 6. i want when i reconnect to begin with coordinate number 1


for "u have one command for 2 labels. ", i made the command for one label, same result
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
U can either make a command setting a variable to 1. Add that variable to the 'IF AND' statement then at the end of the teleport is set to 0. That way, you can just start it again and again.
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
i need to reconnect without quiting the game.. after reaching the last coordinate to reconnect with different nickname and so on.. but when i reconnect the teleport doesn t start at coordinate number 1, it teleport me to the coordinate where i left the server
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
To keep things simple you can probably use restart cleo snippet might need some modification in terms of activation but it should just restart your CLEO as if you just launched the game.
 

davidel

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

:MAIN
wait 0
if
key_down 113
then
if
056D: actor $PLAYER_ACTOR defined
then
Actor.PutAt($PLAYER_ACTOR, 2096.0225,1906.7823,9.0792)
wait 35000
Actor.PutAt($PLAYER_ACTOR, 1869.2604,2867.2158,10.8359)
wait 35000
Actor.PutAt($PLAYER_ACTOR, 2264.2117,1401.3134,36.4156)
wait 35000
Actor.PutAt($PLAYER_ACTOR, 2572.7808,1109.0385,10.8203)
wait 35000
Actor.PutAt($PLAYER_ACTOR, 2651.6929,798.4370,5.3158)
wait 35000
Actor.PutAt($PLAYER_ACTOR, 1885.9961,910.1632,10.8130)
wait 35000
Actor.PutAt($PLAYER_ACTOR, 1543.0265,676.4124,11.3281)
wait 35000
Actor.PutAt($PLAYER_ACTOR, 1523.0406,997.4906,10.8203)
wait 35000
Actor.PutAt($PLAYER_ACTOR, 1588.0010,1097.9019,10.7295)
wait 35000
Actor.PutAt($PLAYER_ACTOR, 564.7938,893.0850,-43.1592)
wait 35000
end
wait 1000
end
jump @MAIN
i made that and same shit.. keeps running even if i reconnect
how i made when i reconnect to stop the script and when i login and press F2 to run the script? i tested all day
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
What method to use?.. i want when i disconnect to stop all the cleos and after i reconnect to load all of them..i get desperate.
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
To keep things simple you can probably use restart cleo snippet might need some modification in terms of activation but it should just restart your CLEO as if you just launched the game.
not working..it works only for the first time..when I reconnect, it doesn't work anymore. Possible to be the mode in a continuous loop..I don't know
{$CLEO .cs}
0000:

:MAIN
0AB1: @RESTART 1 WITH_KEY 88 // KEY_X
wait 0
if
key_down 113
then
if
056D: actor $PLAYER_ACTOR defined
then
Actor.PutAt($PLAYER_ACTOR, 2096.0225,1906.7823,9.0792)
wait 5000
Actor.PutAt($PLAYER_ACTOR, 1869.2604,2867.2158,10.8359)
wait 5000
Actor.PutAt($PLAYER_ACTOR, 2264.2117,1401.3134,36.4156)
wait 5000
Actor.PutAt($PLAYER_ACTOR, 2572.7808,1109.0385,10.8203)
wait 5000
Actor.PutAt($PLAYER_ACTOR, 2651.6929,798.4370,5.3158)
wait 5000
Actor.PutAt($PLAYER_ACTOR, 1885.9961,910.1632,10.8130)
wait 1000
0af9: samp say_msg "/re"
wait 1000
end
wait 1000
end
jump @MAIN

:RESTART
IF
0AB0: 0@
THEN
REPEAT
WAIT 0
PRINT "~R~RESTART: ~w~TEST.CS" 100
UNTIL 8AB0: 0@
0A92: RESTART "vvv.CS"
004E: STOP THIS CLEO
END
0AB2: 0
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
I mean I did say to edit the snippet didn't I? You merely changed the cleo that it will restart you didn't change the conditions/activation I mean it's pretty simple it's literally 2 opcodes that does the job. Forget that snippet then.
C++:
0A92: create_custom_thread "mod.cs" // starts new cleo.
004E: end_thread // stops current cleo which is needed else you will have 2 of the same thing running.
 
Status
Not open for further replies.
Top