Jump to content
  • 0

Check Char with same IP


Question

Posted

Hello rathena,

 

Could someone fix my script for check char name with same ip?

 

here's my script

 

prontera,156,178,3	script	Check ID	952,{

	//input character name
	input .@Name$;	
	set .@sizeacc, query_sql("SELECT `account_id` FROM `login` WHERE `last_ip` = '"+getcharip(getcharid(3, .@name$))+"'",.@aid);
	
	freeloop(0);
	set .@menu$,"";
	for(set .@i,1; .@i<=.@sizeacc; set .@i,.@i+1) 
		set .@menu$, .@menu$+":"+.@aid[.@i];
	set .@Select,select( .@menu$ ) - 1;
	set .@sizechar, query_sql("SELECT `name` FROM `char` WHERE `account_id` = '+.@aid[.@Select];+'",.@charname);

	//can view the char name list by account selected
	freeloop(0);
	set .@menu$,"";
	for(set .@i,1; .@i<=.@sizechar; set .@i,.@i+1) 
		set .@menu$, .@menu$+":"+.@charname[.@i];
		
end;
}


The script just show blank when i choose the account id menu.

 

Any help will be appreciate. /thx

6 answers to this question

Recommended Posts

Posted (edited)


prontera,156,178,3 script Check ID 952,{

//input character name

input .@Name$;

set .@sizeacc, query_sql("SELECT `account_id` FROM `login` WHERE `last_ip` = '"+getcharip(getcharid(3, .@name$))+"'",.@aid);

// no need freeloop

set .@menu$,"";

for(set .@i,0; .@i<.@sizeacc; set .@i,.@i+1) // index start to 0

set .@menu$, .@menu$+":"+.@aid[.@i];

set .@Select,select( .@menu$ ) - 1;

set .@sizechar, query_sql("SELECT `name` FROM `char` WHERE `account_id` = '"+.@aid[.@Select]+"'",.@charname$);

//can view the char name list by account selected

set .@menu$,"";

for(set .@i,0; .@i<.@sizechar; set .@i,.@i+1)

set .@menu$, .@menu$+":"+.@charname$[.@i];

// you must display the name

close;

}

Edited by Emistry
fixed wrong variable.
  • Upvote 1
Posted

Thank You for response.

But the npc just close the dialog when i choose the account id.

because you didnt add anything to be display after this selection

Posted

Thank You for response.

But the npc just close the dialog when i choose the account id.

because you didnt add anything to be display after this selection

i thought this code

for(set .@i,0; .@i<.@sizechar; set .@i,.@i+1) 
		set .@menu$, .@menu$+":"+.@charname$[.@i];

will automatically display selection menu for char name

 

Posted

This code compile the menu, to display the menu use select

like in this part

	for(set .@i,0; .@i<.@sizeacc; set .@i,.@i+1) // index start to 0
		set .@menu$, .@menu$+":"+.@aid[.@i];
	set .@Select,select( .@menu$ ) - 1;// display the compiled menu

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...