CLEO Help [SAMP FUNCS] Rejoin to server by CLEO+SAMP_FUNCS

CLEO related
Status
Not open for further replies.

m1zg4rd_PL

Well-known member
Joined
Jul 19, 2013
Messages
222
Reaction score
0
Hello, I'm making script to simple rejoin current server in game by Ctrl+R. I don't want any *.asi files and other mods, because I'm learning using SAMP Functions (version 2.6). Can someone help solve crashing after using my script?

Code:
{$VERSION 3.1.1000}
{$CLEO .cs}

//-------------MAIN---------------
thread 'RELOG' 

:RELOG_11
wait 20 
if and
0AB0:   key_pressed 17 
0AB0:   key_pressed 82 
else_jump @RELOG_11 
wait 10 
jump @RELOG_45 

:RELOG_45
wait 20 
if
0AB0:   key_pressed 82 
else_jump @RELOG_79 
wait 1 
jump @RELOG_45 

:RELOG_79
wait 10 
0B39: samp get_current_server_address 0@ port 1@
0B28: samp disconnect_with_reason 0 //I don't know what 0 code mean (maybe timeout or leaving info?)
0B38: samp connect_to_server 0@ port 1@ 
wait 2000
jump @RELOG_11

After Ctrl+R in game i get some warnings and quick crash after them (crash at address 0x00000000)

Thanks for any help :) :):)
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,492
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
I will only help u to get it working not to improve all the script:

What ID does what?
DISCONNECT_QUIT = 0
DISCONNECT_TIMEOUT = 1
GAMESTATE_NONE = 0
GAMESTATE_WAIT_CONNECT = 1
GAMESTATE_AWAIT_JOIN = 2
GAMESTATE_CONNECTING = 3
GAMESTATE_CONNECTED = 4
GAMESTATE_RESTARTING = 5
GAMESTATE_DISCONNECTED = 6

You need to load SAMPFUNCS. Paste this somewhere after THREAD ".."
if
8AF7: get_samp_base_to 0@
then
0A93: end_custom_thread
end
repeat
wait 400
until 0AFA: is_samp_structures_available

You dont need to use:
0B38: samp connect_to_server 0@ port 1@

Do it like this:

0B28: samp disconnect_with_reason 0 //LEAVE SERVER
wait 2000
0B28: samp disconnect_with_reason 1 //WAIT CONNECT SERVER aka Join server ^^
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,492
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
{$CLEO .cs}
THREAD "RECONNECT"
0662: NOP "www.youtube.com/OpcodeXe"
0662: NOP ""

// LOAD SAMPFUNCS OPCODES
if
8AF7: get_samp_base_to 0@
then
0A93: end_custom_thread
end
repeat
wait 400
until 0AFA: is_samp_structures_available
// LOAD SAMPFUNCS OPCODES

:START
wait 0
if and
0AB0: key_pressed 17
0AB0: key_pressed 82
jf @START
018C: play_sound 1083 at 0.0 0.0 0.0
0ACD: show_text_highpriority "RECONNECTING." time 1337
0B28: samp disconnect_with_reason 0 //LEAVE SERVER
wait 2000
0B28: samp disconnect_with_reason 1 //WAIT CONNECT SERVER aka Join server ^^
jump @START
 
Status
Not open for further replies.
Top