LordziaK

rAntyLogout

Aug 9th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. variables:
  2. {logout::%player%} = -1
  3. #=====================================================================#
  4. # Komendy #
  5. #=====================================================================#
  6. command /antylogout [<offlineplayer>]:
  7. trigger:
  8. if arg-1 is not set:
  9. if {logout::%player%} = -1 or 0:
  10. set {commandLogoutFalse} to single value "AntyLogout.message.commandLogoutFalse" get of "plugins/AntyLogout/config.yml"
  11. send "%colored {commandLogoutFalse}%"
  12. else:
  13. set {commandLogoutTrue} to single value "AntyLogout.message.commandLogoutTrue" get of "plugins/AntyLogout/config.yml"
  14. replace "{0}" with "%{logout::%player%}%" in {commandLogoutTrue}
  15. send "%colored {commandLogoutTrue}%"
  16. #=====================================================================#
  17. # Licznik #
  18. #=====================================================================#
  19. every second:
  20. loop all players:
  21. if {logout::%loop-player%} = 0:
  22. remove 1 from {logout::%loop-player%} #Odejmuje 1 zeby nic sie nie bugowalo.
  23. if {opcja} = "1":
  24. set action bar of loop-player to "&4&lANTYLOGOUT &7(&a0sek.&7)"
  25. if {opcja} = "2":
  26. send "%colored {chatAntyLogoutFalse}%" to loop-player
  27. if {opcja} = "3":
  28. wipe loop-player's sidebar
  29. stop
  30. if {logout::%loop-player%} > 0:
  31. if {opcja} = "1":
  32. set action bar of loop-player to "&4&lANTYLOGOUT &7(&c%{logout::%loop-player%}%.&k00&csek&7)"
  33. remove 1 from {logout::%loop-player%}
  34. if {opcja} = "2":
  35. remove 1 from {logout::%loop-player%}
  36. stop
  37. if {opcja} = "3":
  38. remove 1 from {logout::%loop-player%}
  39. set name of sidebar of loop-player to "&4&lANTYLOGOUT!"
  40. set score "&7Czas:" in sidebar of loop-player to {logout::%loop-player%}
  41. stop
  42. on damage:
  43. if {opcja} = "2":
  44. if {logout::%victim%} < 0:
  45. send "%colored {chatAntyLogoutTrue}%" to victim
  46. if {logout::%attacker%} < 0:
  47. send "%colored {chatAntyLogoutTrue}%" to attacker
  48. set {logout::%victim%} to {time}
  49. set {logout::%attacker%} to {time}
  50. #=====================================================================#
  51. # Logout podczas walki #
  52. #=====================================================================#
  53. on quit:
  54. if {logout::%player%} > 0:
  55. kill player
  56. replace "{0}" with "%player%" in {chatQuitOnLogout}
  57. broadcast "%colored {chatQuitOnLogout}%"
  58. set {logout::%player%} to -1
  59. else:
  60. stop
  61. on join:
  62. set {logout::%player%} to -1
  63. #=====================================================================#
  64. # CONFIG (YML) #
  65. #=====================================================================#
  66. on load:
  67. if folder "plugins/AntyLogout" doesn't exists:
  68. create folder "plugins/AntyLogout"
  69. if file "plugins/AntyLogout/config.yml" doesn't exists:
  70. create file "plugins/AntyLogout/config.yml"
  71. download from "https://pastebin.com/raw/x7GtqPNS" to "plugins/AntyLogout/config.yml"
  72. set {opcja} to single value "AntyLogout.options" get of "plugins/AntyLogout/config.yml"
  73. set {time} to single value "AntyLogout.time" get of "plugins/AntyLogout/config.yml"
  74. set {chatAntyLogoutFalse} to single value "AntyLogout.message.chatAntyLogoutFalse" get of "plugins/AntyLogout/config.yml"
  75. set {chatAntyLogoutTrue} to single value "AntyLogout.message.chatAntyLogoutTrue" get of "plugins/AntyLogout/config.yml"
  76. set {chatQuitOnLogout} to single value "AntyLogout.message.chatQuitOnLogout" get of "plugins/AntyLogout/config.yml"
Advertisement
Add Comment
Please, Sign In to add comment