Çözüldü EP Kuponu silinememe sorunu

  • Konuyu açan Konuyu açan vedat1089
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 3
  • Gösterim Gösterim 529
Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

vedat1089

Üye
Üye
Mesaj
67
Çözümler
2
Beğeni
16
Puan
664
Ticaret Puanı
0
Çok basit bir sorun ile karşı karşıyayım yardımcı olursanız sevirim Ep kuponunu kullandıktan sonra silinmiyor bunu nasıl değiştirebilirim?



Lua (Quest):
Genişlet Daralt Kopyala
quest charge_cash_by_voucher begin
    state start begin
        function charge(amount, charge_type)
            if (charge_type == nil) then
                charge_type = "coins"
            end -- if
          
            if (amount > 0) then
                -- syntax : pc.charge_cash(amount, charge_type)
                -- warning: 1. 'charge_type' : "coins"(default) | "mileage"
                -- 2. 'amount' must be positive number
              
                local result = pc.charge_coins(amount, charge_type)
                if (result == true) then
                    local item_id = item.get_id()
                    local flag_name = "total_"..charge_type
                    pc.setqf(flag_name, pc.getqf(flag_name) + amount)
                    item.remove()
                end -- if
            end
            return false
        end -- function
      
        when 80014.use or 80015.use or 80016.use or 80017.use or 80018.use or 80019.use or 80020.use
             or 80021.use or 80022.use or 80023.use or 80024.use or 80025.use or 80027.use begin
            local amount = item.get_value(0)
            --charge_cash_by_voucher.charge(amount, "coins") -- Cash
            pc.set_coins(amount) -- Coins
            syschat(string.format("Hesabınıza %s EP yatırılmıştır. ", amount))
        end
  
    end -- state
end -- quest

@Whistle :))
 
Çözüm
Lua (Quest):
Genişlet Daralt Kopyala
quest charge_cash_by_voucher begin
    state start begin
        function charge(amount, charge_type)
            if (charge_type == nil) then
                charge_type = "coins"
            end -- if
       
            if (amount > 0) then
                -- syntax : pc.charge_cash(amount, charge_type)
                -- warning: 1. 'charge_type' : "coins"(default) | "mileage"
                -- 2. 'amount' must be positive number
           
                local result = pc.charge_coins(amount, charge_type)
                if (result == true) then
                    local item_id = item.get_id()
                    local flag_name = "total_"..charge_type
                    pc.setqf(flag_name, pc.getqf(flag_name) + amount)...
pc.remove_item() komutunun kullanılması gerekiyor
Quest Yazma Dersleri bu konuyu inceleyerek bilgi edinebilirsiniz
 
Lua (Quest):
Genişlet Daralt Kopyala
quest charge_cash_by_voucher begin
    state start begin
        function charge(amount, charge_type)
            if (charge_type == nil) then
                charge_type = "coins"
            end -- if
       
            if (amount > 0) then
                -- syntax : pc.charge_cash(amount, charge_type)
                -- warning: 1. 'charge_type' : "coins"(default) | "mileage"
                -- 2. 'amount' must be positive number
           
                local result = pc.charge_coins(amount, charge_type)
                if (result == true) then
                    local item_id = item.get_id()
                    local flag_name = "total_"..charge_type
                    pc.setqf(flag_name, pc.getqf(flag_name) + amount)
                    pc.removeitem(80014, 1)
                end -- if
            end
            return false
        end -- function
   
        when 80014.use or 80015.use or 80016.use or 80017.use or 80018.use or 80019.use or 80020.use
             or 80021.use or 80022.use or 80023.use or 80024.use or 80025.use or 80027.use begin
            local amount = item.get_value(0)
            --charge_cash_by_voucher.charge(amount, "coins") -- Cash
            pc.set_coins(amount) -- Coins
            syschat(string.format("Hesabınıza %s EP yatırılmıştır. ", amount))
        end
    end -- state
end -- quest


bu şekilde deneyince 80014 kodlu ep kuponu kullanılınca silinecektir, örnek alarak diğer kuponlara da yapabilirsiniz.
 
Çözüm
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst