Jump to content
  • 0

Check Char with same IP


nobukadnezar

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  163
  • Reputation:   7
  • Joined:  01/07/12
  • Last Seen:  

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

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  163
  • Reputation:   7
  • Joined:  01/07/12
  • Last Seen:  

Thank You for response.

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

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  163
  • Reputation:   7
  • Joined:  01/07/12
  • Last Seen:  

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

 

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  163
  • Reputation:   7
  • Joined:  01/07/12
  • Last Seen:  

thank you. It works. I already tried use select yesterday but i select the account which has no char LOL. THanks all

Link to comment
Share on other sites

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.

×
×
  • Create New...