İstek / tüm oyunculara itemini satmak için PM Atması Sistemi

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 69

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
uiscript/pazar_panel.py:

Kod:
import ui import net import chat class PazarPanel(ui.Board):     def __init__(self):         ui.Board.__init__(self)         self.SetSize(250, 130)         self.SetCenterPosition()         self.AddFlag("movable")         self.AddFlag("float")         self.SetTitleName("Pazar Duyurusu")         self.itemSlot = ui.EditLine()         self.itemSlot.SetParent(self)         self.itemSlot.SetPosition(20, 40)         self.itemSlot.SetSize(100, 18)         self.itemSlot.SetMax(2)         self.itemSlot.SetText("1")         self.itemSlot.Show()         self.fiyatLine = ui.EditLine()         self.fiyatLine.SetParent(self)         self.fiyatLine.SetPosition(20, 70)         self.fiyatLine.SetSize(150, 18)         self.fiyatLine.SetMax(25)         self.fiyatLine.SetText("")         self.fiyatLine.Show()         self.gonderButon = ui.Button()         self.gonderButon.SetParent(self)         self.gonderButon.SetPosition(20, 100)         self.gonderButon.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")         self.gonderButon.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")         self.gonderButon.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")         self.gonderButon.SetText("Gönder")         self.gonderButon.SetEvent(self.Gonder)         self.gonderButon.Show()         self.Show()     def Gonder(self):         slot = self.itemSlot.GetText()         fiyat = self.fiyatLine.GetText()         if not slot.isdigit():             chat.AppendChat(1, "Slot numarası geçersiz.")             return         packet = "/pazarsend " + slot + "||" + fiyat         net.SendChatPacket(packet)         chat.AppendChat(1, "Satış mesajı gönderildi.")         self.Hide()

game.py (veya interfaceModule.py):

Kod:
import pazar_panel def __ProcessChatCommand(self, command):     if command == "/pazar":         self.pazarPanel = pazar_panel.PazarPanel()     else:         return 0     return 1



quest/pazar_satis.quest (veya game/src üzerinden c++ tarafına hook'lu

Kod:
quest pazar_satis begin     state start begin         when login begin             pc.setqf("son_pazar_zamani", 0)         end         when chat command "/pazarsend" with pc.is_gm() or true begin             local input = string.sub(input(cmd), 1)             local parts = string.split(input, "||")             local slot = tonumber(parts[1])             local fiyat = parts[2]             if not slot or slot < 0 or slot > 44 then                 syschat("Geçersiz slot.")                 return             end             local itemVnum = pc.get_item_vnum(slot)             if itemVnum == 0 then                 syschat("Bu slotta item yok.")                 return             end             local itemName = item_name(itemVnum)             local plus = item.get_level(slot)             local oyuncu = pc.get_name()             local mesaj = "[PAZAR] " .. oyuncu .. ": +" .. plus .. " " .. itemName             if fiyat != "" then                 mesaj = mesaj .. " " .. fiyat             end             notice_all(mesaj)             syschat("Satış mesajı gönderildi.")         end     end end




-----------------------------------------

Oyuncu, özel bir itemi (örn. "Pazar Duyuru Kağıdı") çift tıklayınca sistem aktif olur.


QUEST


Kod:
quest pazar_duyuru begin     state start begin         when 70050.use begin -- 70050 örnek item vnum             -- İsteğe bağlı cooldown             -- if get_time() - pc.getqf("pazar_zamani") < 60 then             --     syschat("Bu eşyayı tekrar kullanabilmek için beklemelisin.")             --     return             -- end             cmdchat("OPEN_PAZAR_PANEL") -- Client tarafında paneli açtır             pc.remove_item(70050, 1) -- Kullanımda 1 adet silinsin             syschat("Pazar duyuru paneli açıldı.")         end     end end



game.py içine (veya interfaceModule.py):

Kod:
import pazar_panel def BINARY_CMD_OpenPazarPanel():     try:         self.pazarPanel = pazar_panel.PazarPanel()     except:         import dbg         dbg.TraceError("Pazar paneli açılamadı.") # Bu satırı game.py içine ekle (Register partına): net.RegisterChatHandler("OPEN_PAZAR_PANEL", BINARY_CMD_OpenPazarPanel)


---------------------------------

+ olarak sınırlı sayıda mesaj yollansın istiyorsanız.

quest
lua
Kod:
quest pazar_duyuru begin     state start begin         when 70050.use begin             local max_kullanim = 3 -- Maksimum kullanım sayısı             local vnum = 70050             if not pc.getqf("pazar_"..vnum) then                 pc.setqf("pazar_"..vnum, 0)             end             local kullanim = pc.getqf("pazar_"..vnum)             if kullanim >= max_kullanim then                 pc.remove_item(vnum, 1)                 pc.setqf("pazar_"..vnum, 0)                 syschat("Bu eşyanın kullanım hakkı bitti ve silindi.")                 return             end             -- Panel aç             cmdchat("OPEN_PAZAR_PANEL")             -- Kullanımı artır             pc.setqf("pazar_"..vnum, kullanim + 1)             local kalan = max_kullanim - (kullanim + 1)             if kalan > 0 then                 syschat("Bu eşyayı "..kalan.." kez daha kullanabilirsin.")             else                 pc.remove_item(vnum, 1)                 pc.setqf("pazar_"..vnum, 0)                 syschat("Bu eşyanın kullanım hakkı bitti ve silindi.")             end         end     end end

lua dosyanın içine yazdır
Kod:
if command == "/pazarsend" then end

Metin2 Oyuncularına Özel İstek / Tüccarlık Sistemi: Tüm Oyunculara Item Satışı İçin PM Gönderme

Giriş
Metin2 özel sunucularında geliştirilen sistemlerden biri olan İstek / Tüccarlık Sistemi, oyuncuların istedikleri eşyaları doğrudan diğer oyunculara satmak veya satın almak için kullanılır. Bu sistem, sunucu içindeki ekonomiyi canlandırırken aynı zamanda oyuncu etkileşimini de artırır. Bu yazıda, tüm oyunculara özel bir mesaj (PM) göndererek item satışı yapma sistemini ele alacağız.

Sistem Nedir?
Bu sistem, bir oyuncunun belirli bir eşyayı satmak istediğinde, tüm oyunculara otomatik olarak özel mesaj (PM) gönderilmesini sağlar. Mesaj içeriğinde eşyanın adı, fiyatı ve satan kişi hakkında bilgi yer alır. Böylece eşya daha hızlı bir şekilde satışa sunulabilir ve talep karşılanabilir.

Nasıl Çalışır?
Sistem, C++ tabanlı bir sunucu modifikasyonuyla entegre edilir. Oyuncu bir eşyayı 'satışa çıkar' dediğinde, sunucu bu eşya bilgisini alır ve tüm aktif oyunculara özel mesaj olarak iletir. Bu mesajlar genellikle Market veya Tüccar gibi başlıklarla gönderilir. Kullanıcılar, gelen mesajdan eşya bilgisini alıp ilgili kullanıcıya ulaşabilir.

Avantajları Nelerdir?
  • Oyuncular arasında hızlı ve etkili alışveriş sağlar.
  • Sunucu içi ekonomiyi dengeler.
  • Oyuncu sayısının artmasını teşvik eder.
  • Sistemsel olarak kolay takip yapılabilir.

Python Entegrasyonu ve GUI Kullanımı
Bazı sunucular, bu sistemi daha kullanıcı dostu hale getirmek için Python tabanlı arayüzler kullanabilir. Bu arayüzler, eşya fiyatlarını güncellemek, mesaj içeriklerini özelleştirmek veya log tutmak için kullanılabilir. PyQt veya Tkinter gibi kütüphanelerle geliştirilen GUI'ler, sistem yöneticilerinin kolayca müdahale etmesini sağlar.

Uygulama Örnekleri
Örneğin, bir oyuncu Dragon Sword adlı eşyayı 100.000 Yang fiyatla satmak istediğini belirttiğinde, sistem otomatik olarak şu mesajı gönderir:
Yeni bir eşya satışa çıkmış! Eşya: Dragon Sword | Fiyat: 100.000 Yang | Satıcı: PlayerName

Sonuç
Metin2 özel sunucularında tüm oyunculara otomatik PM gönderme sistemi, hem oyun içi ekonomiyi destekler hem de oyuncu etkileşimini artırır. C++ tabanlı geliştirilmiş bu sistem, Python GUI ile birlikte kullanıldığında yönetim kolaylığı sağlar. Bu tür sistemler, Metin2'nin gelişmiş sunucu geliştirme alanlarında önemli bir yere sahiptir.


Metin2 Player Exclusive Request / Trading System: Sending PMs to All Players for Item Sales

Introduction
The Request / Trading System, one of the developed systems for Metin2 private servers, allows players to directly sell or buy desired items from other players. This system not only revitalizes the economy within the server but also increases player interaction. In this article, we will examine the system that sends private messages (PMs) to all players for item sales.

What is the System?
This system enables the automatic sending of private messages (PMs) to all players when a player wishes to sell a specific item. The message includes information about the item's name, price, and the seller. This way, the item can be quickly put up for sale and demand can be met.

How Does It Work?
The system integrates with a C++ based server modification. When a player clicks to 'list an item for sale', the server receives the item information and forwards it as a private message to all active players. These messages are usually sent under titles such as Market or Trader. Users can take the item information from the received message and contact the relevant user.

What Are Its Advantages?
  • Facilitates fast and efficient trading among players.
  • Balances the in-game economy.
  • Encourages increased player numbers.
  • Allows systematic tracking.

Python Integration and GUI Usage
Some servers may use Python-based interfaces to make this system more user-friendly. These interfaces can be used to update item prices, customize message content, or maintain logs. GUIs developed using libraries like PyQt or Tkinter allow system administrators to easily intervene.

Application Examples
For instance, if a player specifies they want to sell the Dragon Sword item for 100,000 Yang, the system automatically sends the following message:
A new item has been listed for sale! Item: Dragon Sword | Price: 100,000 Yang | Seller: PlayerName

Conclusion
Sending automated PMs to all players on Metin2 private servers supports the in-game economy and enhances player interaction. This C++ based system provides management ease when combined with a Python GUI. Such systems hold significant importance in advanced Metin2 server development areas.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt