Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- logo: &4[&ePorte&4] : &r #Prefix chat
- blocks: horizontal pillar quartz block #Bloc a utilisé a la base de la porte
- blanc: white glass pane #Choix de la vitre
- noir: black glass pane #Choix de la vitre
- gris: gray glass pane #Choix de la vitre
- grisc: light gray glass pane #Choix de la vitre
- bleue: blue glass pane #Choix de la vitre
- delvitre: white glass pane or black glass pane or gray glass pane or light gray glass pane or blue glass pane
- rayon: 5 #Rayon d'action entre le panneau et l'option blocks défini plus haut
- on rightclick on a sign:
- if line 1 is "&e[Porte]":
- if player doesn't have permission "sk.modo":
- set {_x} to x-location of event-location
- set {_y} to y-location of event-location
- set {_z} to z-location of event-location
- set {_porteallow::*} to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- if "%{_porteallow::*}%" doesn't contain "%player's name%":
- cancel event
- message "{@logo}&4Tu n'es pas autorisé a utiliser cette porte"
- else:
- if line 2 is "2": #PORTE JOUEUR HAUTEUR 2
- if line 3 is "Fermer":
- loop blocks in radius {@rayon} around event-block:
- loop-block is {@blocks}:
- if line 4 is "" or "blanc":
- wait 10 ticks
- set block 2 meter above loop-block to {@blanc}
- set block 1 meter above loop-block to {@blanc}
- if line 4 is "noir":
- wait 10 ticks
- set block 2 meter above loop-block to {@noir}
- set block 1 meter above loop-block to {@noir}
- if line 4 is "gris":
- wait 10 ticks
- set block 2 meter above loop-block to {@gris}
- set block 1 meter above loop-block to {@gris}
- if line 4 is "grisc":
- wait 10 ticks
- set block 2 meter above loop-block to {@grisc}
- set block 1 meter above loop-block to {@grisc}
- if line 4 is "bleue":
- wait 10 ticks
- set block 2 meter above loop-block to {@bleue}
- set block 1 meter above loop-block to {@bleue}
- loop-block is a sign:
- if line 1 is "&e[Porte]":
- wait 8 ticks
- set line 3 of loop-block to "Ouvrir"
- stop
- if line 3 is "Ouvrir":
- loop blocks in radius {@rayon} around event-block:
- loop-block is {@blocks}:
- wait 10 ticks
- set block 2 meter above loop-block to air
- set block 1 meter above loop-block to air
- loop-block is a sign:
- if line 1 is "&e[Porte]":
- wait 8 ticks
- set line 3 of loop-block to "Fermer"
- stop
- if line 2 is "3": #PORTE JOUEUR HAUTEUR 3
- if line 3 is "Fermer":
- loop blocks in radius {@rayon} around event-block:
- loop-block is {@blocks}:
- block above loop-block is air
- if line 4 is "" or "blanc":
- wait 10 ticks
- set block 3 meter above loop-block to {@blanc}
- set block 2 meter above loop-block to {@blanc}
- set block 1 meter above loop-block to {@blanc}
- if line 4 is "noir":
- wait 10 ticks
- set block 3 meter above loop-block to {@noir}
- set block 2 meter above loop-block to {@noir}
- set block 1 meter above loop-block to {@noir}
- if line 4 is "gris":
- wait 10 ticks
- set block 3 meter above loop-block to {@gris}
- set block 2 meter above loop-block to {@gris}
- set block 1 meter above loop-block to {@gris}
- if line 4 is "grisc":
- wait 10 ticks
- set block 3 meter above loop-block to {@grisc}
- set block 2 meter above loop-block to {@grisc}
- set block 1 meter above loop-block to {@grisc}
- if line 4 is "bleue":
- wait 10 ticks
- set block 3 meter above loop-block to {@bleue}
- set block 2 meter above loop-block to {@bleue}
- set block 1 meter above loop-block to {@bleue}
- loop-block is a sign:
- if line 1 is "&e[Porte]":
- wait 8 ticks
- set line 3 of loop-block to "Ouvrir"
- stop
- if line 3 is "Ouvrir":
- loop blocks in radius {@rayon} around event-block:
- loop-block is {@blocks}:
- block above loop-block is {@delvitre}
- wait 10 ticks
- set block 3 meter above loop-block to air
- set block 2 meter above loop-block to air
- set block 1 meter above loop-block to air
- loop-block is a sign:
- if line 1 is "&e[Porte]":
- wait 8 ticks
- set line 3 of loop-block to "Fermer"
- stop
- if line 2 is "barriere2": #PORTE JOUEUR BARRIERE
- if line 3 is "Fermer":
- set line 3 to "Ouvrir"
- loop blocks in radius {@rayon} around event-block:
- loop-block is cobblestone:
- wait 10 ticks
- set block 2 meter above loop-block to fence
- set block 1 meter above loop-block to fence
- loop-block is a sign:
- if line 1 is "&e[Porte]":
- wait 8 ticks
- set line 3 of loop-block to "Fermer"
- stop
- if line 3 is "Ouvrir":
- set line 3 to "Fermer"
- loop blocks in radius {@rayon} around event-block:
- loop-block is cobblestone:
- block above loop-block is fence
- wait 10 ticks
- set block 2 meter above loop-block to air
- set block 1 meter above loop-block to air
- loop-block is a sign:
- if line 1 is "&e[Porte]":
- wait 8 ticks
- set line 3 of loop-block to "Fermer"
- stop
- #PORTE MODO
- else:
- if line 2 is "2":
- if line 3 is "Fermer":
- set line 3 to "Ouvrir"
- loop blocks in radius {@rayon} around event-block:
- loop-block is {@blocks}:
- if line 4 is "" or "blanc":
- wait 10 ticks
- set block 2 meter above loop-block to {@blanc}
- set block 1 meter above loop-block to {@blanc}
- if line 4 is "noir":
- wait 10 ticks
- set block 2 meter above loop-block to {@noir}
- set block 1 meter above loop-block to {@noir}
- if line 4 is "gris":
- wait 10 ticks
- set block 2 meter above loop-block to {@gris}
- set block 1 meter above loop-block to {@gris}
- if line 4 is "grisc":
- wait 10 ticks
- set block 2 meter above loop-block to {@grisc}
- set block 1 meter above loop-block to {@grisc}
- if line 4 is "bleue":
- wait 10 ticks
- set block 2 meter above loop-block to {@bleue}
- set block 1 meter above loop-block to {@bleue}
- stop
- if line 3 is "Ouvrir":
- set line 3 to "Fermer"
- loop blocks in radius {@rayon} around event-block:
- loop-block is {@blocks}:
- wait 10 ticks
- set block 2 meter above loop-block to air
- set block 1 meter above loop-block to air
- stop
- if line 2 is "3":
- if line 3 is "Fermer":
- set line 3 to "Ouvrir"
- loop blocks in radius {@rayon} around event-block:
- loop-block is {@blocks}:
- block above loop-block is air
- if line 4 is "" or "blanc":
- wait 10 ticks
- set block 3 meter above loop-block to {@blanc}
- set block 2 meter above loop-block to {@blanc}
- set block 1 meter above loop-block to {@blanc}
- if line 4 is "noir":
- wait 10 ticks
- set block 3 meter above loop-block to {@noir}
- set block 2 meter above loop-block to {@noir}
- set block 1 meter above loop-block to {@noir}
- if line 4 is "gris":
- wait 10 ticks
- set block 3 meter above loop-block to {@gris}
- set block 2 meter above loop-block to {@gris}
- set block 1 meter above loop-block to {@gris}
- if line 4 is "grisc":
- wait 10 ticks
- set block 3 meter above loop-block to {@grisc}
- set block 2 meter above loop-block to {@grisc}
- set block 1 meter above loop-block to {@grisc}
- if line 4 is "bleue":
- wait 10 ticks
- set block 3 meter above loop-block to {@bleue}
- set block 2 meter above loop-block to {@bleue}
- set block 1 meter above loop-block to {@bleue}
- stop
- if line 3 is "Ouvrir":
- set line 3 to "Fermer"
- loop blocks in radius {@rayon} around event-block:
- loop-block is {@blocks}:
- block above loop-block is {@delvitre}
- wait 10 ticks
- set block 3 meter above loop-block to air
- set block 2 meter above loop-block to air
- set block 1 meter above loop-block to air
- stop
- if line 2 is "barriere2":
- if line 3 is "Fermer":
- set line 3 to "Ouvrir"
- loop blocks in radius {@rayon} around event-block:
- loop-block is cobblestone:
- wait 10 ticks
- set block 2 meter above loop-block to fence
- set block 1 meter above loop-block to fence
- stop
- if line 3 is "Ouvrir":
- set line 3 to "Fermer"
- loop blocks in radius {@rayon} around event-block:
- loop-block is cobblestone:
- block above loop-block is fence
- wait 10 ticks
- set block 2 meter above loop-block to air
- set block 1 meter above loop-block to air
- stop
- #PROTECTION VITRES
- on break:
- if player's gamemode is survival:
- if block is {@delvitre}:
- loop blocks in radius {@rayon} around event-block:
- loop-block is sign:
- if line 1 of loop-block is "&e[Porte]":
- cancel event
- #PROTECTION PANNEAU OWNER ET SUPPRESSION DES FICHIERS
- on break:
- if block is a sign:
- if line 1 is "&e[porte]":
- set {_x} to x-location of event-location
- set {_y} to y-location of event-location
- set {_z} to z-location of event-location
- replace all "." with "," in {_x}
- replace all "." with "," in {_y}
- replace all "." with "," in {_z}
- set {_porteowner::*} to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- if "%{_porteowner::*}%" doesn't contain "%player's name%":
- cancel event
- send "{@logo} &4Tu ne peux pas détruire une porte qui ne t'appartiens pas."
- else:
- df "plugins/Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&9Le panneau a été supprimé"
- #COMMANDES ALLOW JOUEUR/MODO
- command /porte <text> [<offline player>]:
- trigger:
- if targeted block is a sign:
- if line 1 of targeted block is "&e[Porte]":
- set {_x} to x-location of targeted block
- set {_y} to y-location of targeted block
- set {_z} to z-location of targeted block
- replace all "." with "," in {_x}
- replace all "." with "," in {_y}
- replace all "." with "," in {_z}
- set {_porteowner::*} to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- set {_porteallow::*} to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- if arg 1 is "add":
- if player has permission "sk.modo":
- if "%{_porteallow::*}%" doesn't contain "%arg 2%":
- add "%arg 2%" to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&e%arg 2% &9 a été ajouté sur cette porte"
- else:
- send "{@logo}&e%arg 2% &9 est déjà autorisé sur cette porte"
- else if "%{_porteallow::*}%" contain "%player's name%":
- if "%{_porteallow::*}%" doesn't contain "%arg 2%":
- add "%arg 2%" to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&e%arg 2% &9 a été ajouté sur cette porte"
- else:
- send "{@logo}&e%arg 2% &9 est déjà autorisé sur cette porte"
- else:
- send "{@logo}&9Tu n'es pas le propriétaire de cette porte. Tu ne peux pas ajouter de joueurs."
- if arg 1 is "del":
- if player has permission "sk.modo":
- if "%{_porteallow::*}%" doesn't contain "%arg 2%":
- send "{@logo}&e%arg 2% &9ne fait pas parti des joueurs autorisé sur cette porte"
- else:
- remove "%arg 2%" from yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&e%arg 2% &9 a été supprimé des joueurs autorisé sur cette porte"
- else if "%{_porteowner::*}%" contain "%player's name%":
- if "%{_porteallow::*}%" doesn't contain "%arg 2%":
- send "{@logo}&e%arg 2% &9ne fait pas parti des joueurs autorisé sur cette porte"
- else:
- remove "%arg 2%" from yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&e%arg 2% &9 a été ajouté sur cette porte"
- else:
- send "{@logo}&9Tu n'es pas le propriétaire de cette porte. Tu ne peux pas ajouter de joueurs."
- if arg 1 is "list":
- set {_porteowner::*} to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- set {_porteallow::*} to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&ePropriétaire: &9%{_porteowner::*}%"
- send "{@logo}&eJoueurs autorisés: &9%{_porteallow::*}%"
- #COMMANDES OWNER MODO
- command /modoporte <text> <text>:
- permission: sk.modo
- trigger:
- if arg 1 is "add":
- if arg 2 is set:
- add "%player%" to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&e%arg 2% a été ajouté a la liste des propriétaires"
- else:
- send "{@logo}&4Vous devez indiquez un joueur"
- if arg 1 is "del":
- if arg 2 is set:
- remove "%arg 2%" from yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&e%arg 2% a été supprimé de la liste des propriétaires"
- else:
- send "{@logo}&4Vous devez indiquez un joueur"
- #CREATION DES PANNEAUX
- #HAUTEUR DE PORTE PAR DEFAULT
- on sign change:
- if line 1 is "[Porte]":
- if line 2 is "":
- set line 1 to "&e[Porte]"
- set line 2 to "2"
- set line 3 to "Fermer"
- set line 3 to "Fermer"
- set {_x} to x-location of event-location
- set {_y} to y-location of event-location
- set {_z} to z-location of event-location
- replace all "." with "," in {_x}
- replace all "." with "," in {_y}
- replace all "." with "," in {_z}
- add "%player%" to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- add "%player%" to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&9Le panneau a été créer"
- stop
- on sign change:
- if line 1 is "[Porte]":
- if line 2 is "2":
- set line 1 to "&e[Porte]"
- set line 3 to "Fermer"
- set {_x} to x-location of event-location
- set {_y} to y-location of event-location
- set {_z} to z-location of event-location
- replace all "." with "," in {_x}
- replace all "." with "," in {_y}
- replace all "." with "," in {_z}
- add "%player%" to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- add "%player%" to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&9Le panneau a été créer"
- stop
- #HAUTEUR DE PORTE 3
- on sign change:
- if line 1 is "[Porte]":
- if line 2 is "3":
- set line 1 to "&e[Porte]"
- set line 3 to "Fermer"
- set line 3 to "Fermer"
- set {_x} to x-location of event-location
- set {_y} to y-location of event-location
- set {_z} to z-location of event-location
- replace all "." with "," in {_x}
- replace all "." with "," in {_y}
- replace all "." with "," in {_z}
- add "%player%" to yaml list "owner" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- add "%player%" to yaml list "allow" from file "../../Porte/%{_x}%,%{_y}%,%{_z}%.yml"
- send "{@logo}&9Le panneau a été créer"
- stop
- #CHANGEMENT DE COULEUR DES VITRES
- on leftclick on a sign:
- if line 1 is "&e[Porte]":
- wait 2 ticks
- if player's tool is black dye:
- set line 4 to "noir"
- if player's gamemode is survival:
- remove 1 black dye from player
- if player's tool is gray dye:
- set line 4 to "gris"
- if player's gamemode is survival:
- remove 1 gray dye from player
- if player's tool is light gray dye:
- set line 4 to "grisc"
- if player's gamemode is survival:
- remove 1 light gray dye from player
- if player's tool is Lapis Lazuli:
- set line 4 to "bleue"
- if player's gamemode is survival:
- remove 1 Lapis Lazuli from player
- if player's tool is white dye:
- set line 4 to "blanc"
- if player's gamemode is survival:
- remove 1 white dye from player
- #PROTECTION AU CHANGEMENT DE COULEUR SI GMC
- on break a sign:
- if player's gamemode is creative:
- if line 1 is "&e[Porte]":
- if player's tool is black dye:
- cancel event
- if player's tool is gray dye:
- cancel event
- if player's tool is light gray dye:
- cancel event
- if player's tool is Lapis Lazuli:
- cancel event
- if player's tool is white dye:
- cancel event
- #==================================================
- #CHANGEMENT HAUTEUR DE PORTE PAR MODO
- command /portes <text> <number> [<text>]:
- trigger:
- if targeted block is a sign:
- if line 1 of targeted block is "&e[Porte]":
- if player has permission "sk.modo":
- if arg 1 is "add" or "replace":
- if arg 2 is 2:
- set line 2 of targeted block to arg 3
- if arg 2 is 3:
- set line 3 of targeted block to arg 3
- if arg 2 is 4:
- set line 4 of targeted block to arg 3
- if arg 1 is "del":
- if arg 2 is 2:
- set line 2 of targeted block to ""
- if arg 2 is 3:
- set line 3 of targeted block to ""
- if arg 2 is 4:
- set line 4 of targeted block to ""
- else if player doesn't have permission "sk.modo":
- if arg 1 is "add" or "replace":
- if arg 2 is 2:
- set line 2 of targeted block to arg 3
- if arg 2 is 3:
- set line 3 of targeted block to arg 3
- if arg 2 is 4:
- set line 4 of targeted block to arg 3
- if arg 1 is "del":
- if arg 2 is 2:
- set line 2 of targeted block to ""
- if arg 2 is 3:
- set line 3 of targeted block to ""
- if arg 2 is 4:
- set line 4 of targeted block to ""
- else:
- message "&4Tu n'es pas autorisé a utiliser cette commande"
- #CREATION DU FICHIER DES PORTES S'IL N'EXISTE PAS
- on load:
- if folder "plugins/Porte" doesn't exists:
- send "&e&lLe dossier plugins/Porte n'existe pas !" to console
- send " &aCréation du dossier en cours..." to console
- create folder "plugins/Porte"
- send "&2Dossier créer" to console
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement