Sistem Görüntüsü
Root
uigameoption Acılır.
En Alta Bu Kodu Ekliyoruz
Kod:
def __IsSpecialMap1(self): Blocked_MAPS1 = [ "season1/metin2_map_oxevent", "metin2_map_deviltower1", "metin2_map_duel", "metin2_map_duel2", "metin2_map_a1", "metin2_map_b1", "metin2_map_c1", "metin2_map_duel2", ] if str(background.GetCurrentMapName()) in Blocked_MAPS1: return TRUE return FALSE
Aratılır: def __OnClickPvPModeRevengeButton(self):
Komple Değistirilir.
Kod:
def __OnClickPvPModeRevengeButton(self): if self.__CheckPvPProtectedLevelPlayer(): return self.__RefreshPVPButtonList() if self.__IsSpecialMap1(): chat.AppendChat(1, "Bu haritada Düşman Modu Kullanılamaz") return if constInfo.PVPMODE_ENABLE: net.SendChatPacket("/pkmode 1", chat.CHAT_TYPE_TALKING) else: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
Aratılır: def __OnClickPvPModeFreeButton(self):
Komple Değistirilir.
Kod:
def __OnClickPvPModeFreeButton(self): if self.__CheckPvPProtectedLevelPlayer(): return self.__RefreshPVPButtonList() if self.__IsSpecialMap1(): chat.AppendChat(1, "Bu haritada Serbest Modu Kullanılamaz") return if constInfo.PVPMODE_ENABLE: net.SendChatPacket("/pkmode 2", chat.CHAT_TYPE_TALKING) else: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
Aratılır def __OnClickPvPModeGuildButton(self):
Komple Değistirilir
Kod:
def __OnClickPvPModeGuildButton(self): if self.__CheckPvPProtectedLevelPlayer(): return self.__RefreshPVPButtonList() if 0 == player.GetGuildID(): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE) return if self.__IsSpecialMap1(): chat.AppendChat(1, "Bu haritada Lonca Modu Kullanılamaz") return if constInfo.PVPMODE_ENABLE: net.SendChatPacket("/pkmode 4", chat.CHAT_TYPE_TALKING) else: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
TXT Anlatım Mevcutur. Tab Ayarlıdır.
Kurulum Metaryelleri
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Virüs Total
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Python: Herhangi Bir Haritada Serbest Mod Engelleme
Giriş
Metin2 özel sunucu geliştirme süreçlerinde, oyuncuların bazı alanlarda sınırsız hareket etmesini engellemek isteyebilirsiniz. Özellikle PvP sistemlerinde veya belirli görev alanlarında, serbest modun aktif olmaması güvenlik açısından kritiktir. Bu yazıda, Python kullanarak herhangi bir harita üzerinde serbest mod (Free Mode) kullanımını nasıl engelleyeceğimizi adım adım inceleyeceğiz.
Serbest Mod Nedir?
Serbest mod, oyuncuların belirli sınırlamalar olmadan hareket edebildiği, PvP veya görev sistemlerinden etkilenmeden gezinebildiği bir moddur. Bu mod, geliştiriciler tarafından test süreçlerinde veya özel durumlarda kullanılabilir; ancak bazı haritalarda aktif kalması oyun dengesini bozabilir.
Neden Serbest Mod Engellenmeli?
Metin2 özel sunucularda PvP sistemleri, görev akışları ve güvenlik önlemleri büyük önem taşır. Eğer bir haritada serbest mod açık bırakılırsa, oyuncular görevleri atlayabilir, PvP sistemlerini bypass edebilir veya güvenli bölgelerde haksız avantaj elde edebilirler. Bu nedenle bazı haritalarda serbest modu kapatmak gerekir.
Python ile Serbest Mod Engelleme Sistemi
Python, Metin2 özel sunucularında genellikle sunucu tarafında script yazımı için kullanılır. Py Root klasörü altında geliştirilen sistemlerle oyuncu davranışlarını kontrol etmek mümkündür. Aşağıda, herhangi bir haritada serbest mod kullanımını engelleyen örnek bir Python kodu verilmiştir:
Kod:
[B][COLOR=#9365b8]def onEnter(self):[BR][/BR] if app.IsFreeMode():[BR][/BR] net.SendChatPacket('/freemod', chat.CHAT_TYPE_TALK)[BR][/BR] chat.AppendChat(chat.CHAT_TYPE_INFO, 'Bu haritada serbest mod aktif edilemez!')[/COLOR][/B]
Açıklama:
- app.IsFreeMode(): Oyuncunun serbest modda olup olmadığını kontrol eder.
- net.SendChatPacket(): Sunucuya komut göndererek serbest modu kapatır.
- chat.AppendChat(): Oyuncuya bilgi mesajı gösterir.
Harita Bazlı Kontrol
Her harita için farklı kurallar tanımlamak istiyorsanız, harita adını kontrol eden bir yapı kurabilirsiniz. Örneğin, sadece 'Metin2City' haritasında serbest mod kapalı olacaksa:
Kod:
[B][COLOR=#9365b8]def onEnter(self):[BR][/BR] current_map = chr.GetMapName()[BR][/BR] restricted_maps = ['Metin2City', 'PvPArena'][BR][/BR] if app.IsFreeMode() and current_map in restricted_maps:[BR][/BR] net.SendChatPacket('/freemod', chat.CHAT_TYPE_TALK)[BR][/BR] chat.AppendChat(chat.CHAT_TYPE_INFO, f'{current_map} haritasında serbest mod kullanılamaz!')[/COLOR][/B]
Uygulama Adımları
1. Python dosyasını Py Root klasörüne ekleyin.
2. Gerekli event triggerları (örneğin onEnter, onLeave) ile tetiklenmesini sağlayın.
3. Harita adlarını doğru şekilde tanımladığınızdan emin olun.
4. Test ederek sistemin çalıştığını doğrulayın.
Sonuç
Python kullanarak Metin2 özel sunucularda serbest mod kullanımını harita bazlı olarak kolayca engelleyebilirsiniz. Bu yöntem hem güvenlik hem de deneyim açısından önemli bir rol oynar. Geliştiriciler, bu sistemi PvP alanları, görev haritaları veya özel etkinlik alanları için özelleştirebilirler.
Python: Blocking Free Mode on Any Map
Introduction
In the process of developing Metin2 private servers, you may want to prevent players from moving freely in certain areas. Especially in PvP systems or specific quest zones, disabling free mode is critical for security. In this article, we will examine step by step how to block free mode on any map using Python.
What is Free Mode?
Free mode allows players to move without restrictions, navigate safely without being affected by PvP or quest systems. This mode can be used during testing phases or special cases by developers; however, leaving it active on some maps might disrupt game balance.
Why Should Free Mode Be Blocked?
In Metin2 private servers, PvP systems, quest flows, and security measures are of great importance. If free mode remains active on a map, players might skip quests, bypass PvP mechanics, or gain unfair advantages in safe zones. Therefore, disabling free mode on certain maps is necessary.
Blocking Free Mode with Python
Python is commonly used for scripting on the server-side in Metin2 private servers. Systems developed under the Py Root folder allow control over player behavior. Below is an example Python code that blocks free mode usage on any map:
Kod:
[B][COLOR=#9365b8]def onEnter(self):[BR][/BR] if app.IsFreeMode():[BR][/BR] net.SendChatPacket('/freemod', chat.CHAT_TYPE_TALK)[BR][/BR] chat.AppendChat(chat.CHAT_TYPE_INFO, 'Free mode cannot be activated in this map!')[/COLOR][/B]
Explanation:
- app.IsFreeMode(): Checks whether the player is in free mode.
- net.SendChatPacket(): Sends a command to the server to disable free mode.
- chat.AppendChat(): Displays an info message to the player.
Map-Based Control
If you wish to define different rules per map, you can set up a structure that checks the map name. For example, if free mode should only be disabled in the 'Metin2City' map:
Kod:
[B][COLOR=#9365b8]def onEnter(self):[BR][/BR] current_map = chr.GetMapName()[BR][/BR] restricted_maps = ['Metin2City', 'PvPArena'][BR][/BR] if app.IsFreeMode() and current_map in restricted_maps:[BR][/BR] net.SendChatPacket('/freemod', chat.CHAT_TYPE_TALK)[BR][/BR] chat.AppendChat(chat.CHAT_TYPE_INFO, f'Free mode is not allowed in {current_map}!')[/COLOR][/B]
Implementation Steps
1. Add the Python file to your Py Root folder.
2. Ensure triggers like onEnter or onLeave activate the function correctly.
3. Confirm that map names are correctly defined.
4. Test the system to ensure it works properly.
Conclusion
Using Python, you can easily block free mode usage based on maps in Metin2 private servers. This method plays a significant role both in terms of security and gameplay experience. Developers can customize this system for PvP areas, quest maps, or special event zones.
