Bulundu LuckPerm süresi bitince spawna ışınlaması

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

ZeuX

Koydum Çalışma Masasını
Katılım
8 Temmuz 2020
Mesajlar
62
Elmaslar
8
Puan
8.885
Yaş
26
Konum
İstanbul, Türkiye
Minecraft
Fexerd

Discord:

fexed

Herkese selamlar. Oyuncular için biletli nether ve ende gidiş yaptım ama tek eksik, oyuncunun nether/end permi süresi bittiğinde spawna atmasını istiyorum.

Ek olarak, oyuncu süre bitmeden oyundan çıktı diyelim. Katıldığında on join yerinde perminin otomatik kontrol edilmesini istiyorum.

Şimdiden teşekkür ederim.
 

JavaScript:
options:
    endsure: 60 #saniye cinsinden
    nethersure: 60 # saniye cinsinden

on quit:
    if {endsüresi::%player%} is more than 0:
        set {endsüresidurdurma::%player%} to true
    
    else if {nethersüresi::%player%} is more than 0:
        set {nethersüresidurdurma::%player%} to true
        

on join:
    if {endsüresi::%player%} is more than 0:
        teleport player to {endlokasyon}
        delete {endsüresidurdurma::%player%}
        send "&aEnd Süreniz Bitmeden Çıkış Yaptığınız İçin End'e Geri Işınlandınız."
    else if {nethersüresi::%player%} is more than 0:
        teleport player to {netherlokasyon}
        delete {nethersüresidurdurma::%player%}
        send "&aNether Süreniz Bitmeden Çıkış Yaptığınız İçin End'e Geri Işınlandınız."

every 10 seconds: # istediğinizi gibi ayarlayabilirsiniz süreyi 10 ar 10 ar azaltıyor değiştirebilirsiniz remove 10 from {endsüresi::%loop-player%} kısmından
    loop all players in world "world_the_end":
        if {endsüresidurdurma::%loop-player%} isn't set:
            if {endsüresi::%loop-player%} is less than or equal to 0:
                teleport loop-player to {spawnLokasyonunuz}
                send "&cEnd Süreniz Bittiğinden Spawna Işınlandınız." to loop-player
            else:
                remove 10 from {endsüresi::%loop-player%}
    loop all players in world "world_nether":
        if {nethersüresidurdurma::%loop-player%} isn't set:
            if {nethersüresi::%loop-player%} is less than or equal to 0:
                teleport loop-player to {spawnLokasyonunuz}
                send "&cNether Süreniz Bittiğinden Spawna Işınlandınız." to loop-player
            else:
                remove 10 from {nethersüresi::%loop-player%}
        

command /endlokasyon: # End'e gidip lokasyonu seçiniz.
    permission: op
    trigger:
        set {endlokasyon} to player's location
        send "&aEnd lokasyonu başarıyla ayarlandı."
        stop

command /netherlokasyon: # End'e gidip lokasyonu seçiniz.
    permission: op
    trigger:
        set {netherlokasyon} to player's location
        send "&aNether lokasyonu başarıyla ayarlandı."
        stop

command /biletver [<player>] [<text>]: # Bilet verme komutu
    permission: op
    trigger:
        if arg-1 is set:
            if arg-2 is set:
                if arg-2 is "End":
                    give a paper named "&cEnd Giriş Bileti" to arg-1
                    send "&aBaşarıyla End Bileti Verildi."
                    send "&aBaşarıyla Nether Bileti Verildi." to player
                    stop
                if arg-2 is "Nether":
                    give a paper named "&eNether Giriş Bileti" to arg-1
                    send "&aBaşarıyla Nether Bileti Verildi." to player
                    stop
        else:
            send "&7Doğru Kullanım: &e/biletver <oyuncu> <nether/end>" to player
    
on right-click with paper:
    if player is holding paper named "&cEnd Giriş Bileti":
        teleport player to {endlokasyon}
        send "&aBaşarıyla End'e Giriş Yaptınız." to player
        remove paper named "&cEnd Giriş Bileti" from player
        set {endsüresi::%player%} to {@endsure}
    if player is holding paper named "&eNether Giriş Bileti":
        teleport player to {netherlokasyon}
        send "&aBaşarıyla Nether'a Giriş Yaptınız." to player
        remove paper named "&cNether Giriş Bileti" from player
        set {nethersüresi::%player%} to {@nethersure}

Merhaba, istediğiniz özelliklerde kodunuz hazırlandı yukarıda mevcuttur. İstediğiniz gibi oyuncunun perm süresi bittiğinde otomatik olarak spawna atıyor ve on join/on quit kontrolleri sağlanmıştır. Oyuncu eğer süresi bitmeden oyundan çıkış yaparsa süresi durduruluyor oyuna tekrar girdiğinde otomatik olarak aynı yerden devam ediyor ve süre devam ediyor. Kodda düzenlemeniz gereken kısımlar options: kısmındaki end/nether süreleri ve isteğe göre saniye cinsinden dakika cinsine çekebilirsiniz.

Konunuz Çözüldüyse Belirtmeyi Unutmayınız,

İyi Forumlar.
 

JavaScript:
options:
    endsure: 60 #saniye cinsinden
    nethersure: 60 # saniye cinsinden

on quit:
    if {endsüresi::%player%} is more than 0:
        set {endsüresidurdurma::%player%} to true
  
    else if {nethersüresi::%player%} is more than 0:
        set {nethersüresidurdurma::%player%} to true
      

on join:
    if {endsüresi::%player%} is more than 0:
        teleport player to {endlokasyon}
        delete {endsüresidurdurma::%player%}
        send "&aEnd Süreniz Bitmeden Çıkış Yaptığınız İçin End'e Geri Işınlandınız."
    else if {nethersüresi::%player%} is more than 0:
        teleport player to {netherlokasyon}
        delete {nethersüresidurdurma::%player%}
        send "&aNether Süreniz Bitmeden Çıkış Yaptığınız İçin End'e Geri Işınlandınız."

every 10 seconds: # istediğinizi gibi ayarlayabilirsiniz süreyi 10 ar 10 ar azaltıyor değiştirebilirsiniz remove 10 from {endsüresi::%loop-player%} kısmından
    loop all players in world "world_the_end":
        if {endsüresidurdurma::%loop-player%} isn't set:
            if {endsüresi::%loop-player%} is less than or equal to 0:
                teleport loop-player to {spawnLokasyonunuz}
                send "&cEnd Süreniz Bittiğinden Spawna Işınlandınız." to loop-player
            else:
                remove 10 from {endsüresi::%loop-player%}
    loop all players in world "world_nether":
        if {nethersüresidurdurma::%loop-player%} isn't set:
            if {nethersüresi::%loop-player%} is less than or equal to 0:
                teleport loop-player to {spawnLokasyonunuz}
                send "&cNether Süreniz Bittiğinden Spawna Işınlandınız." to loop-player
            else:
                remove 10 from {nethersüresi::%loop-player%}
      

command /endlokasyon: # End'e gidip lokasyonu seçiniz.
    permission: op
    trigger:
        set {endlokasyon} to player's location
        send "&aEnd lokasyonu başarıyla ayarlandı."
        stop

command /netherlokasyon: # End'e gidip lokasyonu seçiniz.
    permission: op
    trigger:
        set {netherlokasyon} to player's location
        send "&aNether lokasyonu başarıyla ayarlandı."
        stop

command /biletver [<player>] [<text>]: # Bilet verme komutu
    permission: op
    trigger:
        if arg-1 is set:
            if arg-2 is set:
                if arg-2 is "End":
                    give a paper named "&cEnd Giriş Bileti" to arg-1
                    send "&aBaşarıyla End Bileti Verildi."
                    send "&aBaşarıyla Nether Bileti Verildi." to player
                    stop
                if arg-2 is "Nether":
                    give a paper named "&eNether Giriş Bileti" to arg-1
                    send "&aBaşarıyla Nether Bileti Verildi." to player
                    stop
        else:
            send "&7Doğru Kullanım: &e/biletver <oyuncu> <nether/end>" to player
  
on right-click with paper:
    if player is holding paper named "&cEnd Giriş Bileti":
        teleport player to {endlokasyon}
        send "&aBaşarıyla End'e Giriş Yaptınız." to player
        remove paper named "&cEnd Giriş Bileti" from player
        set {endsüresi::%player%} to {@endsure}
    if player is holding paper named "&eNether Giriş Bileti":
        teleport player to {netherlokasyon}
        send "&aBaşarıyla Nether'a Giriş Yaptınız." to player
        remove paper named "&cNether Giriş Bileti" from player
        set {nethersüresi::%player%} to {@nethersure}

Merhaba, istediğiniz özelliklerde kodunuz hazırlandı yukarıda mevcuttur. İstediğiniz gibi oyuncunun perm süresi bittiğinde otomatik olarak spawna atıyor ve on join/on quit kontrolleri sağlanmıştır. Oyuncu eğer süresi bitmeden oyundan çıkış yaparsa süresi durduruluyor oyuna tekrar girdiğinde otomatik olarak aynı yerden devam ediyor ve süre devam ediyor. Kodda düzenlemeniz gereken kısımlar options: kısmındaki end/nether süreleri ve isteğe göre saniye cinsinden dakika cinsine çekebilirsiniz.

Konunuz Çözüldüyse Belirtmeyi Unutmayınız,
İyi Forumlar.
Elinize sağlık hocam.
 
Son düzenleme:
Kod:
options:
    nether-süre: 600 # Nether süresi (saniye)
    end-süre: 600 # End süresi (saniye)

command /setspawn:
    permission: op
    trigger:
        set {spawn-location} to location of player
        send "&aSpawn noktası kaydedildi!" to player

command /setwarp nether:
    permission: op
    trigger:
        set {nether-warp-location} to location of player
        send "&6Nether warp noktası kaydedildi!" to player

command /setwarp end:
    permission: op
    trigger:
        set {end-warp-location} to location of player
        send "&5End warp noktası kaydedildi!" to player

command /warp nether:
    trigger:
        if {nether-warp-location} is not set:
            send "&cNether warp noktası ayarlanmadı!" to player
            stop
        if player's world is "world_nether":
            send "&cZaten Nether'desin!" to player
            stop
        if {spawn-location} is not set:
            send "&cSpawn noktası ayarlanmadığı için giriş yapamazsın!" to player
            stop
        if player's balance >= 100: # Örnek ücret
            remove 100 from player's balance
            set {nether::%player%} to now + {@nether-süre} seconds
            teleport player to {nether-warp-location}
            send "&6Nether'e giriş yaptın! Süren: {@nether-süre} saniye" to player
        else:
            send "&cYeterli paran yok!" to player

command /warp end:
    trigger:
        if {end-warp-location} is not set:
            send "&cEnd warp noktası ayarlanmadı!" to player
            stop
        if player's world is "world_the_end":
            send "&cZaten End'desin!" to player
            stop
        if {spawn-location} is not set:
            send "&cSpawn noktası ayarlanmadığı için giriş yapamazsın!" to player
            stop
        if player's balance >= 200: # Örnek ücret
            remove 200 from player's balance
            set {end::%player%} to now + {@end-süre} seconds
            teleport player to {end-warp-location}
            send "&5End'e giriş yaptın! Süren: {@end-süre} saniye" to player
        else:
            send "&cYeterli paran yok!" to player

every 5 seconds:
    loop all players:
        if loop-player's world is "world_nether" and {nether::%loop-player%} is set:
            if {nether::%loop-player%} <= now:
                teleport loop-player to {spawn-location}
                send "&cNether süren bitti, spawna ışınlandın!" to loop-player
                delete {nether::%loop-player%}
        if loop-player's world is "world_the_end" and {end::%loop-player%} is set:
            if {end::%loop-player%} <= now:
                teleport loop-player to {spawn-location}
                send "&cEnd süren bitti, spawna ışınlandın!" to loop-player
                delete {end::%loop-player%}

on join:
    if {nether::%player%} is set and {nether::%player%} <= now:
        teleport player to {spawn-location}
        send "&cNether süren bitmişti, spawna ışınlandın!" to player
        delete {nether::%player%}
    if {end::%player%} is set and {end::%player%} <= now:
        teleport player to {spawn-location}
        send "&cEnd süren bitmişti, spawna ışınlandın!" to player
        delete {end::%player%}

Zaman kontrolü her saniye yerine 5 saniyede bir yapılıyor "Sunucu performansı için daha iyi"Oyuncu oyuna girince süresi bittiyse direkt spawna ışınlanıyor Spawn konumu kontrolü eklendi Eğer kayıtlı değilse, oyuncuların giriş yapması engellendi. Daha temiz bir kod olmuş oldu yukarıdaki kod :).
 
Yapay zekaya yaptırdım daha kısa oldu ama teşekkürler.
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Hala Discord sunucumuza katılmadın mı?

Büyük bir topluluğun parçası ol, etkinliklere katıl ve özel hediyeler kazanma şansı yakala!

Şimdi Katıl
Üst