Metin 2 Otomatik Event

  • Konuyu Başlatan Konuyu Başlatan Ferrari
  • Başlangıç tarihi Başlangıç tarihi
  • Görüntülenme Görüntülenme 655
Kayıtlı
1 Yıl 9 Ay 29 Gün
Katılım
23 Ara 2024
Konular
0
Mesajlar
111
Tepkime puanı
127
Online süresi
49m
Puan
53
1736177608368.jpeg

Herkese Merhaba!

Bugün sizler ile " Metin 2 Otomatik Event " Quest'i hakkında bilgilendireceğim dilerseniz başlayalım.

Bu anlatım totalde 3 bölümden oluşmaktadır.

1. Bölüm

Filezilla programımızı açıyoruz ve " usr/game/share/locale/turkey/quest " dizinine gelelim.

Daha sonrasında sizler ile spoiler'da paylacağım kodu " oto_event.lua " adında bir lua dosyası açıp kaydediniz.

Dipnot : Bunu yaparken Notepad++ kullanmanızı öneririm.

C++:
quest oto_event begin
    state start begin
        when login with pc.is_gm() begin
            clear_server_timer("oto_event")
            server_loop_timer("oto_event",1)
        end
        when oto_event.server_timer begin
            local saat = tonumber(os.date("%H"))
            local time = os.date("%X")
            local gun = tostring(os.date("%A"))
            if gun == "Monday" then
                if time == "21:00:00" then
                    if game.get_event_flag("ayisigi") == 0 then
                        game.set_event_flag("ayisigi",1)
                        notice_all("Ayisigi Define Sandığı eventi 2 saat süreyle başlamıştır.")
                    end
                elseif time == "23:00:00" then
                    if game.get_event_flag("ayisigi") == 1 then
                        game.set_event_flag("ayisigi",0)
                        notice_all("Ayisigi Define Sandığı eventi sona ermiştir.")
                    end
                end
            elseif gun == "Tuesday" then
                if time == "21:00:00" then
                    if game.get_event_flag("event_altigen_drop") == 0 then
                        game.set_event_flag("event_altigen_drop",1)
                        notice_all("Altıgen Hediye Paketş eventi 2 saat süreyle başlamıştır.")
                    end
                elseif time == "23:00:00" then
                    if game.get_event_flag("event_altigen_drop") == 1 then
                        game.set_event_flag("event_altigen_drop",0)
                        notice_all("Altıgen Hediye Paketi eventi sona ermiştir.")
                    end
                end
            elseif gun == "Wednesday" then
                if time == "18:59:50" then
                    if game.get_event_flag("sertifika_drop") == 0 then
                        game.set_event_flag("sertifika_drop",1)
                        notice_all("Sertifika eventi 2,5 saat süreyle başlamıştır.")
                    end
                elseif time == "21:29:50" then
                    if game.get_event_flag("sertifika_drop") == 1 then
                        game.set_event_flag("sertifika_drop",0)
                        notice_all("Sertifika eventi sona ermiştir.")
                    end
                end
            elseif gun == "Thursday" then
                if time == "21:00:00" then
                    if game.get_event_flag("col_firtinasi_drop") == 0 then
                        game.set_event_flag("col_firtinasi_drop",1)
                        notice_all("Çöl Fırtınası eventi 1 saat süreyle başlamıştır.")
                    end
                elseif time == "22:00:00" then
                    if game.get_event_flag("col_firtinasi_drop") == 1 then
                        game.set_event_flag("col_firtinasi_drop",0)
                        notice_all("Çöl Fırtınası eventi sona ermiştir.")
                    end
                end
            elseif gun == "Friday" then
                if time == "20:00:00" then
                    if game.get_event_flag("football_drop") == 0 then
                        game.set_event_flag("football_drop",1)
                        game.set_event_flag("new_football_2014_event",1)
                        notice_all("Dünya Kupası eventi 3 saat süreyle başlamıştır.")
                    end
                elseif time == "23:00:00" then
                    if game.get_event_flag("football_drop") == 1 then
                        game.set_event_flag("football_drop",0)
                        game.set_event_flag("new_football_2014_event",0)
                        notice_all("Dünya Kupası eventi sona ermiştir.")
                    end
                end
            elseif gun == "Saturday" then
                if time == "21:00:00" then
                    if game.get_event_flag("sonsuz_kis_drop") == 0 then
                        game.set_event_flag("sonsuz_kis_drop",1)
                        notice_all("Sonsuz Kış Sandığı eventi 1 saat süreyle başlamıştır.")
                    end
                elseif time == "22:00:00" then
                    if game.get_event_flag("sonsuz_kis_drop") == 1 then
                        game.set_event_flag("sonsuz_kis_drop",0)
                        notice_all("Sonsuz Kış Sandığı eventi sona ermiştir.")
                    end
                end
            elseif gun == "Sunday" then
                if time == "19:00:00" then
                    if game.get_event_flag("cards_event") == 0 then
                        game.set_event_flag("cards_event",1)
                        notice_all("Okey Kart eventi 4 saat süreyle başlamıştır.")
                    end
                elseif time == "23:00:00" then
                    if game.get_event_flag("cards_event") == 1 then
                        game.set_event_flag("cards_event",0)
                        notice_all("Okey Kart eventi sona ermiştir.")
                    end
                end
            end
        end
    end
end


2. Bölüm

Putty Login ile giriş sağlayın.

Daha sonrasında " cd /usr/game/share/locale/turkey/quest " yazınız ve hemen ardında " /qc oto_event.lua " yazıp enterlayınız.

Hemen sonrasında sunucunuzu reboot edin veya oyun içerisinde GM karakterinizle /reload yazınız.

Dipnot: Kendi eventlerinizin açılması için gereken kodları set_event_flag ve get_event_flag kısmına yazınız.

3. Bölüm (Sunucu / Server Saat Kontrolü)

Belirlenen saatlerde etkinliklerin / eventlerin başlaması için sunucu saatinizin yerel saat ile aynı olması lazım onu kontrol etmek için " Putty login " ile giriş sağlayıp. " date " yazarak sunucu saatinizi öğrenebilirsiniz.

Dipnot : Eğer ki yerel saatiniz uyuşmuyorsa spoiler da paylaştığım şekilde sunucu saatini değiştirebilirsiniz.
Kod:
Kod:
Örnek --> "date 201712131542" açılım şekli şu şekildedir. Yıl:2017 , Ay : 12 , Gün: 13 , Saat : 15:42
Herkese iyi günler!
İyi forumlar
 

Benzer konular

Geri
Üst