Skocz do zawartości
  • 0

Problem ze skryptem na Cuboid !


Pytanie

Witam. Tak jak w temacie. Problem polega na tym że, gdy chce usunąć swojego cuboida komendą "/cube usun" skrypt oznajmia mnie "Usunięto cuboida" lecz tak naprawdę w dalszym ciągu cuboid istnieje. Nadal inny gracz nie może w tym miejscu budować oraz jak wchodzi w usuniętego cuboida to na czacie pojawia się informacja "Cuboid gracza (nazwagracza}" oraz jak się wychodzi z niego. Proszę was o pomoc. (SKRYPT NIE JEST MOJEGO AUTORSTWA)

Pluginy:

worldedit-bukkit-7.2.5-dist

worldguard-bukkit-7.0.5-dist

skript 2.6.3

Wersja serwera 1.16.5 PaperSpigot

Skrypt:

Spoiler

# CuboidsPlus
# Skrypt przeznaczony na serwery typu Kwadratowa Masakra
# Autor: shiworld
# Wersja: 1.1
# Skrypt był testowany na wersji Skript 2.0.2
# Do poprawnego działania skryptu wymagany jest plugin WORLDGUARD!
# Licencja:
# - zakaz podszywania się pod autora
# - zakaz handlu skryptem
# - zakaz edytowania kodu skryptu
# - zakaz usuwania komendy /cub autor
# Waluta używana to SZMARAGDY. Jeśli chcesz mieć inną walutę i nie wiesz jak przerobić skrypt, by wyglądał estetycznie i był bez błędów SKONTAKTUJ SIĘ ZE MNĄ na email - [email protected] !
# Na zamówienie osoby, mogę przerobić skrypt na zwykłe działki (darmowe lub płatne!)

variables:
    {cub.set.%player%} = false
    {cub.tp.%player%} = false

command /cuboid [<text>] [<text>]:
    permission: lckm.cub
    aliases: cub
    trigger:
        if arg 1 is "list":
            if arg 2 is not set:
                send "&7&m================&7[&3CUB&7]&7&m================"
                send "&7[ &3NR&7 ]   [ &3CENA&7 ]                       [ &3WYMIARY&7 ]"
                send "&7    1         32 SZ           -              10x10"
                send "&7    2         64 SZ           -              20x20"
                send "&7    3        128 SZ          -              30x30"
                send "&cPrzy zakladaniu (/cuboid zaloz [ID]) podaj"
                send "&c                 numer typu (1-3)!"
                send "&7                  SZ - szmaragdy"
                send "&7&m===================================="
        if arg 1 is "zaloz" or "stworz":
            if arg 2 is "1":
                if {cub.set.%player%} is false:
                    if player has 32 emerald:
                        set {pos%player%} to location of player
                        set {pos1%player%} to {pos%player%}
                        set {cub.set.%player%} to true
                        set {cubdom.%player%} to location of player
                        wait 1 second
                        remove 32 emerald from player
                        execute console command "pex user %name of player% add worldedit.*"
                        execute console command "pex user %name of player% add worldguard.*"
                        execute player command "//pos1"
                        execute player command "//pos2"
                        execute player command "//expand 5 n"
                        execute player command "//expand 5 s"
                        execute player command "//expand 5 w"
                        execute player command "//expand 5 e"
                        execute player command "//expand vert"
                        execute player command "rg define %name of player%"
                        execute player command "rg addowner %name of player% %name of player%"
                        execute player command "rg flag %name of player% chest-access deny" 
                        execute player command "rg flag %name of player% pvp deny" 
                        execute player command "rg flag %name of player% lava-fire deny" 
                        execute player command "rg flag %name of player% tnt deny" 
                        execute player command "rg flag %name of player% creeper-explosion deny" 
                        execute player command "rg flag %name of player% other-explosion deny" 
                        execute player command "rg flag %name of player% greeting &3&o>> &7Cuboid gracza &3%player%" 
                        execute player command "rg flag %name of player% farewell &3&o>> &7Teren publiczny!" 
                        execute console command "pex user %name of player% remove worldedit.*"
                        execute console command "pex user %name of player% remove worldguard.*"    
                        loop 99 times:
                            send ""
                        wait 1 second
                        send "&3&o>> &7Stworzyles teren &31 &7o wymiarach &310x10&7!" to player
                        broadcast "&3&o>> &7Gracz &3%player% &7zalozyl teren &31&7!"
                    else:
                        send "&3&o>> &7Nie masz &332 szmaragdów&7!"
                        stop
            if arg 2 is "2":
                if player has 64 emerald:
                    set {pos%player%} to location of player
                    set {pos1%player%} to {pos%player%}
                    set {cub.set.%player%} to true
                    set {cubdom.%player%} to location of player
                    wait 1 second
                    remove 64 emerald from player
                    execute console command "pex user %name of player% add worldedit.*"
                    execute console command "pex user %name of player% add worldguard.*"
                    execute player command "//pos1"
                    execute player command "//pos2"
                    execute player command "//expand 10 n"
                    execute player command "//expand 10 s"
                    execute player command "//expand 10 w"
                    execute player command "//expand 10 e"
                    execute player command "//expand vert"
                    execute player command "rg define %name of player%"
                    execute player command "rg addowner %name of player% %name of player%"
                    execute player command "rg flag %name of player% chest-access deny" 
                    execute player command "rg flag %name of player% pvp deny" 
                    execute player command "rg flag %name of player% lava-fire deny" 
                    execute player command "rg flag %name of player% tnt deny" 
                    execute player command "rg flag %name of player% creeper-explosion deny" 
                    execute player command "rg flag %name of player% other-explosion deny" 
                    execute player command "rg flag %name of player% greeting &3&o>> &7Cuboid gracza &3%player%" 
                    execute player command "rg flag %name of player% farewell &3&o>> &7Teren publiczny!" 
                    execute console command "pex user %name of player% remove worldedit.*"
                    execute console command "pex user %name of player% remove worldguard.*"    
                    loop 99 times:
                        send ""
                    wait 1 second
                    send "&3&o>> &7Stworzyles teren &32 &7o wymiarach &320x20&7!" to player
                    broadcast "&3&o>> &7Gracz &3%player% &7zalozyl teren &32&7!"
                else:
                    send "&3&o>> &7Nie masz &364 szmaragdów&7!"
                    stop
            if arg 2 is "3":
                if player has 128 emerald:    
                    set {pos%player%} to location of player
                    set {pos1%player%} to {pos%player%}
                    set {cub.set.%player%} to true
                    set {cubdom.%player%} to location of player
                    wait 1 second
                    remove 128 emerald from player
                    execute console command "pex user %name of player% add worldedit.*"
                    execute console command "pex user %name of player% add worldguard.*"
                    execute player command "//pos1"
                    execute player command "//pos2"
                    execute player command "//expand 15 n"
                    execute player command "//expand 15 s"
                    execute player command "//expand 15 w"
                    execute player command "//expand 15 e"
                    execute player command "//expand vert"
                    execute player command "rg define %name of player%"
                    execute player command "rg addowner %name of player% %name of player%"
                    execute player command "rg flag %name of player% chest-access deny" 
                    execute player command "rg flag %name of player% pvp deny" 
                    execute player command "rg flag %name of player% lava-fire deny" 
                    execute player command "rg flag %name of player% tnt deny" 
                    execute player command "rg flag %name of player% creeper-explosion deny" 
                    execute player command "rg flag %name of player% other-explosion deny" 
                    execute player command "rg flag %name of player% greeting &3&o>> &7Cuboid gracza &3%player%" 
                    execute player command "rg flag %name of player% farewell &3&o>> &7Teren publiczny!" 
                    execute console command "pex user %name of player% remove worldedit.*"
                    execute console command "pex user %name of player% remove worldguard.*"    
                    loop 99 times:
                        send ""
                    wait 1 second
                    send "&3&o>> &7Stworzyles teren &33 &7o wymiarach &330x30&7!" to player
                    broadcast "&3&o>> &7Gracz &3%player% &7zalozyl teren &33&7!"
                else:
                    send "&3&o>> &7Nie masz &3128 szmaragdów&7!"
                    stop
        if arg 1 is "dodaj":
            if arg 2 is set:
                execute console command "pex user %name of player% add worldguard.*"    
                execute player command "rg addmember %name of player% %arg 2%"
                execute console command "pex user %name of player% remove worldguard.*"
                send "&3&o>> &7Dodales gracza &3%arg 2% &7do terenu!"
            else:
                send "&3&o>> &7Podaj nick gracza!"
                stop
        if arg 1 is "wyrzuc":
            if arg 2 is set:
                execute console command "pex user %name of player% add worldguard.*"    
                execute player command "rg removemember %name of player% %arg 2%"
                execute player command "pex user %name of player% remove worldguard.*"
                send "&3&o>> &7Usunales gracza &3%arg 2% &7z terenu!"
            else:
                send "&3&o>> &7Podaj nick gracza!"    
                stop
        if arg 1 is "help":
            if arg 2 is not set:
                send "&7&m==============&7[&3CUB&7]&7&m=============="
                send "&3/cub help &7-pokazuje to menu"
                send "&3/cub zaloz [ID] &7-zabezpiecza teren"
                send "&3/cub dodaj [NICK] &7-dodaje gracza"
                send "&3/cub wyrzuc [NICK] &7-usuwa gracza"
                send "&3/cub list &7-cennik i wymiary terenów"
                send "&3/cub usun &7-usuwa zabezpieczenie terenu"
                send "&3/cub dom &7-teleportuje do domu"
                send "&3/cub autor &7-informacje o autorze"
                send "&7&m================================"
        if arg 1 is "usun":
            if arg 2 is not set:
                if {cub.set.%player%} is true:
                    execute console command "rg remove -w LC %name of player%"
                    send "&3&o>> &7Usunales teren!"
                    set {cub.set.%player%} to false
                else:
                    send "&3&o>> &7Nie masz swojego terenu!"
        if arg 1 is "dom":
            if arg 2 is not set:
                if {cub.set.%player%} is true:
                    set {cubtp.%player%} to true
                    send "&3&o>> &7Teleportacja za &35 &7sekund!"
                    set {cubtpl} to location of player
                    wait 1 second
                    if {cubtpl} isn't location of player:
                        send "&3&o>> &7Teleportacja zostala przerwana!"
                        set {cubtp.%player%} to false
                        stop
                    wait 1 second
                    if {cubtpl} isn't location of player:
                        send "&3&o>> &7Teleportacja zostala przerwana!"
                        set {cubtp.%player%} to false
                        stop
                    wait 1 second
                    if {cubtpl} isn't location of player:
                        send "&3&o>> &7Teleportacja zostala przerwana!"
                        set {cubtptp.%player%} to false
                        stop
                    wait 1 second
                    if {cubtpl} isn't location of player:
                        send "&3&o>> &7Teleportacja zostala przerwana!"
                        set {cubtptp.%player%} to false
                        stop
                    wait 1 second
                    if {cubtpl} isn't location of player:
                        send "&3&o>> &7Teleportacja zostala przerwana!"
                        set {cubtptp.%player%} to false
                        stop
                    teleport player to {cubdom.%player%}
                    send "&3&o>> &7Zostales przeteleportowany na swoj teren!"
                else:
                    send "&3&o>> &7Nie masz swojego terenu!"
        if arg 1 is "autor":
            if arg 2 is not set:
                send "&7&m==============&7[&3CUB&7]&7&m=============="
                send "&7 Autor: &3shiworld"
                send "&7 Wersja: &31.1"
                send "&7&m================================"
        if arg 1 is not set:
            if arg 2 is not set:
                send "&7&m==============&7[&3CUB&7]&7&m=============="
                send "&3/cub help &7-pokazuje to menu"
                send "&3/cub zaloz [ID] &7-zabezpiecza teren"
                send "&3/cub dodaj [NICK] &7-dodaje gracza"
                send "&3/cub wyrzuc [NICK] &7-usuwa gracza"
                send "&3/cub list &7-cennik i wymiary terenów"
                send "&3/cub usun &7-usuwa zabezpieczenie terenu"
                send "&3/cub dom &7-teleportuje do domu"
                send "&3/cub autor &7-informacje o autorze"
                send "&7&m================================"    

on command "cuboid zaloz" or "cub zaloz":
    if {cub.set.%player%} is true:
        cancel event
        send "&3&o>> &7Posiadasz juz swoj teren!"

Tylko mam prośbę, jezeli ktoś zdecyduje się pomóc to proszę o wstawienie poprawki w skrypt. Żebym nie musiał wklejać bo jestem noga w skryptach.  Dzięki !

Odnośnik do komentarza
https://skript.pl/temat/54919-problem-ze-skryptem-na-cuboid/
Udostępnij na innych stronach

6 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

W linii 180. skryptu (gdzie się znajduje linia execute console command "rg remove -w LC %name of player%") zmień -w LC na -w %player's world%  . Jeśli nie zadziała, spróbuj -w world

Edytowane przez 3meraldK
Odnośnik do komentarza
https://skript.pl/temat/54919-problem-ze-skryptem-na-cuboid/#findComment-332298
Udostępnij na innych stronach

  • 0

@3meraldK Próbowałem ale nie zadziałało. Wpisałem zamiast tego "rg delete -w %world% %player%" i śmiga jak ta lala tylko muszę sprawdzić na normalnym graczu bo na op działa normalnie Dzięki !

 

I jednak napotkałem problem. Do jakich permisji musi mieć zwykły gracz dostęp aby ten wycinek działał poprawnie ?

Wycinek ze skryptu:

Spoiler

                        execute player command "//pos1"
                        execute player command "//pos2"
                        execute player command "//expand 5 n"
                        execute player command "//expand 5 s"
                        execute player command "//expand 5 w"
                        execute player command "//expand 5 e"
                        execute player command "//expand vert"
                        execute player command "rg define %name of player%"
                        execute player command "rg addowner %name of player% %name of player%"
                        execute player command "rg flag %name of player% chest-access deny" 
                        execute player command "rg flag %name of player% pvp deny" 
                        execute player command "rg flag %name of player% lava-fire deny" 
                        execute player command "rg flag %name of player% tnt deny" 
                        execute player command "rg flag %name of player% creeper-explosion deny" 
                        execute player command "rg flag %name of player% other-explosion deny" 
                        execute player command "rg flag %name of player% greeting &3&o>> &7Cuboid gracza &3%player%" 
                        execute player command "rg flag %name of player% farewell &3&o>> &7Teren publiczny!"

Bo reszta skryptu jest "execute console command" która działa poprawnie.

Dodałem permisje:

worldedit.selection.pos

worldedit.selection.expand

worldguard.region.define

worldguard.region.addowner.*

worldguard.region.flag.*

Ale tepermisje są niebezpieczne dla Serwera :/ Proszę o pomoc

 

Już zauważyłem ... to kwestia PermissionEx .. ja posiadam luckypermsa. Muszę zmienić liniki na LuckyPermsa ...

Glicz

Łączę posty.

Notatka dodana przez Glicz

Odnośnik do komentarza
https://skript.pl/temat/54919-problem-ze-skryptem-na-cuboid/#findComment-332299
Udostępnij na innych stronach

  • 0
58 minut temu, TalibKweli25 napisał:

I jednak napotkałem problem. Do jakich permisji musi mieć zwykły gracz dostęp aby ten wycinek działał poprawnie ?

Wycinek ze skryptu:

  Pokaż ukrytą zawartość

                        execute player command "//pos1"
                        execute player command "//pos2"
                        execute player command "//expand 5 n"
                        execute player command "//expand 5 s"
                        execute player command "//expand 5 w"
                        execute player command "//expand 5 e"
                        execute player command "//expand vert"
                        execute player command "rg define %name of player%"
                        execute player command "rg addowner %name of player% %name of player%"
                        execute player command "rg flag %name of player% chest-access deny" 
                        execute player command "rg flag %name of player% pvp deny" 
                        execute player command "rg flag %name of player% lava-fire deny" 
                        execute player command "rg flag %name of player% tnt deny" 
                        execute player command "rg flag %name of player% creeper-explosion deny" 
                        execute player command "rg flag %name of player% other-explosion deny" 
                        execute player command "rg flag %name of player% greeting &3&o>> &7Cuboid gracza &3%player%" 
                        execute player command "rg flag %name of player% farewell &3&o>> &7Teren publiczny!"

Bo reszta skryptu jest "execute console command" która działa poprawnie.

Dodałem permisje:

worldedit.selection.pos

worldedit.selection.expand

worldguard.region.define

worldguard.region.addowner.*

worldguard.region.flag.*

Ale tepermisje są niebezpieczne dla Serwera :/ Proszę o pomoc

Permisje worldedit'a które dałeś są jeszcze bezpieczne, ale trzy ostatnie nie są. A tutaj się nie obędzie bez użycia skript-reflect, bo Skript nie może tworzyć regionów. Musiałbyś zgłębić się w kod pluginu WorldGuard, i ta prośba już bardziej pasuje pod zlecenie, niż problem/pytanie.

Odnośnik do komentarza
https://skript.pl/temat/54919-problem-ze-skryptem-na-cuboid/#findComment-332303
Udostępnij na innych stronach

  • 0

@3meraldKNie zrozumieliśmy się trochę xD chodzi mi o to że, do tego Cuboidu jest potrzebny plugin "PermissionEx" a ja posiadam "LuckyPermsa"

Konsola egzekwuje komende:

                       execute console command "pex user %name of player% add worldedit.*"
                       execute console command "pex user %name of player% add worldguard.*"

Dodaje do danego gracza permisje "worldedit.*" i "worldguard.*". (To są komendy pluginu PermissionEx)

Później ją kasuje:

                       execute console command "pex user %name of player% remove worldedit.*"
                       execute console command "pex user %name of player% remove worldguard.*"

Mam problem żeby zamienić te komendy na komendy LuckyPermsa. Żadna kombinacja nie działa niestety.

Może ktoś ma pomysł na to, jak to zmyślnie rozwiązać ?

 

 

Odnośnik do komentarza
https://skript.pl/temat/54919-problem-ze-skryptem-na-cuboid/#findComment-332308
Udostępnij na innych stronach

  • 0

Jednak dałem radę sam. Podstawiłem taką wartość:

                        execute console command "lp user %name of player% permission set worldedit.*"
                        execute console command "lp user %name of player% permission set worldguard.*"

Wszystko śmiga jak należy !

Temat do zamknięcie !

Odnośnik do komentarza
https://skript.pl/temat/54919-problem-ze-skryptem-na-cuboid/#findComment-332310
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...