Ir para conteúdo

BennyDz

Membro
  • Registro em

  • Última visita

  1. amora murder reagiu a uma resposta no tópico: Feyrist  includes monsters.xml
  2. KotZletY reagiu a uma resposta no tópico: Feyrist  includes monsters.xml
  3. BennyDz postou uma resposta no tópico em Mapas de Tibia
    Need import map
  4. BennyDz postou uma resposta no tópico em Ferramentas OpenTibia
    reupload
  5. BennyDz postou uma resposta no tópico em Mapas de Tibia
    precisam desses items.otb items.zip
  6. i try this: function getAllItemsById(self, id) local containers = {} local items = {} for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do local item = self:getSlotItem(i) if item then if item:isContainer() then table.insert(containers, item:getUniqueId()) elseif not id or id == item:getId() then table.insert(items, item:getUniqueId()) end end end while #containers > 0 do for k = (Container(containers[1]):getSize() - 1), 0, -1 do local tmp = Container(containers[1]):getItem(k) if tmp:isContainer() then table.insert(containers, tmp:getUniqueId()) elseif not id or id == tmp:getId() then table.insert(items, tmp:getUniqueId()) end end table.remove(containers, 1) end return items end function onSay(player, words, param) for _, item in pairs(getAllItemsById(player, 12571)) do player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_ORANGE, 'I got an item with id ' .. item.itemid .. '.') end end
  7. do you think you can help me convert this function to tfs 1.2? function getAllItemsById(cid, id) local containers = {} local items = {} for i = CONST_SLOT_FIRST, CONST_SLOT_LAST do local sitem = getPlayerSlotItem(cid, i) if sitem.uid > 0 then if isContainer(sitem.uid) then table.insert(containers, sitem.uid) elseif not(id) or id == sitem.itemid then table.insert(items, sitem) end end end while #containers > 0 do for k = (getContainerSize(containers[1]) - 1), 0, -1 do local tmp = getContainerItem(containers[1], k) if isContainer(tmp.uid) then table.insert(containers, tmp.uid) elseif not(id) or id == tmp.itemid then table.insert(items, tmp) end end table.remove(containers, 1) end return items end It will return an array with the items. Example: Code (Text): for _, item in pairs(getAllItemsById(cid, 2222)) do doPlayerSay(cid, "I got an item with id " .. item.itemid .. ".") end
  8. Are you going to use this script? onLogin? I think if this is it, the player will be offline on verification. R= I had thought to use it in a globalevent. I think the best option would be to use it in OnStartUp, and create another onlogin script, that verifies items on players online, with addEvent (checkitems, 2000) to check the slots and the items inside the backpack
  9. Can not load script: lua:9 ')' expected near 'timerOnExp' try to execute the following command directly in the database with the online player: DELETE FROM `player_items` WHERE `player_id`=196 AND `sid` = 107 and it is not eliminated. I think the same thing happens as when you try to change a player's value, if it is online there is no effect. Can you think of an idea?
  10. now dont have error in console but dont delete items He should have eliminated those 3 items, but they are not deleted
  11. same result only delete for players not connected
  12. only delete if the player is not connected
  13. JZDJ reagiu a uma resposta no tópico: Feyrist  includes monsters.xml

Informação Importante

Confirmação de Termo