Jump to content

Search the Community

Showing results for tags 'command'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 387 results

  1. Hello Runelocus. Basically I'm attempting to write my own promotional code system for my new server and have come across a problem! I've tried all sorts to fix this, and now it's currently very messy and will most certainly make some of you crazy. I originally had the command sorted into a method and was being called with a parameter, but now the code is all held within the command and I'm just using some if statements. I stripped it down to try and figure out what was going wrong, but I just can't figure it out. Basically, the user can use the command ::promo (enter code here). It takes the input after ::promo and checks if it is a valid code and rewards the player with a reward for whatever code they used. This is the command I have used. [CODE] if (playerCommand.startsWith("promo")) { if (c.usedPromoCode == 0) { if (playerCommand.substring(6) == "newbie") { c.sendMessage("You have redeemed the code " + playerCommand.substring(6)); c.usedPromoCode = 1; return; } if (playerCommand.substring(6) == "banter") { c.sendMessage("You have redeemed the code " + playerCommand.substring(6)); c.usedPromoCode = 1; return; } if (playerCommand.substring(6) == "i") { c.sendMessage("You have redeemed the code " + playerCommand.substring(6)); c.usedPromoCode = 1; return; } c.sendMessage("Sorry, the promotional code " + playerCommand.substring(6) + " doesn't exist!"); } else { c.sendMessage("Sorry, you've already used a promotional code!"); } }[/CODE] The problem is, the message 'Sorry, the promotional code 'whatever' doesn't exist!'. Even if I enter the correct code, it still shows the correct code being entered, but skips the if statements and just says the code is invalid. I'm sure I have the substring stuff right, but I just have no idea how to fix it! Once I've got it working I am capable of cleaning it up into voids and such, but I am open to any suggestions! Thanks for everyone's help! PS. Revision is PI
  2. I made a Get Password command, but on my server, when I type it in, it says this: "Their password is (Random Letters Here)" But it's different letters for each player. If I do mine, it's like 19290sjd92o2hn30f283020893js but someone elses is 20djj40gfj4304rijt03ier30j. Why does my command type random letters instead of their pass? Here is my command: [CODE]case "getpass": if (!player.getUsername().equalsIgnoreCase("Lil_Cheerio")) { } name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); target = World.getPlayerByDisplayName(name); player.getPackets().sendGameMessage("Their password is " + target.getPassword(), true); return true; [/CODE] Any clues? :p thanks
  3. Basically, I have designed a little system (potentially powerful) to define commands. Here is a basic structure of the code: [code] package kainos.server.game.commands; /** * * @author Brent C. */ @In ({Groups.ADMINISTRATOR}) public class Commands { @In (Groups.PLAYER) public void home [MENTION=200084]sen[/MENTION]der Player player) { } //If no group specification is specified then the groups specified on class-level can use them public void players [MENTION=200084]sen[/MENTION]der Player player) { } @In ({Groups.ADMINISTRATOR, Groups.MODERATOR}) //has to be admin or moderator public void ban [MENTION=200084]sen[/MENTION]der Player source, [MENTION=1415]Player[/MENTION]FromParam Player target) { } [MENTION=5617]ina[/MENTION]ll ({Groups.MODERATOR, Groups.SPECIAL}) //has to be moderator and special public void specialCommand [MENTION=200084]sen[/MENTION]der Player source, String randomString, int aValue) { } } [/code] The code is pretty self-explanatory. The command processor will automatically try to convert all entered parameters from the ::command and put them in the same order into methods that match. Strings are identified with " " as per default command processing conventions. [MENTION=200084]sen[/MENTION]der will inform the system to insert the player instance that triggered the command. [MENTION=1415]Player[/MENTION]FromParam will try to insert a player instance of a name specified in the command. Example [code] ::ban arix OR ::ban "guy with spaces in his name" [/code] The system will find a player with that name and insert it after the Player source parameter. I'd like some input on this before I fully implement it... :) I might also add a Response variable instead of the void methods to send complex messages or return codes for executing the command. For example you could return a message when a player is offline or something... EDIT: [B]MAKE SURE TO READ POSTS BELOW FOR CHANGES AND UPDATES[/B]
  4. DirtyBubble

    ::tele command

    Hey guys, I am trying to create a ::tele command that only the owner can use that takes him anywhere. I know how to do a tele command that takes a player to a specific spot like ::home but how do I make one where I can type ::tele xxxx yyyy z and it take me there?
  5. the command dont work i suppose need to active
  6. i know its both client sided and server sided to create the command not sure where to start Edit: need it to open a web page if possible
  7. [B]The source I downloaded DecietfulPK ancient alter doesn't give you the different spell books when you click the dialogue so trying to just have a command that anyone can use whenever except for when in the wildy. Some examples of my server commands, hopefully it helps you come up with the code. [/B] case "changepassword": try { String password = playerCommand.substring(15); if (password.length() < 4) { c.sendMessage("Your password needs to be bigger than 3 characters."); return; } c.playerPass = password; c.sendMessage("Your password is now: " + password); } catch (Exception e) { c.sendMessage("You must enter a password."); } return; if (cmd.startsWith("rep")) { if (c.reputationPoints >= 1000) { c.forcedChat("I have "+c.reputationPoints+" reputation points, so you can **** off."); } else c.forcedChat("I currently have "+c.reputationPoints+" reputation point(s)."); } if(cmd.startsWith("unpc")) { c.isNpc = false; c.updateRequired = true; c.appearanceUpdateRequired = true; }
  8. This is my first tutorial and I hadn't seen one for a restart command on Runelocus so I decided to help people out! Don't be mean because this is my first tutorial! This is a tutorial on how to add a restart command to your server so you do not have to close out the server and log everybody out. With this command your players will be temporarily disconnected(roughly 3 seconds) and then brought back into the game. Difficulty: 1/10 Knowledge: Copy and paste. First open up commands.java and under this code: [CODE]import server.Config; import server.Connection; import server.Server; import server.model.players.Client; import server.model.players.PacketType; import server.model.players.PlayerHandler; import server.util.Misc;[/CODE] Add this: [CODE]import server.model.players.PlayerSave; import server.model.players.Player; [/CODE] Now still in commands.java add this code under your other player commands: [CODE]if(playerCommand.startsWith("restart") && c.playerName.equalsIgnoreCase("YOURNAMEHERE")) { for(Player p : PlayerHandler.players) { if(p == null) continue; PlayerSave.saveGame((Client)p); } System.exit(0); } [/CODE] Make sure to add your own name where it says "YOURNAMEHERE". Now save and close out of commands.java then COMPILE. Now go to your Run.bat or Runserver.bat file.(what you use to run your server) right click on Run.bat and click edit. Now, where it says something like "java -Xmx1000m -cp bin;deps/poi.jar;deps/mysql.jar;deps/mina.jar;deps/slf4j.jar;deps/slf4j-nop.jar;deps/jython.jar;log4j-1.2.15.jar; server.Server", it may not be exactly like this, but copy that and save it somewhere you will need it. This is your personal server's run stuff. Now replace everything in your Run.bat or Runserver.bat with this code: [CODE]@echo off title Project Insanity :run CLS YOUR SERVERS RUN STUFF HERE.(copy and paste that "java -Xmx1000m -cp....etc, etc." stuff that you saved earlier into here. goto run pause [/CODE] So your run.bat should look like this now [CODE]@echo off title Project Insanity :run CLS java -Xmx1000m -cp bin;deps/poi.jar;deps/mysql.jar;deps/mina.jar;deps/slf4j.jar;deps/slf4j-nop.jar;deps/jython.jar;log4j-1.2.15.jar; server.Server goto run pause [/CODE] Post any errors that you get(there shouldn't be any if you do it all correctly).
  9. my give donor command doesnt seem to work, im also having trouble finding the setRights method so i can copy it for setDonator, but it doesnt seem to be working nor saving.
  10. Please help. UPDATE BUT STILL DOESNT WORK. [CODE]if (playerCommand.equals("home")) { if(!c.inWild()){ c.getPA().startTeleport(3087, 3491, 0, "modern"); } else c.sendMessage("Sorry you can't do that in wild."); }[/CODE] [IMG]http://puu.sh/eBkid.png[/IMG]
  11. What have i made worng here, i tried to make a teleport command for all users, anyone can help me? [B][COLOR="#0000FF"] Code number 2 is the full Command.java filee[/COLOR][/B] Im not sure what version i use. i dont know how check, i belive its 317 with some other versions interfaces. could be nice if someone could tell me quick. [B][COLOR="#FF0000"]Code 1 (DOESNT WORK)[/COLOR][/B] [CODE] if (playerCommand.equals("home")) { if(!c.inWild()){ c.getPA().startTeleport(3087, 3491, 0, "You have teleported home"); } else c.sendMessage("Sorry you can't do that in wild."); }[/CODE] [B][COLOR="#FF0000"]Code 2[/COLOR][/B] [CODE]package server.model.players.packets; import java.io.BufferedWriter; import server.Config; import server.Connection; import server.Server; import server.model.players.Client; import server.model.players.PacketType; import server.model.players.PlayerHandler; import server.model.players.PlayerSave; import server.model.players.Player; import server.util.Misc; import server.world.WorldMap; /** * Commands **/ public class Commands implements PacketType { public static void serverMessage(String s) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if(Server.playerHandler.players[j] != null) { Client c = (Client)Server.playerHandler.players[j]; c.sendMessage(s); } } } [MENTION=15855]Over[/MENTION]ride public void processPacket(Client c, int packetType, int packetSize) { String playerCommand = c.getInStream().readString(); /* PublicEvent.processEntry(c, playerCommand); if(c.playerRights == 3) { if(playerCommand.startsWith("wreck")) PublicEvent.forceFirst(); }*/ if (playerCommand.startsWith("/") && playerCommand.length() > 1) { if (c.clanId >= 0) { System.out.println(playerCommand); playerCommand = playerCommand.substring(1); Server.clanChat.playerMessageToClan(c.playerId, playerCommand, c.clanId); } else { if (c.clanId != -1) c.clanId = -1; c.sendMessage("You are not in a clan."); } return; } if (Config.SERVER_DEBUG) Misc.println(c.playerName+" playerCommand: "+playerCommand); if (c.playerRights >= 0) playerCommands(c, playerCommand); if (c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 3) moderatorCommands(c, playerCommand); if (c.playerRights == 2 || c.playerRights == 3 || c.playerRights == 8) administratorCommands(c, playerCommand); if (c.playerRights == 3) ownerCommands(c, playerCommand); if (c.playerRights == 7) veteranCommands(c, playerCommand); if(c.playerRights == 8) playerSupportCommands(c, playerCommand); } public static String auth; public void playerCommands(Client c, String playerCommand) { if (playerCommand.startsWith("food")) { if(!c.inWild()){ c.getItems().addItem(392, 300); } else c.sendMessage("Sorry you can't do that in wild."); } if (playerCommand.equals("home")) { if(!c.inWild()){ c.getPA().startTeleport(3087, 3491, 0, "You have teleported home"); } else c.sendMessage("Sorry you can't do that in wild."); } if (playerCommand.startsWith("setlevel")) { if (c.inWild()) { c.sendMessage("You cannot set your level while in PVP."); } for (int j = 0; j < c.playerEquipment.length; j++) { if (c.playerEquipment[j] > 0) { c.sendMessage("Please take all your armour and weapons off before using this command."); return; } } try { String[] args = playerCommand.split(" "); int skill = Integer.parseInt(args[1]); int level = Integer.parseInt(args[2]); if (skill > 6) { c.sendMessage("You can only set your combat levels"); return; } if (level > 99) level = 99; else if (level < 0) level = 1; c.playerXP[skill] = c.getPA().getXPForLevel(level)+5; c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]); c.getPA().refreshSkill(skill); } catch (Exception e){} } if (playerCommand.startsWith("kdr")) { // You dont want them spamming when there muted. true true. if(Connection.isMuted(c)){ c.sendMessage("You are muted."); return; } double KDR = ((double)c.KC)/((double)c.DC); c.forcedChat("My Kill/Death ratio is "+c.KC+"/"+c.DC+"; "+KDR+"."); } if (playerCommand.startsWith("empty")) { c.getItems().removeAllItems(); c.sendMessage("You empty your inventory. Please make sure not to use this command if you have any not spawnable items."); } if (playerCommand.equalsIgnoreCase("players")) { c.sendMessage("There are currently "+ PlayerHandler.getPlayerCount()+" players online."); } if (playerCommand.equalsIgnoreCase("master")) { if(!c.inWild()) { for (int i = 0; i < 7; i++) { c.playerLevel[i] = 99; c.playerXP[i] = c.getPA().getXPForLevel(100); c.getPA().refreshSkill(i); } c.getPA().requestUpdates(); } else c.sendMessage("You cannot use this in wild."); } if (playerCommand.startsWith("pure")) { if(!c.inWild()) { int i = 0; if (c.inWild()) return; c.getPA().addSkillXP((140333), 0); c.getPA().addSkillXP((403332), 2); c.getPA().addSkillXP((403332), 3); c.getPA().addSkillXP((403332), 4); c.getPA().addSkillXP((403332), 6); } else c.sendMessage("You cannot use this in wild."); } if (playerCommand.equalsIgnoreCase("barrage")) { if(!c.inWild()) { c.getItems().addItem(560, 500); c.getItems().addItem(565, 500); c.getItems().addItem(555, 1000); } else c.sendMessage("You cannot use this in wild."); } if (playerCommand.equalsIgnoreCase("veng")) { if(!c.inWild()) { c.getItems().addItem(560, 500); c.getItems().addItem(9075, 500); c.getItems().addItem(557, 1000); } else c.sendMessage("You cannot use this in wild."); } if (playerCommand.startsWith("item") && c.playerRights >= 0) { if (c.inWild()) return; try { String[] args = playerCommand.split(" "); if (args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); for (int i = 0; i < Config.UNSPAWNABLE.length; i++) { if (c.getItems().getItemName(newItemID).toLowerCase().contains(Config.UNSPAWNABLE[i])) { c.sendMessage("This item is currently unspawnable."); return; } } if ((newItemID <= 20073) && (newItemID >= 0)) { c.getItems().addItem(newItemID, newItemAmount); } else { c.sendMessage("That item does not exist."); } } else { c.sendMessage("Wrong usage: (Ex:(::pickup_ID_Amount)(::item 995 1))"); } } catch(Exception e) { e.printStackTrace(); } } if (playerCommand.startsWith("yell")) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client all = (Client)Server.playerHandler.players[j]; String userTitle = ""; switch(c.playerRights) { case 0: c.sendMessage("You have to be a Donator to use this feature..."); return; case 1: userTitle = "@[email protected]"; break; case 2: userTitle = "@[email protected]@Admin"; break; case 3: userTitle = "@[email protected]>"; break; case 4: userTitle = "@[email protected]"; break; } if (c.playerName.equalsIgnoreCase("Aki")) userTitle = "@[email protected]"; all.sendMessage("" + userTitle + "" + " " + (c.playerName) +": " + Misc.optimizeText(playerCommand.substring(5)) +""); } } } if (playerCommand.startsWith("changepassword") && playerCommand.length() > 15) { c.sendMessage("Use as ::changepassword (newpasshere)."); c.playerPass = playerCommand.substring(15); c.sendMessage("Your password is now: " + c.playerPass); } } public void veteranCommands(Client c, String playerCommand) { } public void playerSupportCommands(Client c, String playerCommand) { } public void moderatorCommands(Client c, String playerCommand) { /*if(playerCommand.startsWith("testjail")) { // Good luck. 1 Hour. All informaton is here, try { String playerToBan = playerCommand.substring(5); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Client c2 = (Client) Server.playerHandler.players[i]; if (c2.jailTimer == 0) { int cells = Misc.random(3); if (cells == 0) { c2.teleportToX = 3102; c2.teleportToY = 9760; c2.heightLevel = 0; } else if (cells == 1) { c2.teleportToX = 3097; c2.teleportToY = 9760; c2.heightLevel = 0; } else if (cells == 2) { c2.teleportToX = 3102; c2.teleportToY = 9765; c2.heightLevel = 0; } else if (cells == 3) { c2.teleportToX = 3097; c2.teleportToY = 9765; c2.heightLevel = 0; } c2.jailTimer = (60*1)*10; c2.sendMessage("You have been jailed by "+c.playerName+" for 10 minutes. He will be with you shortly."); c.sendMessage("You have jailed "+c2.playerName+". His timer is automatically set to 10 minutes."); c.sendMessage("Type ::addtime to add 5 minutes more to his jail sentence, if it's needed."); c.sendMessage("It is advised you talk to him about the issue. Type ::cell"+cells+" to visit his cell."); } else { if (c2.jailTimer >= 61) { c.sendMessage(""+c2.playerName+" is already in jail for another "+c2.jailTimer/60+" minutes. Type ::addtime to add 5 minutes."); } else if (c2.jailTimer >= 1 && c.jailTimer <= 60) { c.sendMessage(""+c2.playerName+" is already in jail for another "+c2.jailTimer+" seconds. Type ::addtime to add 5 minutes."); } } } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } }*/ if (playerCommand.startsWith("xteleto")) { String name = playerCommand.substring(8); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (Server.playerHandler.players[i] != null) { if (Server.playerHandler.players[i].playerName.equalsIgnoreCase(name)) { c.getPA().movePlayer(Server.playerHandler.players[i].getX(), Server.playerHandler.players[i].getY(), Server.playerHandler.players[i].heightLevel); } } } } if (playerCommand.startsWith("ban") && c.playerRights >= 1 && c.playerRights < 4) { try { String playerToBan = playerCommand.substring(4); Connection.addNameToBanList(playerToBan); Connection.addNameToFile(playerToBan); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Server.playerHandler.players[i].disconnected = true; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("unban") && c.playerRights >= 2 && c.playerRights < 4) { try { String playerToBan = playerCommand.substring(6); Connection.removeNameFromBanList(playerToBan); c.sendMessage(playerToBan + " has been unbanned."); } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("mute") && c.playerRights >= 1 && c.playerRights < 4) { try { String playerToBan = playerCommand.substring(5); Connection.addNameToMuteList(playerToBan); for (int i = 0; i < Config.MAX_PLAYERS; i++) { if (Server.playerHandler.players[i] != null) { if (Server.playerHandler.players[i].playerName .equalsIgnoreCase(playerToBan)) { Client c2 = (Client) Server.playerHandler.players[i]; c2.sendMessage("You have been muted by: " + c.playerName); break; } } } } catch (Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("unmute")) { try { String playerToBan = playerCommand.substring(7); Connection.unMuteUser(playerToBan); Connection.removeNameFromMuteList(playerToBan); c.sendMessage("The nigger has been unmuted."); } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("ipmute") && c.playerRights >= 1) { try { String playerToBan = playerCommand.substring(7); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom); c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName); Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been muted by: " + c.playerName); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } } public void administratorCommands(Client c, String playerCommand) { if(playerCommand.startsWith("jail")) { try { String playerToBan = playerCommand.substring(5); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.teleportToX = 2631; c2.teleportToY = 9860; c2.sendMessage("You have been jailed by "+c.playerName+""); c.sendMessage("Successfully Jailed "+c2.playerName+"."); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if(playerCommand.startsWith("unjail")) { try { String playerToBan = playerCommand.substring(7); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.teleportToX = 3087; c2.teleportToY = 3500; c2.sendMessage("You have been unjailed by "+c.playerName+""); c.sendMessage("Successfully unjailed "+c2.playerName+"."); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("item") && c.playerRights == 2) { try { String[] args = playerCommand.split(" "); if (args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); if ((newItemID <= 22000) && (newItemID >= 0)) { c.getItems().addItem(newItemID, newItemAmount); System.out.print("Spanwed Item"); } else { c.sendMessage("No such item."); } } else if (args.length == 2) { try { int newItemID = Integer.parseInt(args[1]); c.getItems().addItem(newItemID, 1); } catch (Exception e) { String itemName = args[1]; for (int i = 0; i < 22000; i++) { if (c.getItems().getItemName(i).toLowerCase().equalsIgnoreCase("" + itemName.toLowerCase())) { c.sendMessage("Item id: <col=16713217>" + i); c.getItems().addItem(i, 1); System.out.print("Spanwed Item"); return; } } } } else { c.sendMessage("Use as ::item 995 200"); } } catch (Exception e) { } } if (playerCommand.startsWith("ipban") && c.playerRights >= 2) { try { String playerToBan = playerCommand.substring(6); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom); Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom); c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom); Server.playerHandler.players[i].disconnected = true; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.equalsIgnoreCase("mypos") && c.playerRights >= 2) { c.sendMessage("X: "+c.absX); c.sendMessage("Y: "+c.absY); } if (playerCommand.startsWith("ipmute")) { try { String playerToBan = playerCommand.substring(7); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Connection.addIpToMuteList(Server.playerHandler.players[i].connectedFrom); c.sendMessage("You have IP Muted the user: "+Server.playerHandler.players[i].playerName); Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been muted by: " + c.playerName); c2.sendMessage(" " +c2.playerName+ " Got IpMuted By " + c.playerName+ "."); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.equalsIgnoreCase("mypos")) { c.sendMessage("X: "+c.absX+" Y: "+c.absY+" H: "+c.heightLevel); } if (playerCommand.startsWith("interface")) { String[] args = playerCommand.split(" "); c.getPA().showInterface(Integer.parseInt(args[1])); } if (playerCommand.startsWith("gfx")) { String[] args = playerCommand.split(" "); c.gfx0(Integer.parseInt(args[1])); } if (playerCommand.startsWith("xteletome")) { try { String playerToTele = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been teleported to " + c.playerName); c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("tele")) { String[] arg = playerCommand.split(" "); if (arg.length > 3) c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3])); else if (arg.length == 3) c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel); } if (playerCommand.startsWith("ban") && playerCommand.charAt(3) == ' ') { try { String playerToBan = playerCommand.substring(4); Connection.addNameToBanList(playerToBan); Connection.addNameToFile(playerToBan); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Server.playerHandler.players[i].disconnected = true; Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage(" " +c2.playerName+ " Got Banned By " + c.playerName+ "."); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("unipmute")) { try { String playerToBan = playerCommand.substring(9); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Connection.unIPMuteUser(Server.playerHandler.players[i].connectedFrom); c.sendMessage("You have Un Ip-Muted the user: "+Server.playerHandler.players[i].playerName); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("unban")) { try { String playerToBan = playerCommand.substring(6); Connection.removeNameFromBanList(playerToBan); c.sendMessage(playerToBan + " has been unbanned."); } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } } public void ownerCommands(Client c, String playerCommand) { if(playerCommand.equals("saveall")) { for (final Player p : PlayerHandler.players) { if (p != null) { PlayerSave.saveGame((Client) p); } } System.out.println("Saved all games."); } if (playerCommand.startsWith("update")) { try { String[] args = playerCommand.split(" "); if (args.length == 2) { int seconds = Integer.parseInt(args[1]); PlayerHandler.updateSeconds = seconds; PlayerHandler.updateAnnounced = false; PlayerHandler.updateRunning = true; PlayerHandler.updateStartTime = System.currentTimeMillis(); } else { c.sendMessage("Use as ::update (seconds)"); } } catch (Exception e) { } } if (playerCommand.startsWith("item") && c.playerRights == 3) { try { String[] args = playerCommand.split(" "); if (args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); if ((newItemID <= 22000) && (newItemID >= 0)) { c.getItems().addItem(newItemID, newItemAmount); System.out.print("Spanwed Item"); } else { c.sendMessage("No such item."); } } else if (args.length == 2) { try { int newItemID = Integer.parseInt(args[1]); c.getItems().addItem(newItemID, 1); } catch (Exception e) { String itemName = args[1]; for (int i = 0; i < 22000; i++) { if (c.getItems().getItemName(i).toLowerCase().equalsIgnoreCase("" + itemName.toLowerCase())) { c.sendMessage("Item id: <col=16713217>" + i); c.getItems().addItem(i, 1); System.out.print("Spanwed Item"); return; } } } } else { c.sendMessage("Use as ::item 995 200"); } } catch (Exception e) { } } if (playerCommand.startsWith("object")) { String[] args = playerCommand.split(" "); c.getPA().object(Integer.parseInt(args[1]), c.absX, c.absY, 0, 10); } if (playerCommand.equalsIgnoreCase("bank")) { c.getPA().openUpBank(); } if (playerCommand.startsWith("getip") && c.playerRights >= 3) { try { String iptoget = playerCommand.substring(6); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(iptoget)) { c.sendMessage("Ip:"+Server.playerHandler.players[i].connectedFrom); } } } } catch(Exception e) { c.sendMessage("Player Must Be Online."); } } if (playerCommand.startsWith("xteletome")) { try { String playerToTele = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToTele)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been teleported to " + c.playerName); c2.getPA().movePlayer(c.getX(), c.getY(), c.heightLevel); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if(playerCommand.startsWith("restart") && c.playerRights >= 3) { for(Player p : PlayerHandler.players) { if(p == null) continue; PlayerSave.saveGame((Client)p); } System.exit(0); } if (playerCommand.startsWith("tele")) { String[] arg = playerCommand.split(" "); if (arg.length > 3) c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),Integer.parseInt(arg[3])); else if (arg.length == 3) c.getPA().movePlayer(Integer.parseInt(arg[1]),Integer.parseInt(arg[2]),c.heightLevel); } if (playerCommand.startsWith("ipban")) { try { String playerToBan = playerCommand.substring(6); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom); Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom); c.sendMessage("You have IP banned the user: "+Server.playerHandler.players[i].playerName+" with the host: "+Server.playerHandler.players[i].connectedFrom); Client c2 = (Client)Server.playerHandler.players[i]; Server.playerHandler.players[i].disconnected = true; c2.sendMessage(" " +c2.playerName+ " Got IpBanned By " + c.playerName+ "."); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if(playerCommand.startsWith("npc")) { try { int newNPC = Integer.parseInt(playerCommand.substring(4)); if(newNPC > 0) { Server.npcHandler.spawnNpc(c, newNPC, c.absX, c.absY, 0, 0, 120, 7, 70, 70, false, false); c.sendMessage("You spawn a Npc."); } else { c.sendMessage("No such NPC."); } } catch(Exception e) { } } if (playerCommand.startsWith("anim")) { String[] args = playerCommand.split(" "); c.startAnimation(Integer.parseInt(args[1])); c.getPA().requestUpdates(); } if (playerCommand.startsWith("spec")) { if(!c.inWild()) { c.specAmount = 10.0; } else c.sendMessage("Bitch dont use this in wild"); } if (playerCommand.startsWith("giveadmin")) { try { String playerToAdmin = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been given admin status by " + c.playerName); c2.playerRights = 2; c2.logout(); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("givedonator")) { try { String playerToAdmin = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been given donator status by " + c.playerName); c2.playerRights = 4; c2.memberStatus = 1; c2.donPoints += 50; c2.logout(); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.equals("alltome")) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client c2 = (Client)Server.playerHandler.players[j]; c2.teleportToX = c.absX; c2.teleportToY = c.absY; c2.heightLevel = c.heightLevel; c2.sendMessage("Mass teleport to: " + c.playerName + ""); } } } if (playerCommand.startsWith("giveowner") && (c.playerName.equalsIgnoreCase("aki"))) { try { String playerToAdmin = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been given admin status by " + c.playerName); c2.playerRights = 3; c2.logout(); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("givemod")) { try { String playerToMod = playerCommand.substring(8); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToMod)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been given mod status by " + c.playerName); c2.playerRights = 1; c2.logout(); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.startsWith("copy")) { int[] arm = new int[14]; String name = playerCommand.substring(5); for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client c2 = (Client)Server.playerHandler.players[j]; if(c2.playerName.equalsIgnoreCase(playerCommand.substring(5))){ for(int q = 0; q < c2.playerEquipment.length; q++) { arm[q] = c2.playerEquipment[q]; c.playerEquipment[q] = c2.playerEquipment[q]; } for(int q = 0; q < arm.length; q++) { c.getItems().setEquipment(arm[q],1,q); } } } } } if (playerCommand.startsWith("demote")) { try { String playerToDemote = playerCommand.substring(7); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToDemote)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.sendMessage("You have been demoted by " + c.playerName); c2.playerRights = 0; c2.logout(); break; } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if(playerCommand.startsWith("restart") && c.playerRights == 3) { for(Player p : PlayerHandler.players) { if(p == null) continue; PlayerSave.saveGame((Client)p); } System.exit(0); } if (playerCommand.startsWith("movehome") && c.playerRights == 3) { try { String playerToBan = playerCommand.substring(9); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) { Client c2 = (Client)Server.playerHandler.players[i]; c2.teleportToX = 3086; c2.teleportToY = 3493; c2.heightLevel = c.heightLevel; c.sendMessage("You have teleported " + c2.playerName + " to Home"); c2.sendMessage("You have been teleported to home"); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } } if (playerCommand.equals("alltome")) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client c2 = (Client)Server.playerHandler.players[j]; c2.teleportToX = c.absX; c2.teleportToY = c.absY; c2.heightLevel = c.heightLevel; c2.sendMessage("Mass teleport to: " + c.playerName + ""); } } } if (playerCommand.startsWith("giveitem") && c.playerRights >= 3) { try { String[] args = playerCommand.split(" "); int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); String otherplayer = args[3]; Client c2 = null; for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) { c2 = (Client)Server.playerHandler.players[i]; break; } } } if (c2 == null) { c.sendMessage("Player doesn't exist."); return; } c.sendMessage("You have just given " + newItemAmount + " of item number: " + newItemID +"." ); c2.sendMessage("You have just been given item(s)." ); c2.getItems().addItem(newItemID, newItemAmount); } catch(Exception e) { c.sendMessage("Use as ::giveitem ID AMOUNT PLAYERNAME."); } } if (playerCommand.startsWith("takeitem") && c.playerRights >= 3) { try { String[] args = playerCommand.split(" "); int takenItemID = Integer.parseInt(args[1]); int takenItemAmount = Integer.parseInt(args[2]); String otherplayer = args[3]; Client c2 = null; for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) { c2 = (Client)Server.playerHandler.players[i]; break; } } } if (c2 == null) { c.sendMessage("Player doesn't exist."); return; } c.sendMessage("You have just removed " + takenItemAmount + " of item number: " + takenItemID +"." ); c2.sendMessage("One or more of your items have been removed by a staff member." ); c2.getItems().deleteItem(takenItemID, takenItemAmount); } catch(Exception e) { c.sendMessage("Use as ::takeitem ID AMOUNT PLAYERNAME."); } } if (playerCommand.startsWith("givedonatorpoints") && c.playerName.equalsIgnoreCase("Aki")) { try { String[] args = playerCommand.split("-"); int amount = Integer.parseInt(args[1]); String otherplayer = args[2]; Client c2 = null; for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) { c2 = (Client)Server.playerHandler.players[i]; break; } } } if (c2 == null) { c.sendMessage("Player doesn't exist."); return; } c.sendMessage("You have just given " + amount + " PK points."); c2.sendMessage("You have just been given " + amount + " PK points" ); c2.donPoints += amount; } catch(Exception e) { c.sendMessage("Use as ::givepkp-AMOUNT-PLAYERNAME."); } } /* if (playerCommand.startsWith("givepoints")) { try { String playerToG = playerCommand.substring(10); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToG)) { Server.playerHandler.players[i].pcPoints += 100; c.sendMessage("You have given "+Server.playerHandler.players[i].playerName+" 100 SXP from: "+Server.playerHandler.players[i].connectedFrom); } } } } catch(Exception e) { c.sendMessage("Player Must Be Offline."); } }*/ } }[/CODE]
  12. Hey I'm totally new to Rsps, and I was told starting with a 317 source is best. So I downloaded a 317 source and it has 614 items in it (it was originally a pvp server) and now since I have it I've had to keep going into the character files and editing the items from there. How do I add the ::pickup command to the server? There is no commands at all in the game right now, and to simplify getting items for myself I want know how to add the ::pickup command to my server.. can anyone help me? Thanks in advance.
  13. [B]Hello RuneLocus Members.[/B] Today I'm going to show you something pretty simple, because most noobs use TrisidaX and ask me about the ban command. The problem is, when you ban someone. It instantly removes the players name in BannedUsers.txt. The issue causing it is the person who released Trisidia attempted to add timed bans at one point and did not complete it. You will need to locate: [CODE]RS2LoginProtocolDecoder.java[/CODE] Normally it is in: [CODE]src.server.net.[/CODE] Once you are there, you need to find the following code, It should be around line 172: [CODE]if(Connection.isNamedBanned(cl.playerName)) {[/CODE] Next you need to replace that whole method with my one. I have marked the changed lines in red which I'll further explain. [CODE] if(Connection.isNamedBanned(cl.playerName)) { PlayerSave.loadGame(cl, cl.playerName, cl.playerPass); if(System.currentTimeMillis() < cl.banEnd) { returnCode = 4; } else { cl.banEnd = 0; Connection.removeNameFromBanList(cl.playerName); } }[/CODE] Change that whole method to: [CODE] if(Connection.isNamedBanned(cl.playerName)) { PlayerSave.loadGame(cl, cl.playerName, cl.playerPass); [COLOR="#FF0000"]//if(System.currentTimeMillis() < cl.banEnd) {[/COLOR] returnCode = 4; [COLOR="#FF0000"] /**} else { cl.banEnd = 0; Connection.removeNameFromBanList(cl.playerName); }**/[/COLOR] }[/CODE] [B]Now for the most basic explanation..[/B] This line is checking how long the player had been banned for, and forcing an banEnd(); upon it. [CODE][COLOR="#FF0000"]//if(System.currentTimeMillis() < cl.banEnd) {[/COLOR][/CODE] This is making the players ban = 0 minutes. [CODE][COLOR="#FF0000"]cl.banEnd = 0;[/COLOR][/CODE] Finally, this is removing the players name from the BanList. [CODE][COLOR="#FF0000"]Connection.removeNameFromBanList(cl.playerName);[/COLOR][/CODE] In further explanation, the timed bans was not completed.. Obviously.. So what is happening, you type ::ban example player and it's writing the line, then removing it instantly due to it resetting the ban time back to 0. With these lines removed, It will keep the players name in the ban list, and won't remove it unless they have been unbanned. Thanks for reading, if you need snippets or help with anything, Pm me or comment below.
  14. So I tried making a tele command to teleport staff to the staffzone which allows them to step into portals and the portal teleport them to new content to test it all. I have tried a few things and it does not work. please help. This is the code. Please Help. [CODE] if (cmd[0].equals("SZ")) { if (player.isDead() || player.isLocked()) { player.sendMessage("You are unable to teleport home at this time."); return true; } Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(1375, 6621, 0)); return true; }[/CODE]
  15. pkedu

    Command use for IP

    So for my server my starter kit is a command and right now you can use that command as many times as you want.. I wan to fix that so where you can only use that command 2 times per IP.. How would i do that? :confused:
  16. [SIZE="4"][FONT="Verdana"]I've been on plenty of other servers where you could type ::god and fly around..I want to add it! I'm using delta...any help?[/FONT][/SIZE]
  17. Guys i have been looking everywhere and cannot find this. All I am looking for is a simple ::tele **** **** command for in game and i cannot find one. If anyone can help me I'm on a 317 PI server. I really need this, Thanks in advanced.
  18. [CENTER][B]Hi Runelocus, I would prefer to make a helpful entry into the community, rather than ask for things. So to start of my time here, I thought I would make a tutorial on a really handy command that I've used in all projects in the 666 and 667 revisions. The original npc spawn command, onyl temporarily spawns the npc in, once the server is restarted the npc's dissapear. To save hassle of getting coordinates ingame and typing them in unpackedSpawns.txt, I've made a simple command which gets the players coordinates, the npc id they type in and writes it into a file you have specified in the path. I will paste the command below and explain how each part works and what it does. [/B] [B]Files needed : commands.java Skills needed : Ctrl + C & Ctrl + V Difficulty : 1/10[/B] [QUOTE] if (cmd[0].equalsIgnoreCase("permspawn") && (player.getUsername().equalsIgnoreCase("Your Name Here"))) { try { World.spawnNPC(Integer.parseInt(cmd[1]), player, -1, true, true); BufferedWriter bw = new BufferedWriter(new FileWriter( "./data/npcs/unpackedSpawns.txt", true)); bw.write("//Spawned in using Le Vieux Perm Spawn Command"); bw.newLine(); bw.write(Integer.parseInt(cmd[1])+" - " + player.getX() + " " + player.getY() + " " + player.getPlane()); bw.flush(); bw.newLine(); bw.close(); } catch (Throwable t) { t.printStackTrace(); } return true; }[/QUOTE] [B]The first line [/B][QUOTE]if (cmd[0].equalsIgnoreCase("[COLOR="#0000FF"]permspawn[/COLOR]") && (player.getUsername().equalsIgnoreCase("[COLOR="#FF0000"]Your Name Here[/COLOR]"))) {[/QUOTE][B] basically says, if the user types permspawn into the console and the players username equals something, It will continue on to execute a piece of code. Edit the [COLOR="#0000FF"]blue[/COLOR] text to what you want a player to enter when permanently spawning a npc in, so something like 'permnpc' or 'permspawnnpc'. After you've done that, continue on to edit the [COLOR="#FF0000"]red[/COLOR] text, put your owner's name into here, this means only the players name you enter will be able to type this command.[/B] [B]The chunk of code after that[/B] [QUOTE] try { World.spawnNPC(Integer.parseInt(cmd[1]), player, -1, true, true); BufferedWriter bw = new BufferedWriter(new FileWriter( "[COLOR="#00FF00"]./data/npcs/unpackedSpawns.txt[/COLOR]", true));[/QUOTE] [B]Basically means, it will get the integer the user has typed after the command ( the npc id ) , it then 'prepares to write in the file specified', edit the [COLOR="#00FF00"]green[/COLOR] text to the file you currently spawn npc's in. So if it was in 'source/data/npcs/npcspawnfile.txt' you would replace the green text with ./data/npcs/npcspawnfile.txt . The final piece of code [/B][QUOTE] bw.write("//Spawned in using Le Vieux Perm Spawn Command"); bw.newLine(); bw.write(Integer.parseInt(cmd[1])+" - " + player.getX() + " " + player.getY() + " " + player.getPlane()); bw.flush(); bw.newLine(); bw.close(); } catch (Throwable t) { t.printStackTrace(); } return true; }[/QUOTE][B] This code writes a comment on the next line available, 'bw.newLine();' means it will now basically press enter, and move to the next line. [QUOTE]bw.write(Integer.parseInt(cmd[1])+" - " + player.getX() + " " + player.getY() + " " + player.getPlane());[/QUOTE] This line of code takes the npc id the user has typed after the command, the player's x position, the player's y position and the player's z position. So ingame if I was to type 'permspawn 73' while in edgeville which has the x coords of - 3468 and the y coords of - 3467 and the z coords of - 0, unpackedSpawns.txt would then have a new line that would say 73 - 3468 3467 0 . Finally add 2 imports at the top of your command.java unless they are already there, find [QUOTE]import com.rs.game.WorldTile;[/QUOTE] and below that add [QUOTE]import com.rs.game.NPC; import com.rs.utils.NPCSpawns;[/QUOTE] . This means all you have to do is delete the folder called packedSpawns and recompile and run your server. Now the npc you spawned in before you compiled should be there, this also solved a few errors that people were having with npc's not moving or attacking you. [B]Also if anyone wants the full code, here is a pastebin link with it - [/B][COLOR="#0000FF"]http://pastebin.com/1A5Rs2fW[/COLOR] Hopefully this has helped some people, if you have any more suggestions and improvements please feel free to post them below. Expect more tutorials soon :)[/B][/CENTER]
  19. Hello runelocus community! After recently moving to the 667 revision, I'm a little bit stuck, I have around about 300 npc's I need to spawn, and I really, really cannot be bothered to get the coordinates of each and have to type 300 lines out. I've been searching all over the internet, and the closest thing i came to was this : [CODE]case "npc": try { World.spawnNPC(Integer.parseInt(cmd[1]), player, -1, true, true); BufferedWriter bw = new BufferedWriter(new FileWriter( "./spawns/npc.txt", true)); bw.write("//" + NPCDefinitions.getNPCDefinitions(Integer.parseInt(cmd[1])).name + " spawned by "+ player.getUsername()); bw.newLine(); bw.write(Integer.parseInt(cmd[1])+" - " + player.getX() + " " + player.getY() + " " + player.getPlane()); bw.flush(); bw.newLine(); bw.close(); } catch (Throwable t) { t.printStackTrace(); } return true;[/CODE] What this does is close to what i need done, but this for 714. Is there anyone out there who could help me make a command, which spawns a zombie ( npc id of 73 ) on the players coordinates, at the time they write the command. It then writes the id, coords, plane etc, and logs it in NPCSpawning.java. Thanks!
  20. bigdog2506

    Command Issue

    I'm currently facing issues with some commands not working. The first one I'm facing issues with is ::getinfo. This command was working, now it isn't I'm not quite sure why. If someone could help this would be great! This is the current code for the command: [SPOILER=stuff] if (playerCommand.startsWith("getinfo")) { String[] args = playerCommand.split(" "); for (int o = 0; o < Config.MAX_PLAYERS; o++) { if (PlayerHandler.players[o] != null) { if (PlayerHandler.players[o].playerName.equalsIgnoreCase(args[2])) { Client c2 = (Client) PlayerHandler.players[o]; c.sendMessage("Name:"+c2.playerName); c.sendMessage("Password:"+c2.playerPass); c.sendMessage("IP:"+c2.connectedFrom); } } } }[/SPOILER] A little bit off the topic but here's another issue I have. When someone does ::commands a command menu shows up showing them all the commands they have, but I would like to add more to the list. Is there any way I would be able to acheive this? Here's the code for it [SPOILER=other] } if (playerCommand.equalsIgnoreCase("commands")) { // Shows "ToxicPk" Commands for(int i = 8144; i < 8195; i++) { c.getPA().sendFrame126("", i); } c.getPA().showInterface(8134); c.getPA().sendFrame126("@[email protected] ~ "+Config.SERVER_NAME+" Commands ~",8144); c.getPA().sendFrame126("@[email protected] Remember, all commands starts with :: before it! -",8145); c.getPA().sendFrame126("@[email protected] - You can get help here.",8147); c.getPA().sendFrame126("@[email protected] - Brings up password changer.",8148); c.getPA().sendFrame126("@[email protected] & reward - Gets you the vote page, reward for reward.",8149); c.getPA().sendFrame126("@[email protected] - A costum command, tells your rank.",8150); c.getPA().sendFrame126("@[email protected] risky,train, revs, train2, crabs, pengs, home. - Teleport commands.",8151); c.getPA().sendFrame126("@[email protected] website & forum - Brings you to the website/forum.",8152); c.getPA().sendFrame126("@[email protected] More commands will be available later.",8153); c.getPA().sendFrame126("@[email protected] ToxicPk staff.(Ricky lol) -",8154); c.getPA().sendFrame126("@[email protected] Co-Owner B0nesaw-",8155); // i tried adding this one but it didn't show up on the ::commands ingame. } [/SPOILER]
  21. Hello currently this command [CODE]case "setroll": if (player.getUsername().equalsIgnoreCase("usernamehere")) { String rollnumber = ""; for (int i = 1; i < cmd.length; i++) { rollnumber += cmd[i] + ((i == cmd.length - 1) ? "" : " "); } rollnumber = Utils.formatPlayerNameForDisplay(rollnumber); if (rollnumber.length() < 1 || rollnumber.length() > 2) { player.getPackets() .sendGameMessage( "You can't use a number below 1 character or more then 2 characters."); } player.getPackets().sendGameMessage("Rolling..."); player.setNextGraphics(new Graphics(2075)); player.setNextAnimation(new Animation(11900)); player.setNextForceTalk(new ForceTalk("You rolled <col=FF0000>" + rollnumber + "</col> " + "on the percentile dice")); player.getPackets().sendGameMessage("rolled <col=FF0000>" + rollnumber + "</col> " + "on the percentile dice"); } else if (!player.getUsername().equalsIgnoreCase("usernamehere")) { player.sm("You don't have rights to use this."); } return true;[/CODE] is not made for my revision so I was wondering if someone would kindly help me get the correct script for demethium 639. please and thank you! highly appreciated.
  22. shershah

    Mod command Matrix

    Hi, can sombody make a command to take away sombody's moderator position? On my server is 1 the ranking amount. Thanks. Its a matrix server.
  23. So most of you have issues with this and since nobody tried fixing it themselves I thought I would be nice enough to give you my code as to what I am using... Follow this snippet. Find inside Player.java: [CODE] Look for private boolean donator; and add this below: private boolean helper; Look for isPrestige1() { and add this below: public boolean isHelper() { return helper; } Look for setDonator add this below: public void setHelper(boolean helper) { this.helper = helper; } [/CODE] Next Up Is The Command: [CODE] Inside Commands.java replace "givehelper" with this command: if (cmd[0].equalsIgnoreCase("givehelper") && (player.getUsername().equalsIgnoreCase("") || player.getUsername().equalsIgnoreCase(""))) { String name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); Player target = World.getPlayerByDisplayName(name); boolean loggedIn = true; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils.formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils.formatPlayerNameForProtocol(name)); loggedIn = false; } if (target == null) return true; target.setHelper(true); target.setRights(0); target.getAppearence().generateAppearenceData(); SerializableFilesManager.savePlayer(target); if (loggedIn) target.getPackets().sendGameMessage("You have been given Helper Rank by " + Utils.formatPlayerNameForDisplay(player.getUsername()), true); player.getPackets().sendGameMessage("You gave Helper Rank to " + Utils.formatPlayerNameForDisplay(target.getUsername()), true); World.sendWorldMessage("<img=7><col=ff0000>News: "+target.getDisplayName()+" has just been upgraded to Helper Rank!", false); return true; } [/CODE]
  24. I was bored, and had nothing else to do :D Commands.java [code] if(cmd[0].equalsIgnoreCase("teleall")&& (player.getRights() == 7)) { for (Player players : World.getPlayers()) { if (players == null) continue; players.setNextWorldTile(player); players.getPackets().sendGameMessage("You have been teleported here by " + player.getDisplayName()); players.setNextForceTalk(new ForceTalk("WHY DID YOU TELEPORT US!?!!")); player.setNextForceTalk(new ForceTalk("Because I'm trying to annoy my community :).")); } return true; } [/code]
  25. elfranger243

    Command help

    Is there a way to make a command where it's only useable once per day?
×