Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elseif isInArray({6,7},tipe) then
- if tipe == 6 then
- bcap = 8
- bid = 1987
- elseif tipe == 7 then
- bcap = 20
- bid = 1988
- end
- if isItemRune(id) then
- count = 1
- end
- if getPlayerFreeCap(cid) >= (getItemWeightById(1987, 1) + getItemWeightById(id,count * bcap)) then
- local bag = doCreateItemEx(bid, 1)
- for i = 1,bcap do
- doAddContainerItem(bag, id, count)
- end
- --received = doPlayerAddItemEx(getPlayerSlotItem(cid, 3).uid, bag)
- received = doPlayerSendMailByName(getCreatureName(cid), bag, getPlayerTown(cid), worldname)
- if received == RETURNVALUE_NOERROR then
- doItemSetAttribute(received, "description", ''.. productn ..' by ' .. getCreatureName(cid) .. ' [Serial:' .. um .. '' .. dois .. '' .. tres .. '' .. quatro .. '' .. cinco .. '' .. seis .. '].')
- doPlayerSendTextMessage(cid,19, "System: ".. getCreatureName(cid) .." recebeu >> "..productn.." << do nosso sistema de loja")
- doPlayerSave(cid)
- doPlayerSendTextMessage(cid,19, "System: Seu personagem ".. getCreatureName(cid) .." foi salvo para manter nosso sistema e voce seguro!")
- db.executeQuery("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";")
- f = io.open("data/logs/Shop.txt", "a+")
- 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")
- f:close()
- else
- doPlayerSendTextMessage(cid,19, "System: Desculpe, ".. getCreatureName(cid) .." voce não tem espaço suficiente para receber o item >> "..productn.." <<")
- end
- else
- doPlayerSendTextMessage(cid,19, "System: Desculpe, ".. getCreatureName(cid) .." voce não tem capacidade suficiente para receber o item >> "..productn.." << (voce precisa: "..getItemWeightById(id, count).." Capacidade)")
- end
- end
- end
- itemr:free()
- if not(result:next()) then
- break
- end
- end
- result:free()
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement