Postado Março 20, 2014 11 anos [Error - CreatureScript Interface] In a timer event called from: data/creaturescripts/scripts/autoloot.lua:onKill Description: data/lib/autoloot_lib.lua:8: attempt to perform arithmetic on a boolean value stack traceback: data/lib/autoloot_lib.lua:8: in function 'findItemsInContainer' data/lib/autoloot_lib.lua:31: in function <data/lib/autoloot_lib.lua:27> Script: Citar AUTO_LOOT_TAX = 10 -- Tax for using the service (in %) (min 0, max 100) AUTO_LOOT_BANK = true -- Will the money go to the bank? If false, the money will go to the player AUTO_LOOT_STORAGE = 38199 -- Storage of the status of the Auto Loot function findItemsInContainer(ids, container) local items_found = {} local v_uids = {} for i = 0, getContainerSize(container)-1 do container_item = getContainerItem(container, i) if isContainer(container_item.uid) then local container_recursive = findItemsInContainer(ids, container_item.uid) for a, b in ipairs(container_recursive) do if not isInArray(v_uids, b.uid) then table.insert(v_uids, container_item.uid) table.insert(items_found, b) end end end if isInArray(ids, container_item.itemid) and not isInArray(v_uids, container_item.uid) then table.insert(v_uids, container_item.uid) table.insert(items_found, container_item) end end return items_found end function executeAutoLoot(cid, pos, target_name) AUTO_LOOT_TAX = AUTO_LOOT_TAX > 100 and 100 or AUTO_LOOT_TAX < 0 and 0 or AUTO_LOOT_TAX local corpse = getTileItemByType(pos, ITEM_TYPE_CONTAINER).uid local total_count = 0 for a, b in ipairs(findItemsInContainer({ITEM_GOLD_COIN, ITEM_PLATINUM_COIN, ITEM_CRYSTAL_COIN}, corpse)) do if b.itemid == ITEM_CRYSTAL_COIN then total_count = total_count+b.type*10000 elseif b.itemid == ITEM_PLATINUM_COIN then total_count = total_count+b.type*100 elseif b.itemid == ITEM_GOLD_COIN then total_count = total_count+b.type end doRemoveItem(b.uid, b.type) end if AUTO_LOOT_BANK then doPlayerSetBalance(cid, getPlayerBalance(cid)+math.ceil(total_count*(1-AUTO_LOOT_TAX/100))) else doPlayerAddMoney(cid, math.ceil(total_count*(1-AUTO_LOOT_TAX/100))) end if total_count > 0 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "{Autoloot System} Dinheiro coletado de "..target_name..": "..total_count.." gold coins."..(AUTO_LOOT_TAX > 0 and " imposto de ("..AUTO_LOOT_TAX.."%) discontado: "..math.floor(total_count*(AUTO_LOOT_TAX/100)).." gold coins." or " No tax.")) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "{Autoloot System} Total Coletado: "..math.ceil(total_count*(1-AUTO_LOOT_TAX/100)).." gold coins.") else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "{Autoloot System} Nenhum dinheiro coletado de "..target_name..".") end return true end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.