Arkadaşa Para Gönderme Sistemi[LUA]

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

Admin

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

@ ;

Arkadaşın önerisi üzerine sistemi yararlı buldum ve pek zorlamayacağından dolayı da vakit ayırarak yaptım. Bir çok öneri geliyor değerlendiriyorum hepsini fakat bir çoğu LUA ile yapılamayacak düzeyde. Yapılabilecek olanlar yormayacak ve iş görecek şekildeyse zaten yapıyor, paylaşıyorum. O yüzden lütfen kimse benimkini yapmıyor ya da benim söylediğim sistemlerle ilgilenmiyor gibisinden düşünmesin. Konuya yazılan her yorumu okuyor ve değerlendiriyorum. LYS sınavına 3 aydan kısa bir süre kaldı ve yoğun bir şekilde sınava çalışmaya başladım. Boş vakitlerimde az-çok ilgilenebiliyorum. Bu yüzden de anlayış bekliyorum sizlerden. Şu an bile vaktim olmadığı için sistemi video şeklinde hazırlayamadım. Görselle sistemi tanıtacağım.


Dipçe: Sistemde olabilecek tüm buglar ve sorunlar engellenmiştir. Rahatlıkla kullanabilirsiniz. Oluşabilecek her ayrıntıyı düşündüm merak etmeyin.





Sistemin düzgün çalışması için lütfen aşağıdaki fonksiyonu (İşlevi) oyununuza sorunsuz bir şekilde ekleyin.



Aşağıdaki kodu "questlib.lua" yı açarak en alta ekliyoruz ve daha sonra "questlib.lua" yı kapatıyoruz.


Kod:
function genel_veri(gelen_veri)     miktar2 = tostring(gelen_veri)     local miktar = gelen_veri     local sayac = 10     local basamak = 1     local ilkhal = basamak     while true do         if miktar / sayac >= 1 then             basamak = basamak + 1             sayac = sayac * 10         else             break         end     end     t = {}     sonucText = ""     for i=1, string.len(miktar2) do         t[i]= (string.sub(miktar2,i,i))     end     for k , v in pairs(t) do--1324         if (basamak  == 9 or basamak == 6 or basamak == 3) and sonucText !=  "" then             sonucText = sonucText.."."             sonucText = sonucText..v         else             sonucText = sonucText..v         end         basamak = basamak - 1     end     return sonucText end



Daha sonra "quest_functions" dosyasını açıyoruz ve en alta "genel_veri" fonksiyonunu ekliyoruz. Daha sonra bu dosyayı da kapatıp çıkabilirsiniz. Burada ki işlemler tamamlandıktan sonra oyuna geliyor ve /reload q yazıyoruz.




SİSTEMDEN RESİMLER




Pk111v.jpg


g8rrrL.jpg



ZkXXXA.jpg


o3XXX2.jpg


ljqqqk.jpg


Va999V.jpg



nMQQQg.jpg


v5666R.jpg


1v666D.jpg







Metin2'de Arkadaşa Para Gönderme Sistemi (LUA)

Metin2 sunucularında oyun içi sosyal etkileşimi artırmak için geliştirilen sistemlerden birisi de arkadaşa para gönderme özelliğidir. Bu sistem, oyuncuların kendi aralarında ekonomik olarak destek olmalarını sağlar. Bu yazıda, LUA dili kullanılarak geliştirilen bu sistemin nasıl çalıştığını, nasıl kurulduğunu ve Metin2.quest sistemleriyle nasıl entegre edileceğini detaylıca inceleyeceğiz.

Arkadaşa Para Gönderme Sisteminin Temel Yapısı

Bu sistem, genellikle LUA betikleri üzerinden yönetilir. Oyuncuların birbirlerine oyun içi para (yang) gönderebilmesi için bir menü veya komut sistemi geliştirilir. Bu menüde kullanıcı adı, miktar ve onay gibi temel parametreler yer alır.

Sistem, güvenlik açısından kimlik doğrulama ve günlük limit kontrolleri içerir. Bu sayede hatalı işlem veya dolandırıcılık riski en aza indirilir.

LUA Script Yapısı ve Entegrasyon

Metin2.quest sistemleriyle entegre çalışabilmesi için LUA script'inde özel fonksiyonlar yazılır. Örneğin:

Kod:
[B]function send_money_to_friend(player_name, target_name, amount)[/B][BR][/BR][B]local player = pc.get_player(player_name)[/B][BR][/BR][B]local target = pc.get_player(target_name)[/B][BR][/BR][B]if player.get_yang() >= amount then[/B][BR][/BR][B]player.remove_gold(amount)[/B][BR][/BR][B]target.change_gold(amount)[/B][BR][/BR][B]chat(player_name.. ' adlı oyuncu '.. target_name .. ' adlı oyuncuya '.. amount .. ' yang gönderdi.')[/B][BR][/BR][B]else[/B][BR][/BR][B]syschat('Yeterli yanginiz bulunmamaktadir.')[/B][BR][/BR][B]end[/B][BR][/BR][B]end[/B]


Bu örnekte, gönderen oyuncunun yeterli parası varsa işlem yapılır. Aksi takdirde hata mesajı gönderilir. Ayrıca, quest trigger ile bu işlem belirli bir NPC'den başlatılabilir.

Güvenlik ve Hata Ayıklama

Bu tür sistemlerde quest debug işlemleri önemlidir. Yanlışlıkla para çoğalması gibi hataların önüne geçmek için flag ve state kontrolleri yapılmalıdır. Her işlem sonrası log tutulması da önerilir.

Örnek olarak:

quest send_money begin
when letter with type == 'send_money'
say('Para gönderme menüsüne hoş geldiniz.')
local target_name = input('Alıcı adını girin')
local amount = input('Miktarı girin')
send_money_to_friend(pc.get_name(), target_name, amount)
end

Sistem Avantajları

- Oyuncular arası ekonomik destek
- Sunucu içi sosyal etkileşimin artırılması
- Günlük görev sistemleriyle entegrasyon
- Güvenlik önlemleri ile dolandırıcılığın engellenmesi

Sonuç

Metin2 sunucularında arkadaşa para gönderme sistemi, oyuncu deneyimini zenginleştiren ve ekonomik döngüyü destekleyen önemli bir özelliktir. Doğru şekilde tasarlanıp LUA ile entegre edildiğinde, hem sunucu yöneticileri hem de oyuncular için faydalı bir sistem haline gelir.


Sending Money to Friend System (LUA) in Metin2

Metin2 servers often implement systems to enhance social interaction between players, one of which is the money transfer to friends feature. This system allows players to support each other economically within the game. In this article, we'll examine in detail how this system works, how to set it up, and how it can be integrated with Metin2.quest systems using LUA.

Basic Structure of the Send Money to Friend System

The system is typically managed through LUA scripts. It provides a menu or command system that allows players to send in-game currency (yang) to each other. The interface usually includes fields for recipient name, amount, and confirmation.

For security reasons, the system includes identity verification and daily limits. This minimizes risks such as incorrect transactions or fraud attempts.

LUA Script Structure and Integration

To integrate with Metin2.quest systems, special functions are written in LUA. For example:

Kod:
[B]function send_money_to_friend(player_name, target_name, amount)[/B][BR][/BR][B]local player = pc.get_player(player_name)[/B][BR][/BR][B]local target = pc.get_player(target_name)[/B][BR][/BR][B]if player.get_yang() >= amount then[/B][BR][/BR][B]player.remove_gold(amount)[/B][BR][/BR][B]target.change_gold(amount)[/B][BR][/BR][B]chat(player_name.. ' sent '.. amount .. ' yang to '.. target_name)[/B][BR][/BR][B]else[/B][BR][/BR][B]syschat('You do not have enough yang.')[/B][BR][/BR][B]end[/B][BR][/BR][B]end[/B]


In this example, if the sender has sufficient funds, the transaction proceeds. Otherwise, an error message is shown. Additionally, this process can be triggered by an NPC via a quest trigger.

Security and Debugging

Quest debugging is crucial in such systems. To prevent issues like unintended money duplication, flag and state checks should be implemented. Logging every transaction is also recommended.

For instance:

quest send_money begin
when letter with type == 'send_money'
say('Welcome to the money sending menu.')
local target_name = input('Enter the recipient name')
local amount = input('Enter the amount')
send_money_to_friend(pc.get_name(), target_name, amount)
end

System Advantages

- Economic support between players
- Increased social interaction within the server
- Integration with daily quest systems
- Prevention of fraud through security measures

Conclusion

The money transfer to friends system in Metin2 servers is a valuable feature that enriches the player experience and supports the in-game economy. When properly designed and integrated with LUA, it becomes beneficial for both server administrators and players.
 

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

Benzer konular

Geri
Üst Alt