Guest User

Telephone SK

a guest
Aug 25th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.73 KB | None | 0 0
  1. #=== Téléphone Sk ===#
  2. # By LavaPower #
  3. #====================#
  4. # Dépendance : #
  5. # - Skript #
  6. # - TuSKe #
  7. #====================#
  8.  
  9. command /&sms <text> <text>:
  10. permission: OP
  11. description: Envoyer un sms
  12. trigger:
  13. loop {RP.Phonelist::*}:
  14. if loop-value is arg-1:
  15. set {_use} to 1
  16. if {_use} is 1:
  17. loop all players:
  18. if {RP.Phone.%loop-player%} is arg-1:
  19. if arg-2 is set:
  20. loop {RP.Repertoire.%loop-player%::*}:
  21. if loop-index is " %arg 1%":
  22. set {_find} to loop-value-2
  23. if {_find} is set:
  24. send "%{_find}% --> %arg 2%" to loop-player
  25. set {_find} to "Venant de : %{_find}%"
  26. if size of {RP.Historique.%loop-player%::*} is 52 :
  27. send "Attention : Votre historique est plein." to loop-player
  28. else:
  29. set {RP.Historique.%loop-player%::%{_find}%} to arg-2
  30. else:
  31. send "%arg 1% --> %arg 2%" to loop-player
  32. set {_find} to "Venant de : %arg 1%"
  33. if size of {RP.Historique.%loop-player%::*} is 52 :
  34. send "Attention : Votre historique est plein." to loop-player
  35. else:
  36. set {RP.Historique.%loop-player%::%{_find}%} to arg-2
  37. loop {RP.Repertoire.%player%::*}:
  38. if loop-index is " %arg 1%":
  39. set {_find} to loop-value-2
  40. if {_find} is set:
  41. send "%arg 2% --> %{_find}%"
  42. set {_find} to "Vers : %{_find}%"
  43. if size of {RP.Historique.%player%::*} is 52 :
  44. send "Attention : Votre historique est plein."
  45. else:
  46. set {RP.Historique.%player%::%{_find}%} to arg-2
  47. else:
  48. set {_find} to "Vers : %arg 1%"
  49. if size of {RP.Historique.%player%::*} is 52 :
  50. send "Attention : Votre historique est plein."
  51. else:
  52. set {RP.Historique.%player%::%{_find}%} to arg 2
  53. else:
  54. send "&4[ERREUR] Usage : /sms <N°> <Text>"
  55. set {_send} to "1"
  56. if {_send} isn't set:
  57. send "Ce numéro n'est pas sous couverture. Sms non reçu"
  58. else if arg-1 is set:
  59. send "Ce numéro n'est pas atribué. Sms non envoyé"
  60. else:
  61. send "&4[ERREUR] Usage : /sms <N°> <Text>"
  62.  
  63. command /!n° <text> [<text>]:
  64. permission: OP
  65. description: Liste des N° de téléphone
  66. trigger:
  67. if arg-1 is "important":
  68. open virtual chest inventory with size 1 named "N° Important" to player
  69. create a gui slot 2 of player with paper named "Taxi" with lore "Besoin de se déplacer ?" to close then run player command "!n° taxi" with permission "OP"
  70. create a gui slot 3 of player with paper named "Police" with lore "Besoin d'un policier ?" to close then run player command "!n° police" with permission "OP"
  71. create a gui slot 4 of player with paper named "Ambulance" with lore "Besoin d'un médecin ?" to close then run player command "!n° ambulance" with permission "OP"
  72. create a gui slot 5 of player with paper named "Staff" with lore "Besoin d'un admin ?" to close then run player command "!n° staff" with permission "OP"
  73. create a gui slot 6 of player with red wool named "&8Retour" to close then run player command "phone" with permission "OP"
  74. else if arg-1 is "staff":
  75. send "Entrez votre message :"
  76. set {RP.Chat.%player%} to "SMSStaff"
  77. else if arg-1 is "police":
  78. send "Entrez votre message :"
  79. set {RP.Chat.%player%} to "SMSPolice"
  80. else if arg-1 is "ambulance":
  81. send "Entrez votre message :"
  82. set {RP.Chat.%player%} to "SMSAmbulance"
  83. else if arg-1 is "taxi":
  84. send "Entrez votre message :"
  85. set {RP.Chat.%player%} to "SMSTaxi"
  86. else if arg-1 is "saisie":
  87. if {RP.NumSaisie.%player%} isn't set:
  88. set {RP.NumSaisie.%player%} to " "
  89. open virtual chest inventory with size 4 named "Clavier" to player
  90. create a gui slot 3 of player with paper named "1" with lore "Appuyer sur 1" to close then run player command "!n° add 1" with permission "OP"
  91. create a gui slot 4 of player with paper named "2" with lore "Appuyer sur 2" to close then run player command "!n° add 2" with permission "OP"
  92. create a gui slot 5 of player with paper named "3" with lore "Appuyer sur 3" to close then run player command "!n° add 3" with permission "OP"
  93. create a gui slot 12 of player with paper named "4" with lore "Appuyer sur 4" to close then run player command "!n° add 4" with permission "OP"
  94. create a gui slot 13 of player with paper named "5" with lore "Appuyer sur 5" to close then run player command "!n° add 5" with permission "OP"
  95. create a gui slot 14 of player with paper named "6" with lore "Appuyer sur 6" to close then run player command "!n° add 6" with permission "OP"
  96. create a gui slot 21 of player with paper named "7" with lore "Appuyer sur 7" to close then run player command "!n° add 7" with permission "OP"
  97. create a gui slot 22 of player with paper named "8" with lore "Appuyer sur 8" to close then run player command "!n° add 8" with permission "OP"
  98. create a gui slot 23 of player with paper named "9" with lore "Appuyer sur 9" to close then run player command "!n° add 9" with permission "OP"
  99. create a gui slot 30 of player with paper named "-" with lore "Appuyez sur -" to close then run player command "!n° add -" with permission "OP"
  100. create a gui slot 31 of player with name tag named "%{RP.NumSaisie.%player%}%" with lore "N° Affiché à l'écran" to do nothing
  101. create a gui slot 32 of player with paper named "0" with lore "Appuyer sur 0" to close then run player command "!n° add 0" with permission "OP"
  102. create a gui slot 27 of player with green wool named "Valider" with lore "Valider le n° composé" to close then run player command "!n° valide"
  103. create a gui slot 35 of player with red wool named "&8Retour" to close then run player command "phone" with permission "OP"
  104. else if arg-1 is "add":
  105. set {RP.NumSaisie.%player%} to "%{RP.NumSaisie.%player%}%%arg-2%"
  106. make player execute command "!n° saisie" with permission "OP"
  107. else if arg-1 is "historique":
  108. open virtual chest inventory with size 6 named "Historique" to player
  109. set {_counter} to 0
  110. loop {RP.Historique.%player%::*}:
  111. make gui slot {_counter} of player with paper named "%loop-index%" with lore "%loop-value%" to close then run player command "/!n° info2 %loop-index%"
  112. add 1 to {_counter}
  113. create a gui slot 53 of player with red wool named "&8Retour" to close then run player command "phone" with permission "OP"
  114. else if arg-1 is "valide":
  115. open virtual chest inventory with size 1 named "N° : %{RP.NumSaisie.%player%}%" to player
  116. create a gui slot 3 of player with green wool named "SMS" with lore "Envoyer un sms au n°" to close then run player command "!n° n°" with permission "OP"
  117. create a gui slot 4 of player with yellow wool named "Répertoire" with lore "Ajouter le n° au répertoire" to close then run player command "!n° rep" with permission "OP"
  118. create a gui slot 5 of player with red wool named "&8Retour" to close then run player command "!n° saisie" with permission "OP"
  119. else if arg-1 is "n°":
  120. send "Entrez votre message :"
  121. set {RP.Chat.%player%} to "SMSSaisie"
  122. else if arg-1 is "nS":
  123. set {_mess} to arg-2
  124. replace all "venant de : " with "" in {_mess}
  125. replace all "vers : " with "" in {_mess}
  126. loop {RP.Phonelist::*}:
  127. if loop-value is {_mess}:
  128. set {_use} to 1
  129. if {_use} is 1:
  130. set {RP.NumSaisie.%player%} to {_mess}
  131. else:
  132. loop {RP.Repertoire.%player%::*}:
  133. if loop-value is {_mess}:
  134. set {RP.NumSaisie.%player%} to loop-index
  135. make player execute command "!n° n°"
  136. else if arg-1 is "rep":
  137. if size of {RP.Repertoire.%player%::*} is 51 :
  138. send "ERREUR : Votre répertoire est plein."
  139. else:
  140. send "Entrez le nom d'enregistrement :"
  141. set {RP.Chat.%player%} to "REPRegister"
  142. else if arg-1 is "repertoire":
  143. open virtual chest inventory with size 6 named "Répertoire" to player
  144. set {_counter} to 0
  145. loop {RP.Repertoire.%player%::*}:
  146. make gui slot {_counter} of player with paper named "%loop-value%" with lore "%loop-index%" to close then run player command "/!n° info %loop-value%"
  147. add 1 to {_counter}
  148. create a gui slot 52 of player with name tag named "MOI" with lore "%{RP.Phone.%player%}%" to do nothing
  149. create a gui slot 53 of player with red wool named "&8Retour" to close then run player command "phone" with permission "OP"
  150. else if arg-1 is "info":
  151. open virtual chest inventory with size 1 named "Info : %arg 2%" to player
  152. create a gui slot 3 of player with green wool named "SMS" with lore "Envoyer un sms à %arg 2%" to close then run player command "!n° n°Index %arg 2%" with permission "OP"
  153. create a gui slot 4 of player with yellow wool named "Historique" with lore "Supprimer %arg 2% de l'historique" to close then run player command "!n° delrep %arg 2%" with permission "OP"
  154. create a gui slot 5 of player with red wool named "&8Retour" to close then run player command "!n° repertoire" with permission "OP"
  155. else if arg-1 is "delhist":
  156. send "l'historique %arg 2% a été supprimé"
  157. set {_temp} to {RP.Repertoire.%player%::%arg 2%}
  158. remove {_temp} from {RP.Repertoire.%player%::*}
  159. delete {RP.Repertoire.%player%::%arg 2%}
  160. else if arg-1 is "info2":
  161. open virtual chest inventory with size 1 named "Info : %arg 2%" to player
  162. create a gui slot 3 of player with green wool named "SMS" with lore "Envoyer un sms à %arg 2%" to close then run player command "!n° nS %arg 2%" with permission "OP"
  163. create a gui slot 4 of player with yellow wool named "Répertoire" with lore "Supprimer %arg 2% du répertoire" to close then run player command "!n° delhist %arg 2%" with permission "OP"
  164. create a gui slot 5 of player with red wool named "&8Retour" to close then run player command "!n° historique" with permission "OP"
  165. else if arg-1 is "delrep":
  166. send "le numéro associé à %arg 2% a été supprimé de votre répertoire"
  167. remove arg-2 from {RP.Repertoire.%player%::*}
  168. else if arg-1 is "n°Index":
  169. loop {RP.Repertoire.%player%::*}:
  170. if loop-value is arg-2:
  171. set {RP.NumSaisie.%player%} to loop-index
  172. make player execute command "!n° n°"
  173.  
  174. command /telephone:
  175. permission: OP
  176. description: Sortir son téléphone.
  177. aliases: phone
  178. trigger:
  179. if {RP.NumSaisie.%player%} is set:
  180. delete {RP.NumSaisie.%player%}
  181. open virtual chest inventory with size 1 named "Téléphone" to player
  182. create a gui slot 2 of player with paper named "Historique" with lore "Historique des derniers SMS" to close then run player command "!n° historique" with permission "OP"
  183. create a gui slot 3 of player with paper named "Répertoire" with lore "Liste des N° enregistrés" to close then run player command "!n° repertoire" with permission "OP"
  184. create a gui slot 4 of player with paper named "Clavier" with lore "Composer un n°" to close then run player command "!n° saisie" with permission "OP"
  185. create a gui slot 5 of player with paper named "N° Important" with lore "Liste les N° importants" to close then run player command "!n° important" with permission "OP"
  186. create a gui slot 6 of player with paper named "Info" with lore "Modèle : %name of player's tool%" to do nothing
  187. create a gui slot 8 of player with red wool named "&8Vérouiller" to close
  188.  
  189. command /viewphone:
  190. trigger:
  191. send "%{RP.Phone.%player%}%"
  192. command /deletephone:
  193. trigger:
  194. delete {RP.Phone.%player%}
  195.  
  196. on join:
  197. if {RP.Phone.%player%} isn't set:
  198. set {RP.Phone.%player%} to "06%random integer between 10000000 and 99999999%"
  199. while {RP.Phone.%player%} is in {RP.Phonelist::*}:
  200. set {RP.Phone.%player%} to "06%random integer between 10000000 and 99999999%"
  201. add {RP.Phone.%player%} to {RP.Phonelist::*}
  202. set {RP.Repertoire.%player%::%{RP.Phone.%player%}%} to player
  203. send "Bienvenue &l%player%."
  204. send "Votre numéro de téléphone est &l%{RP.Phone.%player%}%"
  205.  
  206. on rightclick with book:
  207. make player execute command "phone" with permission "OP"
  208.  
  209. on chat:
  210. if {RP.Chat.%player%} is "SMSStaff":
  211. cancel event
  212. send "Le standard va dispatcher votre message..."
  213. set {_counter} to 0
  214. loop all players:
  215. if loop-player has permission "admin.*":
  216. add 1 to {_counter}
  217. send "%{RP.Phone.%player%}% (%player%) --> %message%" to loop-player
  218. set {_find} to "Venant de : %player%"
  219. if size of {RP.Historique.%loop-player%::*} is 52 :
  220. send "Attention : Votre historique est plein." to loop-player
  221. else:
  222. set {RP.Historique.%loop-player%::%{_find}%} to message
  223. send "Le standard a trouvé %{_counter}% staff(s)."
  224. if {_counter} is bigger than 0:
  225. send "%message% --> STAFF"
  226. set {_temp} to "Vers : STAFF"
  227. if size of {RP.Historique.%player%::*} is 52 :
  228. send "Attention : Votre historique est plein."
  229. else:
  230. set {RP.Historique.%player%::%{_temp}%} to message
  231. delete {RP.Chat.%player%}
  232. else if {RP.Chat.%player%} is "SMSPolice":
  233. cancel event
  234. send "Le standard va dispatcher votre message..."
  235. send "ERREUR : Numéro inconnu (bientôt rajouté)"
  236. delete {RP.Chat.%player%}
  237. else if {RP.Chat.%player%} is "SMSAmbulance":
  238. cancel event
  239. send "Le standard va dispatcher votre message..."
  240. send "ERREUR : Numéro inconnu (bientôt rajouté)"
  241. delete {RP.Chat.%player%}
  242. else if {RP.Chat.%player%} is "SMSTaxi":
  243. cancel event
  244. send "Le standard va dispatcher votre message..."
  245. send "ERREUR : Numéro inconnu (bientôt rajouté)"
  246. delete {RP.Chat.%player%}
  247. else if {RP.Chat.%player%} is "SMSSaisie":
  248. cancel event
  249. make player execute command "&sms %{RP.NumSaisie.%player%}% %message%" with permission "OP"
  250. delete {RP.NumSaisie.%player%}
  251. delete {RP.Chat.%player%}
  252. else if {RP.Chat.%player%} is "REPRegister":
  253. cancel event
  254. set {RP.Repertoire.%player%::%{RP.NumSaisie.%player%}%} to message
  255. send "Le numéro %{RP.NumSaisie.%player%}% est enregistré au nom de %message%"
  256. delete {RP.NumSaisie.%player%}
  257. delete {RP.Chat.%player%}
Advertisement
Add Comment
Please, Sign In to add comment