CLEO Help Connection to servers through CLEO

CLEO related
Status
Not open for further replies.

shoval

Active member
Joined
Aug 21, 2013
Messages
28
Reaction score
0
Hello.

I was trying to create the following CLEO:

1) Will get the current server address.
2) Will connect to to this address "LocalHost:7777".
3) Wil connect to the previous server after 10 seconds exactly!

Any help, please?
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
You need to post your code else this is simply a request you need to show us your code where you attempted to make this.
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,389
Solutions
4
Reaction score
893
Location
Israel
zin link said:
You need to post your code else this is simply a request you need to show us your code where you attempted to make this.
Code:
{$CLEO}
0000:

repeat
    wait 40
until SAMP.Available()

0B34: "crashed" @crashed

WHILE TRUE
WAIT 0
END

:crashed
0B39: samp get_current_server_address 0@ port 1@
0B38: samp connect_to_server "127.0.0.1" port 7777
0B38: samp connect_to_server 0@ port 1@
cmdret

Sorry.
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,389
Solutions
4
Reaction score
893
Location
Israel
zin link said:
You need to post your code else this is simply a request you need to show us your code where you attempted to make this.
Code:
{$CLEO .cs}
{$INCLUDE SF}

//-------------MAIN---------------

thread 'test'

0662: NOP "test"

:CRASH1 
wait 0 
if 
    SAMP.Available
else_jump @CRASH1 

:CRASHACTIVE
wait 0 
if
    0AB0: key_pressed 113
else_jump @CRASHACTIVE 

:CRASH
wait 1000
0B39: samp get_current_server_address 20@ port 4@
wait 1000
print "Get Current Server Address" 1000
wait 1000 
0B38: samp connect_to_server 20@ port 4@
print "Reconnect" 1000
jump @CRASHACTIVE

How do I make it connect the same server now?
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
That's just a reconnect cleo he wants it so it connects to a different server than back to the server he was on so instead of "Reconnecting" you would connect to a different server which you should select from a .ini or a command or just put it into the code. Then you would put a wait for 10 seconds and then connect to the server that you stored in those two variables.

Code:
{$CLEO .cs}
{$INCLUDE SF}

//-------------MAIN---------------

thread 'test'

0662: NOP "test"

:CRASH1
wait 0
if
    SAMP.Available
else_jump @CRASH1

:CRASHACTIVE
wait 0
if
    0AB0: key_pressed 113
else_jump @CRASHACTIVE

:CRASH
wait 1000
0B39: samp get_current_server_address 0@ port 1@
wait 1000
print "Get Current Server Address" 1000
wait 1000
0B38: samp connect_to_server 127.0.0.0 port 7777 // DIFFERENT SERVER E.G 127.0.0.0 port 7777
wait 10000 // 10 SECONDS
0B38: samp connect_to_server 0@ port 1@
jump @CRASHACTIVE
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,389
Solutions
4
Reaction score
893
Location
Israel
zin link said:
That's just a reconnect cleo he wants it so it connects to a different server than back to the server he was on so instead of "Reconnecting" you would connect to a different server which you should select from a .ini or a command or just put it into the code. Then you would put a wait for 10 seconds and then connect to the server that you stored in those two variables.

Code:
{$CLEO .cs}
{$INCLUDE SF}

//-------------MAIN---------------

thread 'test'

0662: NOP "test"

:CRASH1
wait 0
if
    SAMP.Available
else_jump @CRASH1

:CRASHACTIVE
wait 0
if
    0AB0: key_pressed 113
else_jump @CRASHACTIVE

:CRASH
wait 1000
0B39: samp get_current_server_address 0@ port 1@
wait 1000
print "Get Current Server Address" 1000
wait 1000
0B38: samp connect_to_server 127.0.0.0 port 7777 // DIFFERENT SERVER E.G 127.0.0.0 port 7777
wait 10000 // 10 SECONDS
0B38: samp connect_to_server 0@ port 1@
jump @CRASHACTIVE
Thank you!
The problem is that it doesn't connect to the previous server.
 
Status
Not open for further replies.
Top