Guest User

RLSk-Telephone

a guest
Sep 2nd, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.74 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. delete {RP.Historique.%player%::%arg 2%}
  158. else if arg-1 is "info2":
  159. open virtual chest inventory with size 1 named "Info : %arg 2%" to player
  160. 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"
  161. 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"
  162. create a gui slot 5 of player with red wool named "&8Retour" to close then run player command "!n° historique" with permission "OP"
  163. else if arg-1 is "delrep":
  164. send "le numéro associé à %arg 2% a été supprimé de votre répertoire"
  165. remove arg-2 from {RP.Repertoire.%player%::*}
  166. else if arg-1 is "n°Index":
  167. loop {RP.Repertoire.%player%::*}:
  168. if loop-value is arg-2:
  169. set {RP.NumSaisie.%player%} to loop-index
  170. make player execute command "!n° n°"
  171.  
  172. command /telephone:
  173. permission: OP
  174. description: Sortir son téléphone.
  175. aliases: phone
  176. trigger:
  177. if {RP.NumSaisie.%player%} is set:
  178. delete {RP.NumSaisie.%player%}
  179. open virtual chest inventory with size 1 named "Téléphone" to player
  180. wait 2 ticks
  181. 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"
  182. 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"
  183. 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"
  184. 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"
  185. set {_temp} to "%tool of player%"
  186. replace all "flansmod " with "" in {_temp}
  187. create a gui slot 6 of player with paper named "Info" with lore "Modèle : %{_temp}%" to do nothing
  188. create a gui slot 8 of player with red wool named "&8Vérouiller" to close
  189.  
  190. command /viewphone:
  191. trigger:
  192. send "%{RP.Phone.%player%}%"
  193. command /deletephone:
  194. trigger:
  195. delete {RP.Phone.%player%}
  196.  
  197. on join:
  198. if {RP.Phone.%player%} isn't set:
  199. set {RP.Phone.%player%} to "06%random integer between 10000000 and 99999999%"
  200. while {RP.Phone.%player%} is in {RP.Phonelist::*}:
  201. set {RP.Phone.%player%} to "06%random integer between 10000000 and 99999999%"
  202. add {RP.Phone.%player%} to {RP.Phonelist::*}
  203. set {RP.Repertoire.%player%::%{RP.Phone.%player%}%} to player
  204. send "Bienvenue &l%player%."
  205. send "Votre numéro de téléphone est &l%{RP.Phone.%player%}%"
  206.  
  207. on rightclick with 7491 or 7589 or 7616 or 7613 or 7619:
  208. make player execute command "phone" with permission "OP"
  209.  
  210. on chat:
  211. if {RP.Chat.%player%} is "SMSStaff":
  212. cancel event
  213. send "Le standard va dispatcher votre message..."
  214. set {_counter} to 0
  215. loop all players:
  216. if loop-player has permission "admin.*":
  217. add 1 to {_counter}
  218. send "%{RP.Phone.%player%}% (%player%) --> %message%" to loop-player
  219. set {_find} to "Venant de : %player%"
  220. if size of {RP.Historique.%loop-player%::*} is 52 :
  221. send "Attention : Votre historique est plein." to loop-player
  222. else:
  223. set {RP.Historique.%loop-player%::%{_find}%} to message
  224. send "Le standard a trouvé %{_counter}% staff(s)."
  225. if {_counter} is bigger than 0:
  226. send "%message% --> STAFF"
  227. set {_temp} to "Vers : STAFF"
  228. if size of {RP.Historique.%player%::*} is 52 :
  229. send "Attention : Votre historique est plein."
  230. else:
  231. set {RP.Historique.%player%::%{_temp}%} to message
  232. delete {RP.Chat.%player%}
  233. else if {RP.Chat.%player%} is "SMSPolice":
  234. cancel event
  235. send "Le standard va dispatcher votre message..."
  236. send "ERREUR : Numéro inconnu (bientôt rajouté)"
  237. delete {RP.Chat.%player%}
  238. else if {RP.Chat.%player%} is "SMSAmbulance":
  239. cancel event
  240. send "Le standard va dispatcher votre message..."
  241. send "ERREUR : Numéro inconnu (bientôt rajouté)"
  242. delete {RP.Chat.%player%}
  243. else if {RP.Chat.%player%} is "SMSTaxi":
  244. cancel event
  245. send "Le standard va dispatcher votre message..."
  246. send "ERREUR : Numéro inconnu (bientôt rajouté)"
  247. delete {RP.Chat.%player%}
  248. else if {RP.Chat.%player%} is "SMSSaisie":
  249. cancel event
  250. make player execute command "&sms %{RP.NumSaisie.%player%}% %message%" with permission "OP"
  251. delete {RP.NumSaisie.%player%}
  252. delete {RP.Chat.%player%}
  253. else if {RP.Chat.%player%} is "REPRegister":
  254. cancel event
  255. set {RP.Repertoire.%player%::%{RP.NumSaisie.%player%}%} to message
  256. send "Le numéro %{RP.NumSaisie.%player%}% est enregistré au nom de %message%"
  257. delete {RP.NumSaisie.%player%}
  258. delete {RP.Chat.%player%}
Advertisement
Add Comment
Please, Sign In to add comment