I thought i can make a /tpa Plugin with a boolean, but the boolean is Public and would be for everyone, and i know that there is an easier way to do this. Please help <.< /tpa <player> -> Sends a teleport request to the specific player and he can accept or deny
MinesnHD On command, add a player to a Hashmap, which when they tpaccept, get the player who originally sent the tpa request (which is stored in the hashmap) and teleport them
Code:java Map<String,String> requests = new HashMap<String,String>(); //When a player requests to teleport to another player, add them like so:requests.put(requester,target); //To see if someone has requested to teleport to you:requests.containsValue(yourname) //To get the name of the player who requested to teleport to a player: (returns null if no one found)public String getNameOfRequester(String targetName) { for(Entry<String, String> entry : requests.entrySet()) { if(entry.getValue().equals(targetName)) { return entry.getKey(); } } return null;} You should look up more about HashMaps, they are really useful. Lists and arrays too if you don't know how to use those.