Advertisement
krzysek

WarpsPlus script

Sep 16th, 2014
1,249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.42 KB | None | 0 0
  1. # # # # # # # # # # # # # #
  2. # !WarpsPlus #
  3. # Author: krzysek #
  4. # Version: 1.0 #
  5. # #
  6. # Do not edit code ! #
  7. # ( But options :) ) #
  8. # #
  9. # Depends: #
  10. # - Skript 2.0.2 #
  11. # (or better) #
  12. # #
  13. # Script will be better #
  14. # works if your Skript #
  15. # plugin has been #
  16. # connected to database #
  17. # # # # # # # # # # # # # #
  18.  
  19. Options:
  20.  
  21. #Time after player has been teleported to warp
  22. TeleportWaitTime: 5 # in seconds
  23.  
  24. Command /warpsplus [<text>] [<text>]:
  25. aliases: warpsp, warpp, wsp
  26. description: WarpsPlus commands ;)
  27. trigger:
  28. if argument 1 isn't set:
  29. message "&4Correct usage: &f/warpp create/move/delete/teleport/list/help"
  30. stop
  31. else:
  32. set {_arg1} to "%argument 1%"
  33. if {_arg1} is "help":
  34. message "&5===============[&6&lWarpsPlus&5]==============="
  35. message "&5 + &6/warpp create [name] &f- &6Create a new warp."
  36. message "&5 + &6/warpp move [name] &f- &6Move a location of warp to yours."
  37. message "&5 + &6/warpp delete [name] &f- &6Delete a warp."
  38. message "&5 + &6/warpp teleport [name] &f- &6Teleport to the warp."
  39. message "&5 + &6/warpp list &f- &6List of all warps."
  40. message "&5 + &6/warpp help &f- &6Help."
  41. message "&5===============[&6&lWarpsPlus&5]==============="
  42. stop
  43. if {_arg1} is "create":
  44. if player has permission "warpp.create" or "warpp.*":
  45. if argument 2 isn't set:
  46. message "&4Correct usage: &f/warpp create [name]"
  47. stop
  48. else:
  49. set {_arg2} to "%argument 2%"
  50. if {warpp::%{_arg2}%} is set:
  51. message "&5[&6&lWarpsPlus&5] &4Warp with this name is arleady exists !"
  52. stop
  53. else:
  54. set {warpp::%{_arg2}%} to location of player
  55. add "%{_arg2}%" to {warpp::list::*}
  56. message "&5[&6&lWarpsPlus&5] &2Warp %{_arg2}% has been created !"
  57. stop
  58. else:
  59. message "&4You don't have permission to this command !"
  60. stop
  61. if {_arg1} is "move":
  62. if player has permission "warpp.move" or "warpp.*":
  63. if argument 2 isn't set:
  64. message "&4Correct usage: &f/warpp move [name]"
  65. stop
  66. else:
  67. set {_arg2} to "%argument 2%"
  68. if {warpp::%{_arg2}%} isn't set:
  69. message "&5[&6&lWarpsPlus&5] &4Warp with this name isn't exists !"
  70. stop
  71. else:
  72. delete {warpp::%{_arg2}%}
  73. wait 1 tick
  74. set {warpp::%{_arg2}%} to location of player
  75. message "&5[&6&lWarpsPlus&5] &2Warp %{_arg2}% has been moved to yours location."
  76. stop
  77. else:
  78. message "&4You don't have permission to this command !"
  79. stop
  80. if {_arg1} is "delete":
  81. if player has permission "warpp.delete" or "warpp.*":
  82. if argument 2 isn't set:
  83. message "&4Correct usage: &f/warpp delete [name]"
  84. stop
  85. else:
  86. set {_arg2} to "%argument 2%"
  87. if {warpp::%{_arg2}%} isn't set:
  88. message "&5[&6&lWarpsPlus&5] &4Warp with this name isn't exists !"
  89. stop
  90. else:
  91. delete {warpp::%{_arg2}%}
  92. remove "%{_arg2}%" from {warpp::list::*}
  93. message "&5[&6&lWarpsPlus&5] &2Warp %{_arg2}% has been deleted !"
  94. stop
  95. else:
  96. message "&4You don't have permission to this command !"
  97. stop
  98. if {_arg1} is "teleport":
  99. if player has permission "warpp.teleport" or "warpp.*":
  100. if argument 2 isn't set:
  101. message "&4Correct usage: &f/warpp teleport [name]"
  102. stop
  103. else:
  104. set {_arg2} to "%argument 2%"
  105. if {warpp::%{_arg2}%} isn't set:
  106. message "&5[&6&lWarpsPlus&5] &4Warp with this name isn't exists !"
  107. stop
  108. else:
  109. set {_time} to {@TeleportWaitTime}
  110. if {player::%player%::teleport} is set:
  111. message "&5[&6&lWarpsPlus&5] &4You are arleady in teleportation !"
  112. stop
  113. else:
  114. set {player::%player%::teleport} to location of player
  115. message "&5[&6&lWarpsPlus&5] &2Teleporting to %{_arg2}% Warp..."
  116. wait {@TeleportWaitTime} seconds
  117. if location of player isn't {player::%player%::teleport}:
  118. message "&5[&6&lWarpsPlus&5] &4You moved ! Teleportation cancelled !"
  119. stop
  120. else:
  121. teleport player to {warpp::%{_arg2}%}
  122. delete {player::%player%::teleport}
  123. message "&5[&6&lWarpsPlus&5] &2You has been teleported to %{_arg2}% Warp."
  124. stop
  125. else:
  126. message "&4You don't have permission to this command !"
  127. stop
  128. if {_arg1} is "list":
  129. if player has permission "warpp.list" or "warpp.*":
  130. if {warpp::list::*} isn't set:
  131. message "&5[&6&lWarpsPlus&5] &4No warp exists !"
  132. stop
  133. else:
  134. message "&5===============[&6&lWarps&5]==============="
  135. message "&6%{warpp::list::*}%"
  136. message "&5===============[&6&lWarps&5]==============="
  137. stop
  138.  
  139. # Sign support
  140.  
  141. On sign change:
  142. if line 1 is "[warpp]":
  143. if line 2 is "teleport":
  144. if line 3 is "":
  145. set line 1 to "&4Incorrect"
  146. set line 2 to "&4Sign"
  147. set line 3 to "&4Syntax"
  148. set line 4 to "&4!"
  149. stop
  150. else:
  151. set line 1 to "[&6&lWARPP&0]"
  152. set line 2 to "&2Teleport"
  153. set line 3 to "%line 3%"
  154. set line 4 to "created"
  155. wait 1 second
  156. set line 4 to " "
  157. stop
  158.  
  159. On right click on sign:
  160. if line 1 is "[&6&lWARPP&0]":
  161. if line 2 is "&2Teleport":
  162. if line 3 is "":
  163. message "&4Incorrect syntax !"
  164. stop
  165. else:
  166. execute player command "warpp teleport %line 3%"
  167. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement