options:
p: &8[&6&lMANDATI&8]
command /mandato [<text>] [<player>] [<text>]:
trigger:
if arg 1 is "stampa":
if arg 2 is set:
if arg 3 is {lista::%arg 3%}:
add 1 of mandato(player, arg-2, arg-3) to player's inventory
send message "{@p} &7Mandato stampato con successo" to player
else:
send message "{@p} &bScegli una fra queste opzioni" to sender
loop {lista::*}:
send message "&7%loop-value%" to player
else:
send message "&7Inserisci un nickname" to player
if arg 1 is "add":
if arg 2 isn't set:
if arg 3 is set:
if player has permission "mandato.admin":
set {lista::%arg 3%} to arg-3
add arg-3 to {lista::%arg 3%}
send message "{@p} &b%arg 3% &7Aggiunto alla lista" to sender
else if arg 1 isn't "stampa" or "add" or "remove" or "clear":
send "{@p} &7Comando errato, esegui /mandato stampa-add-remove-clear" to player
if arg 1 is "clear":
if arg 2 isn't set:
if arg 3 isn't set:
if player has permission "mandato.admin":
clear {lista::*}
send message "{@p} &7Lista clearata" to sender
if arg 1 is "remove":
if arg 2 isn't set:
if arg 3 is set:
if player has permission "mandato.admin":
remove arg-3 from {lista::*}
send message "&7%arg-3% rimossa dalla lista" to sender
function mandato(p: player, g: player, n: text) :: item:
set {_+} to a written book
set {mandato::id::%{_id}%::autore} to {_p}
set {mandato::id::%{_id}%:ersonasubita} to {_g}
set {mandato::id::%{_id}%::casa} to {_n}
add 1 to {mandato::id}
set {_id} to {mandato::id}
set {_u} to " &8[&6&lMANDATO&8]%nl%"
set {_u} to "%{_u}%&8&l----------------%nl%"
set {_u} to "%{_u}%&8Autore: &7%{_p}%%nl%"
set {_u} to "%{_u}%&8Casa di: &7%{_g}%%nl%"
set {_u} to "%{_u}%&8Tipo di casa: &7%{_n}%%nl%"
set {nowv} to now formatted as "dd/MM/yyyy"
set {_u} to text component of "%{_u}%&8Data: &7%{nowv}%%nl%"
set {_u} to "&6Mandato Procura%nl%"
set {_u} to "&a&lAPPROVATO"
set page 1 of book {_+} to {_u}
set book author of {_+} to "&6Procura"
set book title of {_+} to "&6&lMandato"
set 1st line of {_+}'s lore to "&7ID: &6%{_id}%"
return {_+}
0 error but
p: &8[&6&lMANDATI&8]
command /mandato [<text>] [<player>] [<text>]:
trigger:
if arg 1 is "stampa":
if arg 2 is set:
if arg 3 is {lista::%arg 3%}:
add 1 of mandato(player, arg-2, arg-3) to player's inventory
send message "{@p} &7Mandato stampato con successo" to player
else:
send message "{@p} &bScegli una fra queste opzioni" to sender
loop {lista::*}:
send message "&7%loop-value%" to player
else:
send message "&7Inserisci un nickname" to player
if arg 1 is "add":
if arg 2 isn't set:
if arg 3 is set:
if player has permission "mandato.admin":
set {lista::%arg 3%} to arg-3
add arg-3 to {lista::%arg 3%}
send message "{@p} &b%arg 3% &7Aggiunto alla lista" to sender
else if arg 1 isn't "stampa" or "add" or "remove" or "clear":
send "{@p} &7Comando errato, esegui /mandato stampa-add-remove-clear" to player
if arg 1 is "clear":
if arg 2 isn't set:
if arg 3 isn't set:
if player has permission "mandato.admin":
clear {lista::*}
send message "{@p} &7Lista clearata" to sender
if arg 1 is "remove":
if arg 2 isn't set:
if arg 3 is set:
if player has permission "mandato.admin":
remove arg-3 from {lista::*}
send message "&7%arg-3% rimossa dalla lista" to sender
function mandato(p: player, g: player, n: text) :: item:
set {_+} to a written book
set {mandato::id::%{_id}%::autore} to {_p}
set {mandato::id::%{_id}%:ersonasubita} to {_g}
set {mandato::id::%{_id}%::casa} to {_n}
add 1 to {mandato::id}
set {_id} to {mandato::id}
set {_u} to " &8[&6&lMANDATO&8]%nl%"
set {_u} to "%{_u}%&8&l----------------%nl%"
set {_u} to "%{_u}%&8Autore: &7%{_p}%%nl%"
set {_u} to "%{_u}%&8Casa di: &7%{_g}%%nl%"
set {_u} to "%{_u}%&8Tipo di casa: &7%{_n}%%nl%"
set {nowv} to now formatted as "dd/MM/yyyy"
set {_u} to text component of "%{_u}%&8Data: &7%{nowv}%%nl%"
set {_u} to "&6Mandato Procura%nl%"
set {_u} to "&a&lAPPROVATO"
set page 1 of book {_+} to {_u}
set book author of {_+} to "&6Procura"
set book title of {_+} to "&6&lMandato"
set 1st line of {_+}'s lore to "&7ID: &6%{_id}%"
return {_+}
0 error but