Advertisement
70sOn7

Gangs

Dec 22nd, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1. on chat:
  2. cancel event
  3. if {gangs.%player%} is not set:
  4. broadcast "&8[&2*&8] %player's displayname% &2➸ &f%message%"
  5. if {gangs.%player%} is set:
  6. broadcast "&8[&2%{gangs.%player%}%] %player's displayname% &2➸ &f%message%"
  7.  
  8. command /gangs [<text>] [<text>]:
  9. aliases: /gang
  10. permission: server.clans
  11. permission message: &cYou do not have the correct permission for this command!
  12. trigger:
  13. if arg-1 is not set:
  14. send "&2Gangs:"
  15. send ""
  16. send "&c/gangs create (Creates a gang)"
  17. send "&c/gangs invite (Invites a player)"
  18. send "&c/gangs kick (Kicks a player from your gang)"
  19. send "&c/gangs leave (Leaves a gang)"
  20. send "&c/gangs join (Joins a gang)"
  21. stop
  22. if arg-1 is not "create" or "invite" or "kick" or "leave" or "join":
  23. send "&2Gangs:"
  24. send ""
  25. send "&c/gangs create (Creates a gang)"
  26. send "&c/gangs invite (Invites a player)"
  27. send "&c/gangs kick (Kicks a player from your gang)"
  28. send "&c/gangs leave (Leaves a gang)"
  29. send "&c/gangs join (Joins a gang)"
  30. stop
  31. if arg-1 is "create":
  32. if arg-2 is not set:
  33. send "&2Error: &c/gangs create (Name)"
  34. stop
  35. if arg-2 is set:
  36. if {gangs.%player%} is set:
  37. send "&2Error: &cYou are already in a gang!"
  38. stop
  39. if {gangs.%player%} is not set:
  40. if {gangs.created.%arg-2%} is true:
  41. send "&2Error: &cThis gang is already created!"
  42. stop
  43. if arg-2 is "*":
  44. send "&2Error: &cThis gang is already created!"
  45. stop
  46. if {gangs.created.%arg-2%} is not set:
  47. send "&2Gangs: &cYou created a gang!"
  48. set {gangs.%player%} to "%arg-2%"
  49. set {gangs.created.%arg-2%} to true
  50. set {gangs.%arg-2%.owner} to "%player%
  51. if arg-1 is "invite":
  52. if arg-2 is not set:
  53. send "&2Error: &c/gangs invite (Name)"
  54. stop
  55. if arg-2 is set:
  56. if {gangs.%player%} is not set:
  57. send "&2Error: &cYou are not in a gang!"
  58. stop
  59. if {gangs.%{gangs.%player%}%.owner} is not "%player%":
  60. send "&2Error: &cYou cannot invite people!"
  61. stop
  62. if {gangs.%{gangs.%player%}%.owner} is "%player%":
  63. if {gangs.invite.%arg-2%.%player%} is not set:
  64. set {gangs.invite.%arg-2%.%player%} to true
  65. send "&2Gangs: &cYou invited &2%arg-2% &cto your gang!"
  66. send "&2Gangs: &cYou have been to join &2%player%'s &cgang!" to arg 2
  67. send "&2Gangs: &cDo &2/gangs join %player% &cto join!" to arg 2
  68. wait 30 seconds
  69. delete {gangs.invite.%arg-2%.%player%}
  70. if {gangs.invite.%arg-2%.%player%} is true:
  71. send "&2Gangs: &cYou already have a pending invite!"
  72. stop
  73. if arg-1 is "kick":
  74. if arg-2 is not set:
  75. send "&2Error: &c/gangs kick (Name)"
  76. stop
  77. if {gang.%player%} is not set:
  78. send "&2Error: &cYou are not in a gang!"
  79. stop
  80. if arg-2 is set:
  81. if {gangs.%player%} is set:
  82. if {gangs.%arg-2%} is not "%{gangs.%player%}%":
  83. send "&2Error: &cThat player is not in your gang!"
  84. stop
  85. if {clans.%arg-2%} is "%{clans.%player%}%":
  86. send "&2Gangs: &cYou have kicked &6%arg-2% &efrom the gang!"
  87. send "&2Gangs: &cYou have been kicked for the gang!" to arg 2
  88. delete {clans.%arg-2%}
  89. if arg-1 is "leave":
  90. if {gangs.%player%} is not set:
  91. send "&2Error: &cYou are not in a clan!"
  92. stop
  93. if {gangs.%player%} is set:
  94. if {gangs.%{gangs.%player%}%.owner} is "%player%":
  95. loop all players:
  96. if {gangs.%loop-player%} is "%{gangs.%player%}%":
  97. send "&2Gangs: &cYour gang has been disbanded" to loop-player
  98. delete {gangs.created.%{gangs.%player%}%}
  99. delete {gangs.%{gangs.%player%}%.owner}
  100. delete {gangs.%loop-player%}
  101. if arg-1 is "join":
  102. if arg-2 is not set:
  103. send "&2Error: &c/gangs join (Clan Owner)"
  104. stop
  105. if arg-2 is set:
  106. if {gangs.%player%} is set:
  107. send "&2Error: &cYou are already in a gang!"
  108. stop
  109. if {gangs.%player%} is not set:
  110. if {gangs.invited.%player%.%arg-2%} is not set:
  111. send "&2Error: &cYou have not been invited to this gang!"
  112. stop
  113. if {gangs.invite.%player%.%arg-2%} is true:
  114. send "&2Gangs: &cYou have joined &6%arg-2%'s &egang!"
  115. loop all players:
  116. if {gangs.%loop-player%} is "%arg-2%":
  117. send "&2Gangs: &c%player% &ehas joined your gang!" to loop-player
  118. set {gangs.%player%} to "%arg-2%"
  119.  
  120. on damage:
  121. if attacker is player:
  122. if victim is player:
  123. if {gangs.%victim%} is "%{gangs.%attacker%}%":
  124. send "&2Gangs: &c%victim% is in your gang!" to attacker
  125. cancel event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement