Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. quest charge_cash_by_voucher begin
  2. state start begin
  3. function charge(amount, charge_type)
  4. if charge_type == nil then
  5. charge_type = "cash"
  6. end
  7.  
  8. if 0 < amount then
  9. local result = pc.charge_cash(amount, charge_type)
  10.  
  11. if true == result then
  12. local item_id = item.get_id()
  13. char_log(item_id, "CHARGE_CASH_BY_VOUCHER", amount)
  14. chat(string.format("|cffffc700|h[Doładowanie SM]:|h|r Pomyślnie przypisano do Twojego konta %d SM.", amount))
  15.  
  16. local flag_name = "total_" .. charge_type
  17. pc.setqf(flag_name, pc.getqf(flag_name) + amount)
  18.  
  19. item.remove()
  20. end
  21. end
  22.  
  23. return false
  24. end
  25.  
  26. when 80014.use or 80015.use or 80016.use or 80017.use begin
  27. if not pc.can_warp() then
  28. syschat("Nie możesz teraz tego użyć.")
  29. return
  30. end
  31.  
  32. local amount = item.get_value(0)
  33.  
  34. charge_cash_by_voucher.charge(amount, "cash")
  35. end
  36. end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement