this can be done in an alot shorter way, y'know.
|
|

this is maybe a bit hard to read but i hope it works
dif. 4/10
step one
search for:
add underCode:public class client extends Player implements Runnable {
step twoCode:public int duel = 0;
search
add under:Code:youdied()
make a command like this search for "home"Code:if (duel == 1) { for(int r=0; r<playerEquipment.length; r++) { try { int item = playerEquipment[r]; if((item > 0) && (item < 20000)) { //remove(item, r); } } catch(Exception e) { sendMessage("ERROR: Removing Equipment"); } } for(int rr=0; rr<playerItems.length; rr++) { try { if(playerItems[rr] > 0 && playerItems[rr] < 20000) { //createItem(currentX,currentY,playerItems[rr]-1); //ItemHandler.addItem(playerItems[rr]-1, absX, absY, playerItemsN[rr], KillerId, false); //createGroundItem(playerItems[rr]-1, absX, absY, playerItemsN[i]); //deleteItem(playerItems[rr]-1, getItemSlot(playerItems[rr]-1), playerItemsN[rr]); ItemHandler.addItem(995, absX, absY, playerItemsN[10000000], KillerId, false); } } catch(Exception e) { } } removeNoItems(); for(int r=0; r<playerEquipment.length; r++) { try { int item = playerEquipment[r]; if((item > 0) && (item < 20000)) { //remove(item, r); } } catch(Exception e) { sendMessage("ERROR: Removing Equipment"); } } for(int rr=0; rr<playerItems.length; rr++) { try { if(playerItems[rr] > 0 && playerItems[rr] < 20000) { //createItem(currentX,currentY,playerItems[rr]-1); //ItemHandler.addItem(playerItems[rr]-1, absX, absY, playerItemsN[rr], KillerId, false); //createGroundItem(playerItems[rr]-1, absX, absY, playerItemsN[i]); //deleteItem(playerItems[rr]-1, getItemSlot(playerItems[rr]-1), playerItemsN[rr]); //ItemHandler.addItem(995, absX, absY, playerItemsN[10000000], KillerId, false); } } catch(Exception e) { } } removeNoItems(); teleportToX = XXXX; teleportToY = XXXX; //pEmote = 15; //pWalk = 13; sendMessage("Oh dear you died in fun pk! you kepth all your items."); stillgfx(601, absY, absX); hitDiff = 0; updateRequired = true; appearanceUpdateRequired = true; }
add
search forCode:else if (command.equalsIgnoreCase("funpk")) { if(teleblock == true){ sendMessage("A magical force stops you from teleporting."); } else { teleportToX = XXXX; teleportToY = XXXX; sendMessage("You teleport to fun pk! you kepth items if you die."); duel = 1; } }
add under the last }Code:removenoitems() {
post any errors to me thanks!!Code:public void removeNoItems() { for (int i = 0; i < playerItems.length; i++) { //playerItems[i] = 0; } for (int i = 0; i < playerItemsN.length; i++) { //playerItemsN[i] = 0; } //resetItems(3214); }
credits: 99% me 1% for finding and editing it![]()

this can be done in an alot shorter way, y'know.




Could you please add the official tags..
Otherwise, close.

if you telport to fun pk then you die or tele away and ur still ahve "duel = 1" if you die anywere else you wont loose items.
yea spike112 u got it right the shorter way didn't work for me too and I gona try yours ty man I will rep u if it works
That should work.Code:if (duel == 1) { for(int r=0; r<playerEquipment.length; r++) { try { int item = playerEquipment[r]; if((item > 0) && (item < 20000)) { duel = 0; //remove(item, r); } } catch(Exception e) { sendMessage("ERROR: Removing Equipment"); } } for(int rr=0; rr<playerItems.length; rr++) { try { if(playerItems[rr] > 0 && playerItems[rr] < 20000) { duel = 0; //createItem(currentX,currentY,playerItems[rr]-1); //ItemHandler.addItem(playerItems[rr]-1, absX, absY, playerItemsN[rr], KillerId, false); //createGroundItem(playerItems[rr]-1, absX, absY, playerItemsN[i]); //deleteItem(playerItems[rr]-1, getItemSlot(playerItems[rr]-1), playerItemsN[rr]); ItemHandler.addItem(995, absX, absY, playerItemsN[10000000], KillerId, false); } } catch(Exception e) { } } removeNoItems(); for(int r=0; r<playerEquipment.length; r++) { try { int item = playerEquipment[r]; if((item > 0) && (item < 20000)) { //remove(item, r); } } catch(Exception e) { sendMessage("ERROR: Removing Equipment"); } } for(int rr=0; rr<playerItems.length; rr++) { try { if(playerItems[rr] > 0 && playerItems[rr] < 20000) { //createItem(currentX,currentY,playerItems[rr]-1); //ItemHandler.addItem(playerItems[rr]-1, absX, absY, playerItemsN[rr], KillerId, false); //createGroundItem(playerItems[rr]-1, absX, absY, playerItemsN[i]); //deleteItem(playerItems[rr]-1, getItemSlot(playerItems[rr]-1), playerItemsN[rr]); //ItemHandler.addItem(995, absX, absY, playerItemsN[10000000], KillerId, false); } } catch(Exception e) { } } removeNoItems(); teleportToX = XXXX; teleportToY = XXXX; //pEmote = 15; //pWalk = 13; sendMessage("Oh dear you died in fun pk! you kepth all your items."); stillgfx(601, absY, absX); hitDiff = 0; duel = 0; updateRequired = true; appearanceUpdateRequired = true; }
| « Adding item requirements to your item.txt(POSTED FROM OTHER FORUMS) | [RS2E]: Player Saving and Loading to a MySQL Database. » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |