I'm trying to create search types, but I come across a problem in the substring when I create a switch I don't get all my search data.
Code base :
Old:
+@Override+public boolean useAdminCommand(String command,Player activeChar)+{+ final NpcHtmlMessage html =newNpcHtmlMessage(0);+ html.setFile("data/html/admin/search.htm");++if(command.equals("admin_search"))+ html.replace("%list%","<center><br><br><br>Set first an key word</center>");+elseif(command.startsWith("admin_search"))+{+StringTokenizer st =newStringTokenizer(command," ");+ st.nextToken();++int page =Integer.valueOf(st.nextToken());+if(st.hasMoreTokens())+{+StringBuilder sb =newStringBuilder(String.valueOf(page));+StringBuilderlist= getList(activeChar, page, command.substring(14+ sb.length()));+ html.replace("%list%",list== null ?"":list.toString());+}+else+ html.replace("%list%","<center><br><br><br>Set first an key word</center>");+}+ activeChar.sendPacket(html);+returntrue;+}+
New :
@Overridepublicvoid useAdminCommand(String command,Player player){
final StringTokenizer st =newStringTokenizer(command," ");
st.nextToken();
final NpcHtmlMessage html =newNpcHtmlMessage(0);
html.setFile("data/html/admin/search.htm");if(command.equals("admin_search"))
html.replace("%list%","<center><br><br><br>Set first an key word</center>");elseif(command.startsWith("admin_search")){if(!st.hasMoreTokens()){
player.sendMessage("Usage: //search <item>");return;}int page =Integer.valueOf(st.nextToken());switch(st.nextToken()){case"item":if(st.hasMoreTokens()){StringBuilder sb =newStringBuilder(String.valueOf(page));StringBuilderlist= getListItem(player, page, command.substring(14+ sb.length()));
html.replace("%list%",list== null ?"":list.toString());}else
html.replace("%list%","<center><br><br><br>Set first an key word</center>");break;}}
player.sendPacket(html);}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
It seems like L2Elite got away from copies. No?
L2Gold.cc has years of experience, and it's publicly known that those files are stable and reliable. Over the years it developed a bad branding, tho.
From what i know, nothing is really like L2gold.cc. The other servers are just copies people try to make. L2gold.cc is with a lot of class balance changes/ scripts/AI.obj, which makes it different.
Question
Williams
I'm trying to create search types, but I come across a problem in the substring when I create a switch I don't get all my search data.
Code base :
Old:
New :
Html :
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.