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.
2 new events have been added.
🚩 Capture The Flag
- Two teams battle to steal the enemy's flag and return it to their base!
- Team coordination and defense are key!
- The team with the most successful captures when time runs out wins!
✨ Master of Enchanting
- Receive a Master Yogi Staff and unlimited Master Yogi Scrolls!
- Compete to reach the highest enchant level before time runs out!
- Top 3 players with the highest enchanted staffs win awesome rewards!
Price has been increased to 80 euro including the new update.
Special Offer Until 32 May
Complete Server Pack + Source Files:
C4 Scions Of Destiny: P656
Retail X1 L2OFF Server Pack + Source: Price: 150EUR
C4 Scions Of Destiny: P656
ESL2 Athena x45 L2OFF Server Pack + Source: Price: 200EUR
Screenshots: https://imgur.com/a/eternal-sin-l2-athena-x45-c4-WYCpbjl
C6 Interlude: P746
ESL2 Athena x45 L2OFF Server Pack + Source: Price: 200EUR
The same as C4 but in C6 Client so the Screenshots is the same: https://imgur.com/a/eternal-sin-l2-athena-x45-c4-WYCpbjl
C6 Interlude: P746
ESL2 Athena x45 Java Server Pack + Source: Price: 100EUR
The same as C4 but in C6 Client so the Screenshots is the same: https://imgur.com/a/eternal-sin-l2-athena-x45-c4-WYCpbjl
C6 Interlude: P746
L2Gold L2OFF Server Pack + Source: Price: 200EUR
Screenshots: https://imgur.com/a/9kB3oA9
C6 - Classic Interlude: P110
ESL2 Athena x45 L2OFF Server Pack + Source: Price: 300EUR
Screenshots: https://imgur.com/a/Z2kZxuv
Contact me here via PM (only serious buyers).
Payments via:
- Paypal (Friends and Family)
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.