Advertisement
ggdu490

c4cportev2

Sep 14th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.03 KB | None | 0 0
  1. options:
  2. logo: &4[&ePorte&4] : &r #Prefix chat
  3. blocks: horizontal pillar quartz block #Bloc a utilisé a la base de la porte
  4. blanc: white glass pane #Choix de la vitre
  5. noir: black glass pane #Choix de la vitre
  6. gris: gray glass pane #Choix de la vitre
  7. grisc: light gray glass pane #Choix de la vitre
  8. bleue: blue glass pane #Choix de la vitre
  9. delvitre: white glass pane or black glass pane or gray glass pane or light gray glass pane or blue glass pane
  10. rayon: 5 #Rayon d'action entre le panneau et l'option blocks défini plus haut
  11.  
  12.  
  13. on rightclick on a sign:
  14. if line 1 is "&e[Porte]":
  15. if player doesn't have permission "sk.modo":
  16. set {_x} to x-location of event-location
  17. set {_y} to y-location of event-location
  18. set {_z} to z-location of event-location
  19. set {_porteallow::*} to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  20. if "%{_porteallow::*}%" doesn't contain "%player's name%":
  21. cancel event
  22. message "{@logo}&4Tu n'es pas autorisé a utiliser cette porte"
  23. else:
  24. if line 2 is "2": #PORTE JOUEUR HAUTEUR 2
  25. if line 3 is "Fermer":
  26. loop blocks in radius {@rayon} around event-block:
  27. loop-block is {@blocks}:
  28. if line 4 is "" or "blanc":
  29. wait 10 ticks
  30. set block 2 meter above loop-block to {@blanc}
  31. set block 1 meter above loop-block to {@blanc}
  32. if line 4 is "noir":
  33. wait 10 ticks
  34. set block 2 meter above loop-block to {@noir}
  35. set block 1 meter above loop-block to {@noir}
  36. if line 4 is "gris":
  37. wait 10 ticks
  38. set block 2 meter above loop-block to {@gris}
  39. set block 1 meter above loop-block to {@gris}
  40. if line 4 is "grisc":
  41. wait 10 ticks
  42. set block 2 meter above loop-block to {@grisc}
  43. set block 1 meter above loop-block to {@grisc}
  44. if line 4 is "bleue":
  45. wait 10 ticks
  46. set block 2 meter above loop-block to {@bleue}
  47. set block 1 meter above loop-block to {@bleue}
  48. loop-block is a sign:
  49. if line 1 is "&e[Porte]":
  50. wait 8 ticks
  51. set line 3 of loop-block to "Ouvrir"
  52. stop
  53.  
  54. if line 3 is "Ouvrir":
  55. loop blocks in radius {@rayon} around event-block:
  56. loop-block is {@blocks}:
  57. wait 10 ticks
  58. set block 2 meter above loop-block to air
  59. set block 1 meter above loop-block to air
  60. loop-block is a sign:
  61. if line 1 is "&e[Porte]":
  62. wait 8 ticks
  63. set line 3 of loop-block to "Fermer"
  64. stop
  65.  
  66. if line 2 is "3": #PORTE JOUEUR HAUTEUR 3
  67. if line 3 is "Fermer":
  68. loop blocks in radius {@rayon} around event-block:
  69. loop-block is {@blocks}:
  70. block above loop-block is air
  71. if line 4 is "" or "blanc":
  72. wait 10 ticks
  73. set block 3 meter above loop-block to {@blanc}
  74. set block 2 meter above loop-block to {@blanc}
  75. set block 1 meter above loop-block to {@blanc}
  76. if line 4 is "noir":
  77. wait 10 ticks
  78. set block 3 meter above loop-block to {@noir}
  79. set block 2 meter above loop-block to {@noir}
  80. set block 1 meter above loop-block to {@noir}
  81. if line 4 is "gris":
  82. wait 10 ticks
  83. set block 3 meter above loop-block to {@gris}
  84. set block 2 meter above loop-block to {@gris}
  85. set block 1 meter above loop-block to {@gris}
  86. if line 4 is "grisc":
  87. wait 10 ticks
  88. set block 3 meter above loop-block to {@grisc}
  89. set block 2 meter above loop-block to {@grisc}
  90. set block 1 meter above loop-block to {@grisc}
  91. if line 4 is "bleue":
  92. wait 10 ticks
  93. set block 3 meter above loop-block to {@bleue}
  94. set block 2 meter above loop-block to {@bleue}
  95. set block 1 meter above loop-block to {@bleue}
  96. loop-block is a sign:
  97. if line 1 is "&e[Porte]":
  98. wait 8 ticks
  99. set line 3 of loop-block to "Ouvrir"
  100. stop
  101.  
  102. if line 3 is "Ouvrir":
  103. loop blocks in radius {@rayon} around event-block:
  104. loop-block is {@blocks}:
  105. block above loop-block is {@delvitre}
  106. wait 10 ticks
  107. set block 3 meter above loop-block to air
  108. set block 2 meter above loop-block to air
  109. set block 1 meter above loop-block to air
  110. loop-block is a sign:
  111. if line 1 is "&e[Porte]":
  112. wait 8 ticks
  113. set line 3 of loop-block to "Fermer"
  114. stop
  115.  
  116. if line 2 is "barriere2": #PORTE JOUEUR BARRIERE
  117. if line 3 is "Fermer":
  118. set line 3 to "Ouvrir"
  119. loop blocks in radius {@rayon} around event-block:
  120. loop-block is cobblestone:
  121. wait 10 ticks
  122. set block 2 meter above loop-block to fence
  123. set block 1 meter above loop-block to fence
  124. loop-block is a sign:
  125. if line 1 is "&e[Porte]":
  126. wait 8 ticks
  127. set line 3 of loop-block to "Fermer"
  128. stop
  129.  
  130. if line 3 is "Ouvrir":
  131. set line 3 to "Fermer"
  132. loop blocks in radius {@rayon} around event-block:
  133. loop-block is cobblestone:
  134. block above loop-block is fence
  135. wait 10 ticks
  136. set block 2 meter above loop-block to air
  137. set block 1 meter above loop-block to air
  138. loop-block is a sign:
  139. if line 1 is "&e[Porte]":
  140. wait 8 ticks
  141. set line 3 of loop-block to "Fermer"
  142. stop
  143. #PORTE MODO
  144. else:
  145. if line 2 is "2":
  146. if line 3 is "Fermer":
  147. set line 3 to "Ouvrir"
  148. loop blocks in radius {@rayon} around event-block:
  149. loop-block is {@blocks}:
  150. if line 4 is "" or "blanc":
  151. wait 10 ticks
  152. set block 2 meter above loop-block to {@blanc}
  153. set block 1 meter above loop-block to {@blanc}
  154. if line 4 is "noir":
  155. wait 10 ticks
  156. set block 2 meter above loop-block to {@noir}
  157. set block 1 meter above loop-block to {@noir}
  158. if line 4 is "gris":
  159. wait 10 ticks
  160. set block 2 meter above loop-block to {@gris}
  161. set block 1 meter above loop-block to {@gris}
  162. if line 4 is "grisc":
  163. wait 10 ticks
  164. set block 2 meter above loop-block to {@grisc}
  165. set block 1 meter above loop-block to {@grisc}
  166. if line 4 is "bleue":
  167. wait 10 ticks
  168. set block 2 meter above loop-block to {@bleue}
  169. set block 1 meter above loop-block to {@bleue}
  170. stop
  171.  
  172. if line 3 is "Ouvrir":
  173. set line 3 to "Fermer"
  174. loop blocks in radius {@rayon} around event-block:
  175. loop-block is {@blocks}:
  176. wait 10 ticks
  177. set block 2 meter above loop-block to air
  178. set block 1 meter above loop-block to air
  179. stop
  180.  
  181.  
  182. if line 2 is "3":
  183. if line 3 is "Fermer":
  184. set line 3 to "Ouvrir"
  185. loop blocks in radius {@rayon} around event-block:
  186. loop-block is {@blocks}:
  187. block above loop-block is air
  188. if line 4 is "" or "blanc":
  189. wait 10 ticks
  190. set block 3 meter above loop-block to {@blanc}
  191. set block 2 meter above loop-block to {@blanc}
  192. set block 1 meter above loop-block to {@blanc}
  193. if line 4 is "noir":
  194. wait 10 ticks
  195. set block 3 meter above loop-block to {@noir}
  196. set block 2 meter above loop-block to {@noir}
  197. set block 1 meter above loop-block to {@noir}
  198. if line 4 is "gris":
  199. wait 10 ticks
  200. set block 3 meter above loop-block to {@gris}
  201. set block 2 meter above loop-block to {@gris}
  202. set block 1 meter above loop-block to {@gris}
  203. if line 4 is "grisc":
  204. wait 10 ticks
  205. set block 3 meter above loop-block to {@grisc}
  206. set block 2 meter above loop-block to {@grisc}
  207. set block 1 meter above loop-block to {@grisc}
  208. if line 4 is "bleue":
  209. wait 10 ticks
  210. set block 3 meter above loop-block to {@bleue}
  211. set block 2 meter above loop-block to {@bleue}
  212. set block 1 meter above loop-block to {@bleue}
  213. stop
  214.  
  215. if line 3 is "Ouvrir":
  216. set line 3 to "Fermer"
  217. loop blocks in radius {@rayon} around event-block:
  218. loop-block is {@blocks}:
  219. block above loop-block is {@delvitre}
  220. wait 10 ticks
  221. set block 3 meter above loop-block to air
  222. set block 2 meter above loop-block to air
  223. set block 1 meter above loop-block to air
  224. stop
  225.  
  226.  
  227. if line 2 is "barriere2":
  228. if line 3 is "Fermer":
  229. set line 3 to "Ouvrir"
  230. loop blocks in radius {@rayon} around event-block:
  231. loop-block is cobblestone:
  232. wait 10 ticks
  233. set block 2 meter above loop-block to fence
  234. set block 1 meter above loop-block to fence
  235. stop
  236.  
  237. if line 3 is "Ouvrir":
  238. set line 3 to "Fermer"
  239. loop blocks in radius {@rayon} around event-block:
  240. loop-block is cobblestone:
  241. block above loop-block is fence
  242. wait 10 ticks
  243. set block 2 meter above loop-block to air
  244. set block 1 meter above loop-block to air
  245. stop
  246.  
  247.  
  248.  
  249.  
  250. #PROTECTION VITRES
  251. on break:
  252. if player's gamemode is survival:
  253. if block is {@delvitre}:
  254. loop blocks in radius {@rayon} around event-block:
  255. loop-block is sign:
  256. if line 1 of loop-block is "&e[Porte]":
  257. cancel event
  258.  
  259. #PROTECTION PANNEAU OWNER ET SUPPRESSION DES FICHIERS
  260. on break:
  261. if block is a sign:
  262. if line 1 is "&e[porte]":
  263. set {_x} to x-location of event-location
  264. set {_y} to y-location of event-location
  265. set {_z} to z-location of event-location
  266. replace all "." with "," in {_x}
  267. replace all "." with "," in {_y}
  268. replace all "." with "," in {_z}
  269. set {_porteowner::*} to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  270. if "%{_porteowner::*}%" doesn't contain "%player's name%":
  271. cancel event
  272. send "{@logo} &4Tu ne peux pas détruire une porte qui ne t'appartiens pas."
  273. else:
  274. df "plugins/Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  275. send "{@logo}&9Le panneau a été supprimé"
  276.  
  277. #COMMANDES ALLOW JOUEUR/MODO
  278. command /porte <text> [<offline player>]:
  279. trigger:
  280. if targeted block is a sign:
  281. if line 1 of targeted block is "&e[Porte]":
  282. set {_x} to x-location of targeted block
  283. set {_y} to y-location of targeted block
  284. set {_z} to z-location of targeted block
  285. replace all "." with "," in {_x}
  286. replace all "." with "," in {_y}
  287. replace all "." with "," in {_z}
  288. set {_porteowner::*} to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  289. set {_porteallow::*} to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  290. if arg 1 is "add":
  291. if player has permission "sk.modo":
  292. if "%{_porteallow::*}%" doesn't contain "%arg 2%":
  293. add "%arg 2%" to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  294. send "{@logo}&e%arg 2% &9 a été ajouté sur cette porte"
  295. else:
  296. send "{@logo}&e%arg 2% &9 est déjà autorisé sur cette porte"
  297. else if "%{_porteallow::*}%" contain "%player's name%":
  298. if "%{_porteallow::*}%" doesn't contain "%arg 2%":
  299. add "%arg 2%" to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  300. send "{@logo}&e%arg 2% &9 a été ajouté sur cette porte"
  301. else:
  302. send "{@logo}&e%arg 2% &9 est déjà autorisé sur cette porte"
  303. else:
  304. send "{@logo}&9Tu n'es pas le propriétaire de cette porte. Tu ne peux pas ajouter de joueurs."
  305. if arg 1 is "del":
  306. if player has permission "sk.modo":
  307. if "%{_porteallow::*}%" doesn't contain "%arg 2%":
  308. send "{@logo}&e%arg 2% &9ne fait pas parti des joueurs autorisé sur cette porte"
  309. else:
  310. remove "%arg 2%" from yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  311. send "{@logo}&e%arg 2% &9 a été supprimé des joueurs autorisé sur cette porte"
  312. else if "%{_porteowner::*}%" contain "%player's name%":
  313. if "%{_porteallow::*}%" doesn't contain "%arg 2%":
  314. send "{@logo}&e%arg 2% &9ne fait pas parti des joueurs autorisé sur cette porte"
  315. else:
  316. remove "%arg 2%" from yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  317. send "{@logo}&e%arg 2% &9 a été ajouté sur cette porte"
  318. else:
  319. send "{@logo}&9Tu n'es pas le propriétaire de cette porte. Tu ne peux pas ajouter de joueurs."
  320. if arg 1 is "list":
  321. set {_porteowner::*} to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  322. set {_porteallow::*} to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  323. send "{@logo}&ePropriétaire: &9%{_porteowner::*}%"
  324. send "{@logo}&eJoueurs autorisés: &9%{_porteallow::*}%"
  325.  
  326.  
  327. #COMMANDES OWNER MODO
  328. command /modoporte <text> <text>:
  329. permission: sk.modo
  330. trigger:
  331. if arg 1 is "add":
  332. if arg 2 is set:
  333. add "%player%" to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  334. send "{@logo}&e%arg 2% a été ajouté a la liste des propriétaires"
  335. else:
  336. send "{@logo}&4Vous devez indiquez un joueur"
  337. if arg 1 is "del":
  338. if arg 2 is set:
  339. remove "%arg 2%" from yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  340. send "{@logo}&e%arg 2% a été supprimé de la liste des propriétaires"
  341. else:
  342. send "{@logo}&4Vous devez indiquez un joueur"
  343.  
  344. #CREATION DES PANNEAUX
  345. #HAUTEUR DE PORTE PAR DEFAULT
  346. on sign change:
  347. if line 1 is "[Porte]":
  348. if line 2 is "":
  349. set line 1 to "&e[Porte]"
  350. set line 2 to "2"
  351. set line 3 to "Fermer"
  352. set line 3 to "Fermer"
  353. set {_x} to x-location of event-location
  354. set {_y} to y-location of event-location
  355. set {_z} to z-location of event-location
  356. replace all "." with "," in {_x}
  357. replace all "." with "," in {_y}
  358. replace all "." with "," in {_z}
  359. add "%player%" to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  360. add "%player%" to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  361. send "{@logo}&9Le panneau a été créer"
  362. stop
  363.  
  364. on sign change:
  365. if line 1 is "[Porte]":
  366. if line 2 is "2":
  367. set line 1 to "&e[Porte]"
  368. set line 3 to "Fermer"
  369. set {_x} to x-location of event-location
  370. set {_y} to y-location of event-location
  371. set {_z} to z-location of event-location
  372. replace all "." with "," in {_x}
  373. replace all "." with "," in {_y}
  374. replace all "." with "," in {_z}
  375. add "%player%" to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  376. add "%player%" to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  377. send "{@logo}&9Le panneau a été créer"
  378. stop
  379. #HAUTEUR DE PORTE 3
  380. on sign change:
  381. if line 1 is "[Porte]":
  382. if line 2 is "3":
  383. set line 1 to "&e[Porte]"
  384. set line 3 to "Fermer"
  385. set line 3 to "Fermer"
  386. set {_x} to x-location of event-location
  387. set {_y} to y-location of event-location
  388. set {_z} to z-location of event-location
  389. replace all "." with "," in {_x}
  390. replace all "." with "," in {_y}
  391. replace all "." with "," in {_z}
  392. add "%player%" to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  393. add "%player%" to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
  394. send "{@logo}&9Le panneau a été créer"
  395. stop
  396.  
  397.  
  398. #CHANGEMENT DE COULEUR DES VITRES
  399. on leftclick on a sign:
  400. if line 1 is "&e[Porte]":
  401. wait 2 ticks
  402. if player's tool is black dye:
  403. set line 4 to "noir"
  404. if player's gamemode is survival:
  405. remove 1 black dye from player
  406. if player's tool is gray dye:
  407. set line 4 to "gris"
  408. if player's gamemode is survival:
  409. remove 1 gray dye from player
  410. if player's tool is light gray dye:
  411. set line 4 to "grisc"
  412. if player's gamemode is survival:
  413. remove 1 light gray dye from player
  414. if player's tool is Lapis Lazuli:
  415. set line 4 to "bleue"
  416. if player's gamemode is survival:
  417. remove 1 Lapis Lazuli from player
  418. if player's tool is white dye:
  419. set line 4 to "blanc"
  420. if player's gamemode is survival:
  421. remove 1 white dye from player
  422.  
  423. #PROTECTION AU CHANGEMENT DE COULEUR SI GMC
  424. on break a sign:
  425. if player's gamemode is creative:
  426. if line 1 is "&e[Porte]":
  427. if player's tool is black dye:
  428. cancel event
  429. if player's tool is gray dye:
  430. cancel event
  431. if player's tool is light gray dye:
  432. cancel event
  433. if player's tool is Lapis Lazuli:
  434. cancel event
  435. if player's tool is white dye:
  436. cancel event
  437.  
  438. #==================================================
  439. #CHANGEMENT HAUTEUR DE PORTE PAR MODO
  440. command /portes <text> <number> [<text>]:
  441. trigger:
  442. if targeted block is a sign:
  443. if line 1 of targeted block is "&e[Porte]":
  444. if player has permission "sk.modo":
  445. if arg 1 is "add" or "replace":
  446. if arg 2 is 2:
  447. set line 2 of targeted block to arg 3
  448. if arg 2 is 3:
  449. set line 3 of targeted block to arg 3
  450. if arg 2 is 4:
  451. set line 4 of targeted block to arg 3
  452. if arg 1 is "del":
  453. if arg 2 is 2:
  454. set line 2 of targeted block to ""
  455. if arg 2 is 3:
  456. set line 3 of targeted block to ""
  457. if arg 2 is 4:
  458. set line 4 of targeted block to ""
  459. else if player doesn't have permission "sk.modo":
  460. if arg 1 is "add" or "replace":
  461. if arg 2 is 2:
  462. set line 2 of targeted block to arg 3
  463. if arg 2 is 3:
  464. set line 3 of targeted block to arg 3
  465. if arg 2 is 4:
  466. set line 4 of targeted block to arg 3
  467. if arg 1 is "del":
  468. if arg 2 is 2:
  469. set line 2 of targeted block to ""
  470. if arg 2 is 3:
  471. set line 3 of targeted block to ""
  472. if arg 2 is 4:
  473. set line 4 of targeted block to ""
  474. else:
  475. message "&4Tu n'es pas autorisé a utiliser cette commande"
  476.  
  477.  
  478. #CREATION DU FICHIER DES PORTES S'IL N'EXISTE PAS
  479. on load:
  480. if folder "plugins/Porte" doesn't exists:
  481. send "&e&lLe dossier plugins/Porte n'existe pas !" to console
  482. send " &aCréation du dossier en cours..." to console
  483. create folder "plugins/Porte"
  484. send "&2Dossier créer" to console
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement