NNOF

CHAT

Jul 8th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.45 KB | None | 0 0
  1. #-----------------------#
  2. # My version | Dzikoysk #
  3. #-----------------------#
  4.  
  5. #---------#
  6. # Command #
  7. #---------#
  8.  
  9. command /chat [<text>] [<text>] [<text>]:
  10. trigger:
  11. if arg 1 is not empty:
  12. if player has permissions "mchat.pomoc":
  13. else:
  14. message "----- &3CHAT POMOC &f-----"
  15. message " &9/chat &c- ogolna pomoc"
  16. message " &9/chat off &c- wylacz czat"
  17. message " &9/chat off <powod> &c- wylacz czat z powodem"
  18. message " &9/chat on &c- wlacza chat"
  19. message " &9/chat temp <czas w sekundach> &c- wylacza chat czasowo"
  20. message " &9/chat mow <czas w sekundach> <nick> &c- Daje prawo pisania nawet gdy chat jest wylaczony"
  21. message " &9/chat dodaj admina <nick>"
  22. if arg 1 is "off":
  23. if player has permissions "mchat.off":
  24. if arg 2 is not empty:
  25. broadcast ""
  26. broadcast " &4HC-ZIELONY "
  27. broadcast " &7Chat zostal &awylaczony "
  28. broadcast " 7&Powod:&c%arg 2% "
  29. broadcast ""
  30. else:
  31. broadcast ""
  32. broadcast " &4HC-ZIELONY "
  33. broadcast " &7Chat zostal &awylaczony "
  34. broadcast ""
  35. else:
  36. send "Blad: &cNie masz permisjii!"
  37. if arg 1 is "on":
  38. if player has permissions "mchat.on":
  39. set {chat.on} to true
  40. broadcast ""
  41. broadcast " &4HC-ZIELONY "
  42. broadcast " &7Chat zostal &awlaczony "
  43. broadcast ""
  44. else:
  45. send "&cNie masz permisjii!"
  46. if arg 1 is "temp":
  47. if player has permissions "mchat.temp":
  48. if arg 2 is not empty:
  49. make player execute command "chattime %arg 2 %"
  50. set {chat.temp.allow} to true
  51. wait 1 tick
  52. set {chat.on} to false
  53. wait 1 tick
  54. broadcast ""
  55. broadcast " &4HC-ZIELONY "
  56. broadcast " &7Chat zostal &awylaczony "
  57. broadcast " 7&Czas:&c%arg 2% sekund "
  58. broadcast ""
  59. else:
  60. send "&4Blad: &cWpisz czas na ktory ma byc wylaczony czat"
  61. else:
  62. send "&4Blad: &cNie masz permisjii!"
  63. if arg 1 is "mow":
  64. if player has permissions "mchat.mow":
  65. if arg 2 is not empty:
  66. if arg 3 is not empty:
  67. set {chat.mow} to true
  68. set {chat.mow.%arg 3%} to true
  69. broadcast "%name of player% &adal prawo glosu &6%arg 3%&a na &6%arg 2% sekund"
  70. set {chat.player} to arg 3
  71. make player execute command "chattime2 %arg 2%"
  72. else:
  73. send "&cWpisz nick gracza"
  74. else:
  75. send "&cWpisz czas na ktory gracz ma miec mozliwosc pisania"
  76. else:
  77. send "&cNie masz permisjii!"
  78. if arg 1 is "dodaj":
  79. if arg 2 is "admina":
  80. if arg 3 is not empty:
  81. set {chat.admin.%arg 3%} to true
  82. else:
  83. send "&4Blad: &cPodaj nazwe admina"
  84.  
  85.  
  86.  
  87. command /chattime <integer>:
  88. trigger:
  89. if player has permissions "mchat.temp":
  90. set {time} to arg 1
  91. set {limit} to 10000000000
  92. set {counter} to 0
  93. set {limit2} to 0
  94.  
  95. command /chattime2 <integer>:
  96. trigger:
  97. if player has permissions "mchat.temp":
  98. set {time0} to arg 1
  99. set {limit0} to 10000000000
  100. set {counter0} to 0
  101. set {limit20} to 0
  102.  
  103. #--------#
  104. # Events #
  105. #--------#
  106.  
  107. Every 1 seconds:
  108. if {chat.temp.allow} is true:
  109. if {time} is not set:
  110. stop
  111. if {limit} is not set:
  112. stop
  113. add 1 to {counter}
  114. if {counter} is {time}:
  115. set {chat.on} to true
  116. broadcast "&aWlaczono czat!"
  117. set {chat.temp.allow} to false
  118. set {counter} to 0
  119. add 1 to {limit2}
  120. if {limit} is {limit2}:
  121. delete {time}
  122. delete {counter}
  123. delete {limit}
  124. delete {limit2}
  125. if {chat.mow} is true:
  126. if {time0} is not set:
  127. stop
  128. if {limit0} is not set:
  129. stop
  130. add 1 to {counter0}
  131. if {counter0} is {time0}:
  132. set {chat.mow} to false
  133. send "Skonczyl Ci sie czas" to {chat.player}
  134. broadcast "&cCzas &6%{chat.player}%&c skonczyl sie!"
  135. set {chat.mow.%{chat.player}%} to true
  136. clear {chat.player}
  137. set {counter0} to 0
  138. add 1 to {limit20}
  139. if {limit0} is {limit20}:
  140. delete {time0}
  141. delete {counter0}
  142. delete {limit0}
  143. delete {limit20}
  144.  
  145. on chat:
  146. if {chat.on} is false:
  147. if {chat.mow.%player%} is false:
  148. send "&cChat jest wylaczony"
  149. cancel event
  150. stop
  151. if {chat.admin.%player%} is true:
  152. stop
  153. if {chat.on} is true:
  154. stop
Advertisement
Add Comment
Please, Sign In to add comment