Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. elseif isInArray({6,7},tipe) then
  2. if tipe == 6 then
  3. bcap = 8
  4. bid = 1987
  5. elseif tipe == 7 then
  6. bcap = 20
  7. bid = 1988
  8. end
  9. if isItemRune(id) then
  10. count = 1
  11. end
  12. if getPlayerFreeCap(cid) >= (getItemWeightById(1987, 1) + getItemWeightById(id,count * bcap)) then
  13. local bag = doCreateItemEx(bid, 1)
  14. for i = 1,bcap do
  15. doAddContainerItem(bag, id, count)
  16. end
  17. --received = doPlayerAddItemEx(getPlayerSlotItem(cid, 3).uid, bag)
  18. received = doPlayerSendMailByName(getCreatureName(cid), bag, getPlayerTown(cid), worldname)
  19. if received == RETURNVALUE_NOERROR then
  20. doItemSetAttribute(received, "description", ''.. productn ..' by ' .. getCreatureName(cid) .. ' [Serial:' .. um .. '' .. dois .. '' .. tres .. '' .. quatro .. '' .. cinco .. '' .. seis .. '].')
  21. doPlayerSendTextMessage(cid,19, "System: ".. getCreatureName(cid) .." recebeu >> "..productn.." << do nosso sistema de loja")
  22. doPlayerSave(cid)
  23. doPlayerSendTextMessage(cid,19, "System: Seu personagem ".. getCreatureName(cid) .." foi salvo para manter nosso sistema e voce seguro!")
  24. db.executeQuery("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";")
  25. f = io.open("data/logs/Shop.txt", "a+")
  26. f:write("Player : '".. productn .." by ".. getCreatureName(cid) .." [Serial: ".. um .."".. dois .."".. tres .."".. quatro .."".. cinco .."".. seis .."] Item : "..productn.." - "..getCreatureName(cid).."- " .. os.date("%d %B %Y - %X.", os.time ()) .."\n---------------------------------------------------------\n")
  27. f:close()
  28. else
  29. doPlayerSendTextMessage(cid,19, "System: Desculpe, ".. getCreatureName(cid) .." voce não tem espaço suficiente para receber o item >> "..productn.." <<")
  30. end
  31. else
  32. doPlayerSendTextMessage(cid,19, "System: Desculpe, ".. getCreatureName(cid) .." voce não tem capacidade suficiente para receber o item >> "..productn.." << (voce precisa: "..getItemWeightById(id, count).." Capacidade)")
  33. end
  34. end
  35. end
  36. itemr:free()
  37. if not(result:next()) then
  38. break
  39. end
  40. end
  41. result:free()
  42. end
  43. return true
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement