h31ix

Untitled

Jan 22nd, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. //Get the player's home location
  2. public Location getHome(Player player)
  3. {
  4. long x = 0;
  5. long y = 0;
  6. long z = 0;
  7. World a = null;
  8. try {
  9. rs = MCConnection.query("SELECT * FROM "+config.getString("MySQLSettings.Players Table")+" WHERE name='"+player.getName()+"'");
  10. while (rs.next())
  11. {
  12. x = rs.getLong("homex");
  13. y = rs.getLong("homey");
  14. z = rs.getLong("homez");
  15. a = getServer().getWorld(rs.getString("homew"));
  16. }
  17. } catch (SQLException ex) {
  18. Logger.getLogger(Nas.class.getName()).log(Level.SEVERE, null, ex);
  19. }
  20. Location loc = new Location(a, x, y, z);
  21. return loc;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment