#requirements
# Skript https://github.com/SkriptLang/Skript/releases
# Skript [Radio Roleplay italty/english]: https://www.spigotmc.org/resources/radiorp.83568/ [Creator sitino14]
# Language in which the skript was developed: English
# Create by @stupiscimii on telegram https://t.me/@stupiscimii
# (:
options:
p: &4&lChats &8»
command /chat [<string>] [<string>] [<string>]:
aliases: /c
executable by: players
trigger:
if arg 1 is "connect" or "connettiti":
if arg 2 is set:
if {RadioRP::jobs::%arg 2%} is set:
if player has permission "chat.%arg 2%":
if player's tool is istantelfono():
if arg 2 is not "esercito" or "gdf" or "cc" or "dis" or "polizia" or "sc" or "penitenziaria":
make player execute "woo %arg 2%"
else:
message "{@p} &cNon puoi conneterti a questa chat col telefono" to player
else:
message "{@p} &cDevi avere il telefono in mano!" to player
else:
send "{@p} &cChat non esistente" to player
else:
message "{@p} &cInserisci il nome della chat" to player
if arg 1 is "create" or "crea":
if arg 2 is set:
if arg 3 is set:
if player has permission "chat.admin":
if {RadioRP::jobs::%arg-2%} is not set:
add 1 to {RadioRP::jobs::%arg 2%}
set {RadioRP::jobs::%arg 2%} to arg 2
set {ff::jobs::%arg 3%} to colored arg 3
set {RadioRP::jobs::%arg 2%} to {ff::jobs::%arg 3%}
send "{@p} &aHai creato la chat: &e%arg-2%" to player
else:
send "{@p} Chat già esistente" to player
else:
send "{@p} &cNessun permesso" to player
else:
send "{@p} &cInserisci il prefix vale anche il codice colore" to player
stop
if arg 1 is "delete":
if arg 2 is set:
if {RadioRP::jobs::%arg 2%} is set:
if player has permission "chat.admin":
delete {RadioRP::jobs::%arg 2%}
send "{@p} &cHai eliminato la chat &e%arg 2%" to player
else:
send "{@p} &cChat non esistente" to player
else:
send "{@p} &cInserisci il nome di una chat" to player
stop
if arg 1 is "disconnect":
if {RadioRP::players::%player%} is set:
if player's tool is istantelfono():
delete {RadioRP::players::%player%}
message "{@p} &aSei stato disconnesso dalla attuale chat %{RadioRP::players::%player%}%" to player
else:
message "{@p} &cDervi avere un telefono in mano" to player
else:
message "{@p} &cNon sei connesso a nessuna frequenza" to player
if arg 1 is "list":
if player has permission "chat.admin":
loop {ff::jobs::*}:
send "{@p} %loop-value%" to player
if arg 1 is "clear":
if player has permission "chat.admin":
message "{@p} &cHai eliminato tutte le chat" to player
delete {RadioRP::jobs::*}
stop
if arg 1 is "edit" or "modifica":
if arg 2 is set:
if arg 3 is set:
delete {RadioRP::jobs::%arg 2%}
add 1 to {RadioRP::jobs::%arg 2%}
set {RadioRP::jobs::%arg 2%} to arg 2
set {ff::jobs::%arg 3%} to colored arg 3
set {RadioRP::jobs::%arg 2%} to {ff::jobs::%arg 3%}
message "{@p} &aChat modificata!" to player
else:
message "{@p} &cInserisci un prefix [vale anche il codice colore]" to player
else:
message "{@p} &cInserisci il nome della chat da modificare" to player
if arg 1 is not set:
send "&3/chat edit <nome chat> <colori della chat>" to player
send "&3/chat create <nome chat> <colori della chat>" to player
send "&3/chat delete <nome chat>" to player
send "&3/chat clear <per eliminare tutte le chat>" to player
send "&3/chat list <per la lista delle chat esistenti>" to player
send "&b/chat connect <nome chat>" to player
send "&b/chat disconnect" to player
on right click:
if tool of player is carrot on a stick:
if name of tool is "&9Radio &1Centrale &7(Tasto destro)":
if lore of item contains "&9Radiolina data in dotazione alle forze del ordine":
open chest with 2 rows named "&9&lCentrale" to player
set {_0} to diamond hoe
set damage value of {_0} to 21
set {_2} to prismarine shard
set {_4} to diamond hoe
set damage value of {_4} to 25
set {_6} to diamond hoe
set damage value of {_6} to 27
set {_8} to diamond hoe
set damage value of {_8} to 23
set {_11} to diamond hoe
set damage value of {_11} to 1
set {_13} to golden sword
set {_15} to diamond hoe
set damage value of {_15} to 1
format slot 0 of player with {_0} named "&2&lEsercito" to close then run [make player execute command "/woo esercito"]
cancel event
format slot 2 of player with {_2} named "&1&lPolizia &3&lScientifica" to close then run [make player execute command "/woo sc"]
cancel event
format slot 4 of player with {_4} named "&1&lPolizia" to close then run [make player execute command "/woo polizia"]
cancel event
format slot 6 of player with {_6} named "&8&lCarabinieri" to close then run [make player execute command "/woo cc"]
cancel event
format slot 8 of player with {_8} named "&e&lFinanza" to close then run [make player execute command "/woo gdf"]
cancel event
format slot 11 of player with {_11} named "&9&lCentrale" to close then run [make player execute command "/woo centrale"]
cancel event
format slot 13 of player with {_13} named "&b&lPolizia &3&lPenitenziaria" to close then run [make player execute command "/woo penitenziaria"]
cancel event
format slot 15 of player with {_15} named "&b&lD.I.S." to close then run [make player execute command "/woo dis"]
cancel event
command /radio [<string>] [<player>]:
permission: radio.admin
permission message: {@p} &cNessun permesso.
trigger:
if arg 1 is "give":
if arg 2 is set:
add 1 of radio(player, arg 2) to arg 2's inventory
message "{@p} &7Hai ricevuto un oggetto!" to arg 2
message "{@p} &7Oggetto dato con successo a %arg 2%" to player
else:
message "{@p} &7Inserisci un nickname" to player
if arg 1 is "get":
add 1 of istantradio() to player's inventory
message "{@p} &aItem gettato con successo" to player
if arg 1 is not set:
message "{@p} &3/radio give - get" to player
function radio(a: player, b: player) :: item:
set {_a} to {_playergive}
set {_a} to {_playericeve}
set {_i} to carrot on a stick
set name of {_i} to "&9Radio &1Centrale &7(Tasto destro)"
set 1st line of {_i}'s lore to "&9Radiolina data in dotazione alle forze del ordine"
return {_i}
function istantradio() :: item:
set {_i} to carrot on a stick
set name of {_i} to "&9Radio &1Centrale &7(Tasto destro)"
set 1st line of {_i}'s lore to "&9Radiolina data in dotazione alle forze del ordine"
return {_i}
function istantelfono() :: item:
set {_i} to prismarine crystals
set {_i}'s name to "&bTelefono"
set 1nd line of {_i}'s lore to "&8· Premi tasto destro per utilizzarlo"
return {_i}
options:
# Whether (true) or not (false) the player should be automatically
# disconnected from his radio channel when leaving the server
radiorp-autodisconnect-onquit: true
on load:
#
#
# Jobs and their radio channel prefixes
#
#
# Each set represents a radio channel and its prefix is specified after the "to"
# To write in a radio channel you use command: /radio <name> or just /<name>
# The permission to write in a radio channel is "radio.<name>"
set {RadioRP::jobs::cc} to "&8Carabinieri"
set {RadioRP::jobs::esercito} to "&2Esercito"
set {RadioRP::jobs::gdf} to "&e&lGuardia Di Finanza"
set {RadioRP::jobs::emergenze} to "&cEmergenze"
set {RadioRP::jobs::centrale} to "&9Centrale"
set {RadioRP::jobs::polizia} to "&1Polizia"
set {RadioRP::jobs::sc} to "&bScentifica"
set {RadioRP::jobs::penitenziaria} to "&3&lPenitenziaria"
set {RadioRP::jobs::dis} to "&b&lD.I.S."
#set {RadioRP::jobs::<name>} to "<job channel's radio prefix>"
#
#
# Messages
#
#
# Each set represents a string and its text is specified after the "to"
# Words enclosed in <> are placeholders
# English language - comment (#) the following lines to disable
set {RadioRP::language::format} to "&8[<jobprefix>&8] &7<player> &8» &f<message>"
set {RadioRP::language::connection} to "{@p} &aTi sei connesso alla chat &2&n<argument>"
set {RadioRP::language::disconnection} to "{@p} &4Ti sei disconnesso dal canale &4&n<argument>"
set {RadioRP::language::nopermission} to "{@p} &cNessun permesso per questa chat"
# Italian language - uncomment the following lines to enable
#set {RadioRP::language::format} to "&7&l• <jobprefix> &7<player> &8» &f<message>"
#set {RadioRP::language::connection} to "&8• &aHai &a&nconnesso&r &ala radio al canale &2<argument>"
#set {RadioRP::language::disconnection} to "&8• &cHai &c&nsconnesso&r &cla radio dal canale &4<argument>"
#set {RadioRP::language::nopermission} to "&8• &cNon sei autorizzato a connetterti o parlare in questo canale"
#set {RadioRP::language::nochannel} to "&8• &7Nessun canale radio raggiungibile con questo nome: &c<argument>"
#set {RadioRP::language::noargument} to "&8• &7Devi specificare il nome del canale a cui vuoi connetterti"
# ░█▀▀█ ░█▀▀▀█ ░█▀▀▄ ░█▀▀▀
# ░█─── ░█──░█ ░█─░█ ░█▀▀▀
# ░█▄▄█ ░█▄▄▄█ ░█▄▄▀ ░█▄▄▄
#! /!\ Edit the code below only if you know what you are doing /!\
function RadioRP_connect(p: player, t: text):
set {_message} to "%{RadioRP::language::connection}%"
replace all "<argument>" in {_message} with {_t}
send {_message} to {_p}
set {RadioRP::players::%{_p}%} to {_t}
function RadioRP_disconnect(p: player):
set {_message} to "%{RadioRP::language::disconnection}%"
replace all "<argument>" in {_message} with "%{RadioRP::players::%{_p}%}%"
send {_message} to {_p}
delete {RadioRP::players::%{_p}%}
command /woo [<text>] [<text>]:
trigger:
if arg 1 is set:
if {RadioRP::jobs::%arg 1%} is set:
if player has permission "chat.%arg 1%":
if arg 2 isn't set:
if {RadioRP::players::%player%} is set:
if {RadioRP::players::%player%} isn't arg 1:
RadioRP_disconnect(player)
RadioRP_connect(player, arg 1)
else:
RadioRP_disconnect(player)
else:
RadioRP_connect(player, arg 1)
else:
#Default format: &7&l• <jobprefix> &7<playername> &8» &f<message>
set {_message} to {RadioRP::language::format}
replace all "<jobprefix>" in {_message} with "%{RadioRP::jobs::%arg 1%}%"
replace all "<player>" in {_message} with "%player%"
replace all "<message>" in {_message} with arg 2
loop all players where [player input has permission "chat.%arg 1%"]:
send {_message} to loop-player
else:
send {RadioRP::language::nopermission}
else:
set {_message} to "%{RadioRP::language::nochannel}%"
replace all "<argument>" in {_message} with arg 1
send {_message}
else:
if {RadioRP::players::%player%} is set:
RadioRP_disconnect(player)
else:
send {RadioRP::language::noargument}
on chat:
if {RadioRP::players::%player%} is set:
set {_channel} to {RadioRP::players::%player%}
if player doesn't have permission "chat.%{_channel}%":
RadioRP_disconnect(player)
else:
cancel event
#Default format: &7&l• <jobprefix> &7<playername> &8» &f<message>
set {_message} to {RadioRP::language::format}
replace all "<jobprefix>" in {_message} with "%{RadioRP::jobs::%{_channel}%}%"
replace all "<player>" in {_message} with "%player's prefix%%player%"
replace all "<message>" in {_message} with message
loop all players where [player input has permission "chat.%{_channel}%"]:
send {_message} to loop-player
on command:
{RadioRP::jobs::%command%} is set
cancel event
make player execute command "/radio %full command%"
on join:
if {RadioRP::players::%player%} is set:
if {@radiorp-autodisconnect-onquit} isn't true:
if player has permission "chat.%{RadioRP::players::%player%}%":
stop
delete {RadioRP::players::%player%}
on quit:
if {RadioRP::players::%player%} is set:
if {@radiorp-autodisconnect-onquit} isn't true:
if player has permission "chat.%{RadioRP::players::%player%}%":
stop
delete {RadioRP::players::%player%}
on tool change:
if {RadioRP::players::%player%} is set:
delete {RadioRP::players::%player%}
message "{@p} &cSei stato disconnesso dalla attuale chat" to player
command /telefono [<text>]:
permission: telefono.get
permission message: &cNessun Permesso
trigger:
if arg 1 is "get":
add 1 of istantelfono() to player's inventory
message "{@p} &cTelefono preso con successo" to player
else:
message "{@p} &c/telefono get" to player