CLEO Help NickChanger with ip and port

CLEO related
Status
Not open for further replies.

DickInferno

Member
Joined
Dec 25, 2013
Messages
8
Reaction score
0
Hey
Igotthiscleofromhere: http://ugbase.eu/releases-6/nickchanger-cs-0-3z/

I want to make it possible to change the ip...
Example: /nick NICKNAME IP PORT

How can I do that?

Script so far(not from me)
Code:
{$CLEO}
 
if
not 29@ = samp.Base()
then
end_thread
else
    while not samp.Available()
    wait 0
    end
end

0B34: samp register_client_command "nick" to_label @nick

while true
    wait 0
end

:nick
wait 0
if 0B35: samp 1@ = get_last_command_params
    then
    0B29: samp set_local_name "%s" 1@
    0ACD: show_text_highpriority "~r~Your nick change" time 1000  
    wait 100
    0ACD: show_text_highpriority "~b~ Wait for disconnect ..." time 1000 1@
    0AC8: 3@ = allocate_memory_size 32
    0AC8: 4@ = allocate_memory_size 4
    0C11: memset destination 3@ value 0 size 32 
    0C11: memset destination 4@ value 0 size 4
    SAMP.GetCurrentServerAddress(3@, 4@) 
    wait 100 
    SAMP.Disconnect(0)
    0ACD: show_text_highpriority "~b~ Restart" time 20
    wait 0
    SAMP.ConnectToServer(3@, 4@)
    0AC9: free_allocated_memory 3@ 
    0AC9: free_allocated_memory 4@   
    0ACD: show_text_highpriority "~w~ Restart ~r~ sucesfully" time 2000 1@
    end      
Samp.CmdRet()

I only need to know how to get multiple params from the command.

Thanks alot(sry for my bad english I am not so gut ;D)

Edit: I am even not able to compile it...woooow whats wrong? "samp.Base()" is an unknown expression...
naild it! now able
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Code:
{$CLEO}
 
if
8AF7: 0@ // IF and SET 
then
end_thread
else
    while not samp.Available()
    wait 0
    end
end

0B34: samp register_client_command "nick" to_label @nick

while true
    wait 0
end

:nick
wait 0
if 
    0B35: samp 1@ = get_last_command_params
then
if 
    0AD4: 2@ = scan_string 1@ format "%s %s %d" 5@v 10@v 4@ 
then
    0B29: samp set_local_name "%s" 5@v //5@v = nickname
    wait 100
    0B28: samp disconnect_with_reason 0
    0B38: samp connect_to_server 10@v port 4@ // 10@v = IP, 4@ = port 
else
    0AF8: "Use /nick <nick> <IP> <port>" 0xFFFFFF
end
end
Samp.CmdRet()

/nick <name> <IP> <port>
 

DickInferno

Member
Joined
Dec 25, 2013
Messages
8
Reaction score
0
Got this Opcode.exe thanks!

Thanks spring. but i want to know and understand what's wrong with my code now:

I typed "/nickip User123 127.0.0.1 5678"

it returns this: http://i.imgur.com/eRKgA80.png

Aaaand this is my code so far:

Code:
if 0B35: samp 1@ = get_last_command_params
    then
    0AC8: 6@ = allocate_memory_size 32
    0AC8: 7@ = allocate_memory_size 4
    0C11: memset destination 6@ value 0 size 32 
    0C11: memset destination 7@ value 0 size 4
    0AD4: 0@ = scan_string 1@ format "%s %s:%d" 5@ 6@ 7@
    0B29: samp set_local_name "%s" 5@
    0ACD: show_text_highpriority "~r~Your nick change" time 1000  
    wait 100
    0ACD: show_text_highpriority "~b~ Wait for disconnect ..." time 1000 1@
    wait 100 
    SAMP.Disconnect(0)
    0ACD: show_text_highpriority "~b~ Restart" time 20
    wait 0
    SAMP.ConnectToServer(6@, 7@) 
    0AC9: free_allocated_memory 6@ 
    0AC9: free_allocated_memory 7@ 
    0ACD: show_text_highpriority "~w~ Restart ~r~ sucesfully" time 2000 1@
    end      
Samp.CmdRet()

EDIT: WAIT!! now i seee.. forgot the ":" between ip and port.. I'll try again 1mom.
EDIT2: ok.. same problem. jumping to springs code and find out whats wrong
 

DickInferno

Member
Joined
Dec 25, 2013
Messages
8
Reaction score
0
ok got it.
Code:
0AD4: 2@ = scan_string 1@ format "%s %s %d" 5@v 10@v 4@

5@v is returning the first char from my entry (Typed "User123" and it returns "U")
and 10@v returns also the first char too(Typed "127.0.0.1" and it returns "1")

Ok. this is a lil confusing..
Can anyone explain?
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Yes, you're doing something wrong. I don't know what you're doing wrong because you didn't post full code.
:imoverit:
 

DickInferno

Member
Joined
Dec 25, 2013
Messages
8
Reaction score
0
:forever_opcode_alone:
sry...

Code:
{$CLEO}
 
if
not 29@ = samp.Base()
then
end_thread
else
    while not samp.Available()
    wait 0
    end
end

0B34: samp register_client_command "nickip" to_label @nick

while true
    wait 0
end

:nick
wait 0
if 0B35: samp 1@ = get_last_command_params
    then
    0AD4: 2@ = scan_string 1@ format "%s %s %d" 5@v 10@v 4@ 
    0B29: samp set_local_name "%s" 5@v
    wait 100 
    SAMP.Disconnect(0)
    0ACD: show_text_highpriority "~b~ Restart" time 20
    wait 0
    SAMP.ConnectToServer(10@v, 4@)
else
    0AF8: "Use /nick <nick> <IP> <port>" 0xFF9999
end      
Samp.CmdRet()
 

DickInferno

Member
Joined
Dec 25, 2013
Messages
8
Reaction score
0
Yes. All files from "SB data" to "C:\Program Files (x86)\Sanny Builder 3\data\sa"

Maybe I get the wrong sf files.. can u give me the right files?
 
Status
Not open for further replies.
Top