options:
guititle: "&8Bany w GUI"
baninfo: "&c&lZOSTALES ZBANOWANY" and "" and "&7Powod: &6{REASON}" and "&7Wygasa za: &e{TIME}" and "" and "&bWiecej info na &nwww.Serwer.PL"
IPbaninfo: "&c&lADRES IP ZBANOWANY" and "" and "&7Powod: &6{REASON}" and "&7Wygasa za: &e{TIME}" and "" and "&bWiecej info na &nwww.Serwer.PL"
command /pun [<player>] [<text>]:
permission: *
permission message: &cNie mozesz tego zrobic!
trigger:
if arg-1 or arg-2 is not set:
send "&cPoprawne uzycie: /pun [gracz] [powod]"
else:
bangui(player, "%arg-1%", arg-2)
function bangui(player: player, nick: text, reason: text):
set {_x} to chest with 5 rows named "%{@guititle}% - %{_nick}%"
set slot 0 and 8 and 36 and 44 of {_x} to orange stained glass pane named "&7"
set slot 1 and 7 and 9 and 17 and 27 and 35 and 37 and 43 of {_x} to yellow stained glass pane named "&7"
set slot 2 and 3 and 5 and 6 and 18 and 26 and 38 and 39 and 41 and 42 of {_x} to white stained glass pane named "&7"
set slot 10 of {_x} to glowing stone sword named "&cBan na 1 Dzien" with lore "" and "&7Zbanuj gracza &6%{_nick}% &7na" and "&e1 Dzien &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 12 of {_x} to glowing gold sword named "&cBan na 1 Tydzien" with lore "" and "&7Zbanuj gracza &6%{_nick}% &7na" and "&e1 Tydzien &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 14 of {_x} to glowing glowing iron sword named "&cBan na 1 Miesiac" with lore "" and "&7Zbanuj gracza &6%{_nick}% &7na" and "&e1 Miesiac &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 16 of {_x} to glowing diamond sword named "&cBan na 1 Rok" with lore "" and "&7Zbanuj gracza &6%{_nick}% &7na" and "&e1 Rok &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 28 of {_x} to glowing stone pickaxe named "&cBan IP na 1 Dzien" with lore "" and "&7Zbanuj IP gracza &6%{_nick}% &7na" and "&e1 Dzien &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 30 of {_x} to glowing gold pickaxe named "&cBan IP na 1 Dzien" with lore "" and "&7Zbanuj IP gracza &6%{_nick}% &7na" and "&e1 Tydzien &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!" with lore "" and "&7Zbanuj gracza &6%{_nick}% &7na" and "&e1 Dzien &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 32 of {_x} to glowing iron pickaxe named "&cBan IP na 1 Dzien" with lore "" and "&7Zbanuj IP gracza &6%{_nick}% &7na" and "&e1 Miesiac &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 34 of {_x} to glowing diamond pickaxe named "&cBan IP na 1 Dzien" with lore "" and "&7Zbanuj IP gracza &6%{_nick}% &7na" and "&e1 Rok &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
open {_x} for {_player}
on inventory click:
if name of current inventory of player contains {@guititle}:
cancel event
if clicked slot is 10 or 12 or 14 or 16 or 28 or 30 or 32 or 34:
close player's inventory
set {_lore::*} to uncolored lore of clicked slot
set {_reason::*} to {_lore::5} split at "Powod: "
set {_name::*} to {_lore::2} split at " "
set {_gracz} to {_name::3}
set {_banlore::*} to {@baninfo}
if clicked slot is 28 or 30 or 32 or 34:
set {_gracz} to {_name::4} parsed as offline player's ip
if {IPBans::*} contains {_name::4} parsed as offline player's ip:
send "&cIP tego gracza jest juz zbanowane!"
stop
add {_name::4} parsed as offline player's ip to {IPBans::*}
send "&aZbanowano IP &6&l%{_name::4} parsed as offline player's ip%"
set {_banlore::*} to {@IPbaninfo}
else:
send "&aZbanowano Gracza &6&l%{_gracz}%&a!"
set {_time::*} to {_lore::3} split at " z powodem:"
replace all "{REASON}" with {_reason::2} in {_banlore::*}
replace all "{TIME}" with {_time::1} in {_banlore::*}
set {_banlore} to "%{_banlore::*}%"
replace all ", " and " and " with newline in {_banlore}
loop all players:
if {IPBans::*} contains loop-player's ip:
kick loop-player due to {_banlore}
kick {_name::3} parsed as offline player due to {_banlore}
set {Ban::%{_gracz}%::Time} to texttotime(uncolored {_time::1}) from now
set {Ban::%{_gracz}%::Reason} to {_reason::2}
wait 1 second
send timeformat(difference between now and {Ban::%{_gracz}%::Time})
on join:
wait 1 tick # Debug go (mc nie może postawić gracza na świecie xD)
set {_player} to player
set {_x} to {Ban::%{_player}%::Time}
remove now from {_x}
if {_x} > now:
set {_kick} to "Normal"
loop {IPBans::*}:
if player's ip is loop-value:
set {_kick} to player's ip
set {_x} to {Ban::%{_kick}%::Time}
if {_x} < now:
remove player's ip from {IPBans::*}
if {_kick} is set:
set {_banlore::*} to {@baninfo}
if {_kick} is not "Normal":
set {_player} to {_kick}
set {_banlore::*} to {@IPbaninfo}
replace all "{REASON}" with {Ban::%{_player}%::Reason} in {_banlore::*}
replace all "{TIME}" with timeformat(difference between now and {Ban::%{_player}%::Time}) in {_banlore::*}
set {_banlore} to "%{_banlore::*}%"
replace all ", " and " and " with newline in {_banlore}
kick player due to {_banlore}
stop
function texttotime(time: text) :: timespan:
if {_time} is "1Minuta":
return 1 minutes
if {_time} is "1 Tydzien":
return 1 week
if {_time} is "1 Miesiac":
return 1 month
if {_time} is "1 Rok":
return 1 year
command /unbanx [<text>]:
permission: *
permission message: &cNie mozesz tego zrobic!
trigger:
set {_x} to {Ban::%arg-1%::Time}
remove now from {_x}
if {_x} > now:
send "&aOdbanowano gracza &6&l%arg-1%&a!"
delete {Ban::%arg-1%::Time}
delete {Ban::%arg-1%::Reason}
else:
send "&cTen gracz nie jest zbanowany!"
command /unbanxip [<text>]:
permission: *
permission message: &cNie mozesz tego zrobic!
trigger:
set {_x} to {Ban::%arg-1%::Time}
remove now from {_x}
if {IPBans::*} contains arg-1:
if {_x} > now:
send "&aOdbanowano IP &6&l%arg-1%&a!"
delete {Ban::%arg-1%::Time}
delete {Ban::%arg-1%::Reason}
remove arg-1 from {IPBans::*}
else:
send "&cTen adres IP nie jest zbanowany!"
function timeformat(time: timespan) :: string:
set {_time} to "%{_time}%"
set {_timespan::*} to {_time} parsed as "%number% %string%[s][ and %number% %string%[s]]"
set {_first} to "%round({_timespan::1})%%first character of {_timespan::2}%"
set {_second} to "%round({_timespan::3})%%first character of {_timespan::4}%"
if {_second} is "60m":
set {_second} to "59m"
if {_second} is "24h":
set {_second} to "23h"
return ("%{_first}% %{_second}%" if {_timespan::3} is set, else "%{_first}%")
command /addban [<player>] [<text>] [<text>]:
trigger:
set {Ban::%arg-1%::Time} to texttotime(arg-2) from now
set {Ban::%arg-1%::Reason} to arg-3
send "Dodano bana dla %arg-1% na %arg-2% powód %arg-3%" to player
on inventory click:
if name of current inventory of player contains "&8Lista Banów":
cancel event
send "Kliknięto w GUI banów" to player
command /listabanów:
trigger:
displayBanListGUI(player)
function displayBanListGUI(player: player):
updateBanList()
set {_x} to chest inventory with 6 rows named "&8Lista Banów"
set {_row} to 0
open {_x} for {_player}
loop {Ban::*}:
set {_player} to loop-value
set {_reason} to {Ban::%{_player}%::Reason}
set {_time} to timeformat(difference between now and {Ban::%{_player}%::Time})
if {_time} contains "seconds":
continue # Pomiń przedmioty, które mają czas wygaśnięcia mniejszy niż 1 minuta
set {_item} to stone named "&c%{_player}%" with lore "&c&lZOSTALES ZBANOWANY" and "" and "&7Powod: &6%{_reason}%" and "&7Wygasa za: &e%{_time}%" and "" and "&bWiecej info na &nwww.Serwer.PL"
set {_slot} to (9 * {_row}) + 1
if {_slot} >= 54:
set {_slot} to 53
set slot {_slot} of {_x} to {_item}
add 1 to {_row}
if {_row} > 5:
stop
i czas w gui leci w dór ok ale póżniej odlicza w górę zamiast zniknąć item w gui tak samo wpisze innego gracza nie pojawi się tylko ciągle mój nick jest
Pytanie
Deyvson 3
to jest kod
options:
guititle: "&8Bany w GUI"
baninfo: "&c&lZOSTALES ZBANOWANY" and "" and "&7Powod: &6{REASON}" and "&7Wygasa za: &e{TIME}" and "" and "&bWiecej info na &nwww.Serwer.PL"
IPbaninfo: "&c&lADRES IP ZBANOWANY" and "" and "&7Powod: &6{REASON}" and "&7Wygasa za: &e{TIME}" and "" and "&bWiecej info na &nwww.Serwer.PL"
command /pun [<player>] [<text>]:
permission: *
permission message: &cNie mozesz tego zrobic!
trigger:
if arg-1 or arg-2 is not set:
send "&cPoprawne uzycie: /pun [gracz] [powod]"
else:
bangui(player, "%arg-1%", arg-2)
function bangui(player: player, nick: text, reason: text):
set {_x} to chest with 5 rows named "%{@guititle}% - %{_nick}%"
set slot 0 and 8 and 36 and 44 of {_x} to orange stained glass pane named "&7"
set slot 1 and 7 and 9 and 17 and 27 and 35 and 37 and 43 of {_x} to yellow stained glass pane named "&7"
set slot 2 and 3 and 5 and 6 and 18 and 26 and 38 and 39 and 41 and 42 of {_x} to white stained glass pane named "&7"
set slot 10 of {_x} to glowing stone sword named "&cBan na 1 Dzien" with lore "" and "&7Zbanuj gracza &6%{_nick}% &7na" and "&e1 Dzien &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 12 of {_x} to glowing gold sword named "&cBan na 1 Tydzien" with lore "" and "&7Zbanuj gracza &6%{_nick}% &7na" and "&e1 Tydzien &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 14 of {_x} to glowing glowing iron sword named "&cBan na 1 Miesiac" with lore "" and "&7Zbanuj gracza &6%{_nick}% &7na" and "&e1 Miesiac &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 16 of {_x} to glowing diamond sword named "&cBan na 1 Rok" with lore "" and "&7Zbanuj gracza &6%{_nick}% &7na" and "&e1 Rok &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 28 of {_x} to glowing stone pickaxe named "&cBan IP na 1 Dzien" with lore "" and "&7Zbanuj IP gracza &6%{_nick}% &7na" and "&e1 Dzien &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 30 of {_x} to glowing gold pickaxe named "&cBan IP na 1 Dzien" with lore "" and "&7Zbanuj IP gracza &6%{_nick}% &7na" and "&e1 Tydzien &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!" with lore "" and "&7Zbanuj gracza &6%{_nick}% &7na" and "&e1 Dzien &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 32 of {_x} to glowing iron pickaxe named "&cBan IP na 1 Dzien" with lore "" and "&7Zbanuj IP gracza &6%{_nick}% &7na" and "&e1 Miesiac &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
set slot 34 of {_x} to glowing diamond pickaxe named "&cBan IP na 1 Dzien" with lore "" and "&7Zbanuj IP gracza &6%{_nick}% &7na" and "&e1 Rok &7z powodem:" and "" and "&7Powod: &a%{_reason}%" and "" and "&eKliknij, aby zbanowac!"
open {_x} for {_player}
on inventory click:
if name of current inventory of player contains {@guititle}:
cancel event
if clicked slot is 10 or 12 or 14 or 16 or 28 or 30 or 32 or 34:
close player's inventory
set {_lore::*} to uncolored lore of clicked slot
set {_reason::*} to {_lore::5} split at "Powod: "
set {_name::*} to {_lore::2} split at " "
set {_gracz} to {_name::3}
set {_banlore::*} to {@baninfo}
if clicked slot is 28 or 30 or 32 or 34:
set {_gracz} to {_name::4} parsed as offline player's ip
if {IPBans::*} contains {_name::4} parsed as offline player's ip:
send "&cIP tego gracza jest juz zbanowane!"
stop
add {_name::4} parsed as offline player's ip to {IPBans::*}
send "&aZbanowano IP &6&l%{_name::4} parsed as offline player's ip%"
set {_banlore::*} to {@IPbaninfo}
else:
send "&aZbanowano Gracza &6&l%{_gracz}%&a!"
set {_time::*} to {_lore::3} split at " z powodem:"
replace all "{REASON}" with {_reason::2} in {_banlore::*}
replace all "{TIME}" with {_time::1} in {_banlore::*}
set {_banlore} to "%{_banlore::*}%"
replace all ", " and " and " with newline in {_banlore}
loop all players:
if {IPBans::*} contains loop-player's ip:
kick loop-player due to {_banlore}
kick {_name::3} parsed as offline player due to {_banlore}
set {Ban::%{_gracz}%::Time} to texttotime(uncolored {_time::1}) from now
set {Ban::%{_gracz}%::Reason} to {_reason::2}
wait 1 second
send timeformat(difference between now and {Ban::%{_gracz}%::Time})
on join:
wait 1 tick # Debug go (mc nie może postawić gracza na świecie xD)
set {_player} to player
set {_x} to {Ban::%{_player}%::Time}
remove now from {_x}
if {_x} > now:
set {_kick} to "Normal"
loop {IPBans::*}:
if player's ip is loop-value:
set {_kick} to player's ip
set {_x} to {Ban::%{_kick}%::Time}
if {_x} < now:
remove player's ip from {IPBans::*}
if {_kick} is set:
set {_banlore::*} to {@baninfo}
if {_kick} is not "Normal":
set {_player} to {_kick}
set {_banlore::*} to {@IPbaninfo}
replace all "{REASON}" with {Ban::%{_player}%::Reason} in {_banlore::*}
replace all "{TIME}" with timeformat(difference between now and {Ban::%{_player}%::Time}) in {_banlore::*}
set {_banlore} to "%{_banlore::*}%"
replace all ", " and " and " with newline in {_banlore}
kick player due to {_banlore}
stop
function texttotime(time: text) :: timespan:
if {_time} is "1Minuta":
return 1 minutes
if {_time} is "1 Tydzien":
return 1 week
if {_time} is "1 Miesiac":
return 1 month
if {_time} is "1 Rok":
return 1 year
command /unbanx [<text>]:
permission: *
permission message: &cNie mozesz tego zrobic!
trigger:
set {_x} to {Ban::%arg-1%::Time}
remove now from {_x}
if {_x} > now:
send "&aOdbanowano gracza &6&l%arg-1%&a!"
delete {Ban::%arg-1%::Time}
delete {Ban::%arg-1%::Reason}
else:
send "&cTen gracz nie jest zbanowany!"
command /unbanxip [<text>]:
permission: *
permission message: &cNie mozesz tego zrobic!
trigger:
set {_x} to {Ban::%arg-1%::Time}
remove now from {_x}
if {IPBans::*} contains arg-1:
if {_x} > now:
send "&aOdbanowano IP &6&l%arg-1%&a!"
delete {Ban::%arg-1%::Time}
delete {Ban::%arg-1%::Reason}
remove arg-1 from {IPBans::*}
else:
send "&cTen adres IP nie jest zbanowany!"
function timeformat(time: timespan) :: string:
set {_time} to "%{_time}%"
set {_timespan::*} to {_time} parsed as "%number% %string%[s][ and %number% %string%[s]]"
set {_first} to "%round({_timespan::1})%%first character of {_timespan::2}%"
set {_second} to "%round({_timespan::3})%%first character of {_timespan::4}%"
if {_second} is "60m":
set {_second} to "59m"
if {_second} is "24h":
set {_second} to "23h"
return ("%{_first}% %{_second}%" if {_timespan::3} is set, else "%{_first}%")
command /addban [<player>] [<text>] [<text>]:
trigger:
set {Ban::%arg-1%::Time} to texttotime(arg-2) from now
set {Ban::%arg-1%::Reason} to arg-3
send "Dodano bana dla %arg-1% na %arg-2% powód %arg-3%" to player
on inventory click:
if name of current inventory of player contains "&8Lista Banów":
cancel event
send "Kliknięto w GUI banów" to player
command /listabanów:
trigger:
displayBanListGUI(player)
function displayBanListGUI(player: player):
updateBanList()
set {_x} to chest inventory with 6 rows named "&8Lista Banów"
set {_row} to 0
open {_x} for {_player}
loop {Ban::*}:
set {_player} to loop-value
set {_reason} to {Ban::%{_player}%::Reason}
set {_time} to timeformat(difference between now and {Ban::%{_player}%::Time})
if {_time} contains "seconds":
continue # Pomiń przedmioty, które mają czas wygaśnięcia mniejszy niż 1 minuta
set {_item} to stone named "&c%{_player}%" with lore "&c&lZOSTALES ZBANOWANY" and "" and "&7Powod: &6%{_reason}%" and "&7Wygasa za: &e%{_time}%" and "" and "&bWiecej info na &nwww.Serwer.PL"
set {_slot} to (9 * {_row}) + 1
if {_slot} >= 54:
set {_slot} to 53
set slot {_slot} of {_x} to {_item}
add 1 to {_row}
if {_row} > 5:
stop
i czas w gui leci w dór ok ale póżniej odlicza w górę zamiast zniknąć item w gui tak samo wpisze innego gracza nie pojawi się tylko ciągle mój nick jest
Odnośnik do komentarza
https://skript.pl/temat/58118-lista-zbanowanych-os%C3%B3b/Udostępnij na innych stronach
3 odpowiedzi na to pytanie
Rekomendowane odpowiedzi
Dołącz do dyskusji
Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.