Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. function listHomes(pl: offline player, p: player, page: number):
  2. set {_liststart} to 9*{_page}
  3. set {_i} to 1
  4. set {_a} to 0
  5. wait 1 second
  6. open virtual chest inventory with size 2 named "&9%{_pl}%&9's Homes" to {_p}
  7. loop {home.%{_pl}%::*}:
  8. set {_home} to loop-value
  9. (loop-index parsed as integer) > {_liststart}
  10. format gui slot {_a} of {_p} with chest named "&d%loop-value%" with lore "&9Right click to delete||&9Left click to TP" to run function homeTp({_pl}, {_p}, {_txt}) with left click
  11. format gui slot {_a} of {_p} with chest named "&d%loop-value%" with lore "&9Right click to delete||&9Left click to TP" to run function homeDel({_p}, {_home}) with right click
  12. add 1 to {_a}
  13. if {_a} = ((9*{_i})):
  14. exit loop
  15. format gui slot 13 of {_p} with eye of ender named "&dRefresh" to run function listHomes({_pl}, {_p}, 0)
  16. if {homes-count.%{_pl}%} > {liststart} + 9:
  17. format gui slot 17 of {_p} with emerald named "&dNext Page" to run function listHomes({_pl}, {_p}, ({_page} + 1))
  18. if {_page} > 0:
  19. format gui slot 9 of {_p} with emerald named "&dPrevious Page" to run function listHomes({_pl}, {_p}, ({_page} - 1))
  20.  
  21. function homeTp(pl: offline player, p: player, txt: text):
  22. make {_p} execute command "/home %{_pl}%:%{_txt}%"
  23.  
  24. function myhomeTp(p: player, txt: text):
  25. make {_p} execute command "/home %{_txt}%"
  26.  
  27. function homeDel(pl: offline player, p: player, home: text):
  28. loop {home.%{_pl}%::*}:
  29. if "%{_home}%" = "%loop-value%":
  30. delete {home.%{_p}%::%loop-index%}
  31. make {_p} execute command "/essentials:delhome %{_pl}%:%{_home}%"
  32. send "&e&l[&b&lāœ”&e&l] &r&7Deleted home ""%{_home}%""" to {_p}
  33. set {homes-count.%{_p}%} to {homes-count.%{_p}%} - 1
  34. if {homes-count.%{_p}%} < 0:
  35. set {homes-count.%{_p}%} to 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement