Solutions
-
BennyDz's post in (Resolvido)converter código em uma função ajuda was marked as the answerlocal 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 function getPlayerProtection(cid, param) for slot, const in pairs(slots) do local hasItemOn = getPlayerSlotItem(cid, const).uid if hasItemOn ~= 0 then itemSlots[slot] = hasItemOn end end for slot, slottedItem in pairs(itemSlots) do local temp = getItemAttribute(slottedItem, param) total = total + (temp ~= nil and temp or 0 ) end return total end resolvido
-
BennyDz's post in (Resolvido)how check isladder? ajuda was marked as the answerblock 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 -
BennyDz's post in (Resolvido)ajuda logout solved was marked as the answeritems 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 -
BennyDz's post in (Resolvido)apoio para a criação de itens no chão was marked as the answerI 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