Ir para conteúdo

BennyDz

Membro
  • Registro em

  • Última visita

Tudo que BennyDz postou

  1. HI Este código funciona perfeitamente retornado bons valores. mas .... Só tenho esse erro no console: Este erro acontece quando o personagem não tem nenhum artigo na respectiva ranhura. Aqui, o código: local slots = { ['head'] = CONST_SLOT_HEAD, ['armor'] = CONST_SLOT_ARMOR, ['legs'] = CONST_SLOT_LEGS, ['feet'] = CONST_SLOT_FEET, ['left'] = CONST_SLOT_LEFT, ['right'] = CONST_SLOT_RIGHT } local itemSlots, total = {}, 0 for slot, const in pairs(slots) do local hasItemOn = getPlayerSlotItem(cid, const).uid if hasItemOn then itemSlots[slot] = hasItemOn end end for slot, slottedItem in pairs(itemSlots) do local temp = getItemAttribute(slottedItem, 'IceProtec') total = total + (temp ~= nil and temp or 0 ) end // doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ice: "..total..".") E eu tento criar esta função, mas só me retorna o valor de um slot: function getPlayerProtection(cid, attribute) local slots = { ['head'] = CONST_SLOT_HEAD, ['armor'] = CONST_SLOT_ARMOR, ['legs'] = CONST_SLOT_LEGS, ['feet'] = CONST_SLOT_FEET, ['left'] = CONST_SLOT_LEFT, ['right'] = CONST_SLOT_RIGHT } local itemSlots, total = {}, 0 for slot, const in pairs(slots) do local hasItemOn = getPlayerSlotItem(cid, const).uid if hasItemOn then itemSlots[slot] = hasItemOn end end for slot, slottedItem in pairs(itemSlots) do local temp = getItemAttribute(slottedItem, attribute) return total + (temp ~= nil and temp or 0 ) end end para uso: getPlayerProtection(cid, 'IceProtec') e mesmo erro no valor de nulo em consola
  2. BennyDz postou uma resposta no tópico em Códigos C++
    adapten para tfs 0.4
  3. obrigado. no olvide crear carpeta "players" em logs para que funcione.
  4. funciona em tfs 0.4? for 8.6
  5. resolvi asim: function onDeath(cid, corpse, deathList) local strings = {""} local t, position = 1, 1 local deathType = "killed" local toSlain, toCrushed = 3, 9 if #deathList >= toSlain and #deathList < toCrushed then deathType = "slain" elseif #deathList >= toCrushed then deathType = "crushed" end for _, pid in ipairs(deathList) do if isCreature(pid) == true then strings[position] = t == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .. getCreatureName(pid) .. "" t = t + 1 else strings[position] = t == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .."a field item" t = t + 1 end end for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end msg = getCreatureName(cid) .. " was " .. deathType .. " at level " .. getPlayerLevel(cid) .. " by " .. str end doBroadcastMessage(msg, MESSAGE_STATUS_WARNING) return true end
  6. function onDeath(cid, corpse, deathList) for _, pid in ipairs(deathList) do doBroadcastMessage(""..getCreatureName(cid).." killed at level ["..getPlayerLevel(cid).."] by "..getCreatureName(pid).. " ", MESSAGE_STATUS_WARNING) end return true end temgo este error: seu repite mensaje do morte. busco solo um mensaje con el nombre de todos los que lo mataron.
  7. Eu tenho TFS 0.4 em versao 8.6 Eu quero mudá-lo para 8,7.
  8. tente copiar a pasta "game_shop" do pokemon cliente, mas não funciona. Eu entendo que ele funciona através da botões execução "Talkactions" mais como imagens são adicionados ao lado das botões? Eu olho por exemplo loja em quente:
  9. BennyDz postou uma resposta no tópico em Suporte OTServer Derivados
    oi galera Eu tenho uma dúvida. em modules/client_entergame/characterlist.lua -- account if account.premDays > 0 and account.premDays < 65535 then accountStatusLabel:setText(tr("Premium Account (%s) days left", account.premDays)) elseif account.premDays >= 65535 then accountStatusLabel:setText(tr("Lifetime Premium Account")) else accountStatusLabel:setText(tr('Free Account')) end if account.premDays > 0 and account.premDays <= 7 then accountStatusLabel:setOn(true) else accountStatusLabel:setOn(false) end end como obter um resultado da tabela de contas "vip_time" para mudar de modo: -- account if vip_time >= os.time() then accountStatusLabel:setText(tr("Vip Account (%s) days left", account.vip_time)) else accountStatusLabel:setText(tr('Free Account')) end
  10. voce no va postear?
  11. Agora você sabe xD! lembranças
  12. block all tiles xD!. i try buy no work now. function getItemIsLadder(itemId) local file = io.open("data/items/items.xml", "r") for info in string.gmatch(file:read("*a"), "<items(.-)</items>") do if info:match("item id=\"(.-)\"") == itemId then local attribute key = info:match("attribute key=(.-)") return tostring(attribute key) end end file:close() return nil end solved: local function getItemIsLadder(itemId) local floor = getItemInfo(itemId).floorChange for i = 1, #floor do if floor[i] then return true end end return false end
  13. yes is valid on items.xml <item id="1385" name="stairs"> <attribute key="floorchange" value="north" /> </item> all ladders. bump
  14. yes is correct itemEx.uid because use action: function onUse(cid, item, fromPosition, itemEx, toPosition) and floorchange is null. :/ want check this: <attribute key="floorchange" /> no way to read from items.xml ?
  15. i want: if getItemAttribute(itemEx.uid,'floorchange') == "north" then doSendMagicEffect(toPosition,2) doPlayerSendCancel(cid, "Sorry, not possible.") return true end or if getItemAttribute(itemEx.uid,'floorchange') == true then doSendMagicEffect(toPosition,2) doPlayerSendCancel(cid, "Sorry, not possible.") return true end but dont work :/ no error on console
  16. items are created on the ground with an action. and I seek That They can not logear on Tiles enchanted solved: --[[ by God Remady]]-- function onLogout(cid) local item = getTileItemById({x = getPlayerPosition(cid).x, y = getPlayerPosition(cid).y, z = getPlayerPosition(cid).z, stackpos = 255}, 9565) if item.itemid == 9565 then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUCANNOTLOGOUTHERE) return false end return true end
  17. not working. without error but I can do logout on item 9565
  18. not found no error in the console. I think you must be wrong comparison.I not how to do things right ;/
  19. i try: function onLogout(cid) if getTileItemById({x = getPlayerPosition(cid).x, y = getPlayerPosition(cid).y, z = getPlayerPosition(cid).z}, 9565) == true then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUCANNOTLOGOUTHERE) return false end return true end why dont work? :/
  20. hi my problem is: opening log .... infiniteeeeeeeeeee and crash console. exe with other data funcion perfectly. why? solved: error on folder lib.
  21. hope they serve, could get a formula to get a value from the guild. Espero que você aprende , você pode obter uma fórmula para obter um valor da Aliança
  22. I publish the function is resolved my problem, friend but give you an example: I'm looking for it: isWalkable on toPosition. example is solved on actions: function isWalkable(pos) pos.stackpos = 0 local tile = getThingfromPos(pos, false) if tile ~= 0 and not hasProperty(tile.uid, CONST_PROP_BLOCKSOLID) and not isCreature(getTopCreature(pos).uid) then return true end end function onUse(cid, item, fromPosition, itemEx, toPosition) if isWalkable(toPosition) == true then doSendMagicEffect(toPosition, 54) doCreateItem(9565, 1, toPosition) else doPlayerSendCancel(cid, "Sorry, not possible.") end return true end

Informação Importante

Confirmação de Termo