Botão? como assim? botão onde?
passa o erro para eu arrumar
Botão? como assim? botão onde?
passa o erro para eu arrumar
info
Grupo: Artesão
Registrado: 25/07/18
Posts: 112
Reputação: +8
Gênero: Outro

1 minuto atrás, ZikaLord disse:Botão? como assim? botão onde?
passa o erro para eu arrumar
"Embrulhar"
Eu queria que o tapete fosse estendido no chão direto da bag ou do proprio chão , o erro acontece quando tento estender ele direto da bag , dai ele some e causa um errinho.
Se poder fazer isso agradeço, ou apenas corrigir esse erro
erro
Citar
[19/06/2019 16:41:55] [Error - Action Interface]
[19/06/2019 16:41:55] datapack/actions/scripts/tapetes/tapete.lua:onUse
[19/06/2019 16:41:55] Description:
[19/06/2019 16:41:55] datapack/lib/050-function.lua:199: attempt to index a boolean value
[19/06/2019 16:41:55] stack traceback:
[19/06/2019 16:41:55] datapack/lib/050-function.lua:199: in function 'getHouseOwner'
[19/06/2019 16:41:55] datapack/actions/scripts/tapetes/tapete.lua:12: in function <datapack/actions/scripts/tapetes/tapete.lua:7>
[19/06/2019 16:42:51] Tsuu has logged out.[19/06/2019 16:43:10] [Error - Action Interface]
[19/06/2019 16:43:10] datapack/actions/scripts/tapetes/tapete.lua:onUse
[19/06/2019 16:43:11] Description:
[19/06/2019 16:43:11] (luaDoDecayItem) Item not found
O ultimo erro acontece quando tento estender ele no chao direto da bag o 1° erro e quando tento usar ele em um piso qualquer (Pisos que não são de Houses)
9 minutos atrás, vinicius231 disse:"Embrulhar"
Eu queria que o tapete fosse estendido no chão direto da bag ou do proprio chão , o erro acontece quando tento estender ele direto da bag , dai ele some e causa um errinho.
Se poder fazer isso agradeço, ou apenas corrigir esse erro![]()
erroO ultimo erro acontece quando tento estender ele no chao direto da bag o 1° erro e quando tento usar ele em um piso qualquer (Pisos que não são de Houses)
me passa sua 050-function.lua
info
Grupo: Artesão
Registrado: 25/07/18
Posts: 112
Reputação: +8
Gênero: Outro

2 minutos atrás, ZikaLord disse:me passa sua 050-function.lua
Citarfunction doPlayerGiveItem(cid, itemid, amount, subType)
local item = 0
if(isItemStackable(itemid)) then
item = doCreateItemEx(itemid, amount)
if(doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR) then
return false
end
else
for i = 1, amount do
item = doCreateItemEx(itemid, subType)
if(doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR) then
return false
end
end
endreturn true
endfunction doPlayerGiveItemContainer(cid, containerid, itemid, amount, subType)
for i = 1, amount do
local container = doCreateItemEx(containerid, 1)
for x = 1, getContainerCapById(containerid) do
doAddContainerItem(container, itemid, subType)
endif(doPlayerAddItemEx(cid, container, true) ~= RETURNVALUE_NOERROR) then
return false
end
endreturn true
endfunction doPlayerTakeItem(cid, itemid, amount)
return getPlayerItemCount(cid, itemid) >= amount and doPlayerRemoveItem(cid, itemid, amount)
endfunction doPlayerBuyItem(cid, itemid, count, cost, charges)
return doPlayerRemoveMoney(cid, cost) and doPlayerGiveItem(cid, itemid, count, charges)
endfunction doPlayerBuyItemContainer(cid, containerid, itemid, count, cost, charges)
return doPlayerRemoveMoney(cid, cost) and doPlayerGiveItemContainer(cid, containerid, itemid, count, charges)
endfunction doPlayerSellItem(cid, itemid, count, cost)
if(not doPlayerTakeItem(cid, itemid, count)) then
return false
endif(not doPlayerAddMoney(cid, cost)) then
error('[doPlayerSellItem] Could not add money to: ' .. getPlayerName(cid) .. ' (' .. cost .. 'gp).')
endreturn true
endfunction doPlayerWithdrawMoney(cid, amount)
if(not getBooleanFromString(getConfigInfo('bankSystem'))) then
return false
endlocal balance = getPlayerBalance(cid)
if(amount > balance or not doPlayerAddMoney(cid, amount)) then
return false
enddoPlayerSetBalance(cid, balance - amount)
return true
endfunction doPlayerDepositMoney(cid, amount)
if(not getBooleanFromString(getConfigInfo('bankSystem'))) then
return false
endif(not doPlayerRemoveMoney(cid, amount)) then
return false
enddoPlayerSetBalance(cid, getPlayerBalance(cid) + amount)
return true
endfunction isPremium(cid)
return (isPlayer(cid) and (getPlayerPremiumDays(cid) > 0 or getBooleanFromString(getConfigInfo('freePremium'))))
endfunction getMonthDayEnding(day)
if(day == "01" or day == "21" or day == "31") then
return "st"
elseif(day == "02" or day == "22") then
return "nd"
elseif(day == "03" or day == "23") then
return "rd"
endreturn "th"
endfunction getMonthString(m)
return os.date("%B", os.time{year = 1970, month = m, day = 1})
endfunction getArticle(str)
if str:find("[AaEeIiOoUuYy]") then
return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a"
else
print("Error trying to use Look.lua in a pokeball!!")
return "a"
end
endfunction isNumber(str)
return tonumber(str) ~= nil
endfunction doPlayerAddAddons(cid, addon)
for i = 0, table.maxn(maleOutfits) do
doPlayerAddOutfit(cid, maleOutfits, addon)
endfor i = 0, table.maxn(femaleOutfits) do
doPlayerAddOutfit(cid, femaleOutfits, addon)
end
endfunction doPlayerWithdrawAllMoney(cid)
return doPlayerWithdrawMoney(cid, getPlayerBalance(cid))
endfunction doPlayerDepositAllMoney(cid)
return doPlayerDepositMoney(cid, getPlayerMoney(cid))
endfunction doPlayerTransferAllMoneyTo(cid, target)
return doPlayerTransferMoneyTo(cid, target, getPlayerBalance(cid))
endfunction playerExists(name)
return getPlayerGUIDByName(name) ~= 0
endfunction getTibiaTime()
local minutes = getWorldTime()
local hours = 0
while (minutes > 60) do
hours = hours + 1
minutes = minutes - 60
endreturn {hours = hours, minutes = minutes}
endfunction doWriteLogFile(file, text)
local f = io.open(file, "a+")
if(not f) then
return false
endf:write("[" .. os.date("%d/%m/%Y %H:%M:%S") .. "] " .. text .. "\n")
f:close()
return true
endfunction getExperienceForLevel(lv)
lv = lv - 1
return ((50 * lv * lv * lv) - (150 * lv * lv) + (400 * lv)) / 3
endfunction doMutePlayer(cid, time)
local condition = createConditionObject(CONDITION_MUTED)
setConditionParam(condition, CONDITION_PARAM_TICKS, time * 1000)
return doAddCondition(cid, condition)
endfunction getPlayerGroupName(cid)
return getGroupInfo(getPlayerGroupId(cid)).name
endfunction getPlayerVocationName(cid)
return getVocationInfo(getPlayerVocation(cid)).name
endfunction getPromotedVocation(vid)
return getVocationInfo(vid).promotedVocation
endfunction doPlayerRemovePremiumDays(cid, days)
return doPlayerAddPremiumDays(cid, -days)
endfunction getPlayerMasterPos(cid)
return getTownTemplePosition(getPlayerTown(cid))
endfunction getHouseOwner(houseId)
return getHouseInfo(houseId).owner
endfunction getHouseName(houseId)
return getHouseInfo(houseId).name
endfunction getHouseEntry(houseId)
return getHouseInfo(houseId).entry
endfunction getHouseRent(houseId)
return getHouseInfo(houseId).rent
endfunction getHousePrice(houseId)
return getHouseInfo(houseId).price
endfunction getHouseTown(houseId)
return getHouseInfo(houseId).town
endfunction getHouseTilesCount(houseId)
return getHouseInfo(houseId).tiles
endfunction getItemNameById(itemid)
return getItemDescriptionsById(itemid).name
endfunction getItemPluralNameById(itemid)
return getItemDescriptionsById(itemid).plural
endfunction getItemArticleById(itemid)
return getItemDescriptionsById(itemid).article
endfunction getItemName(uid)
return getItemDescriptions(uid).name
endfunction getItemPluralName(uid)
return getItemDescriptions(uid).plural
endfunction getItemArticle(uid)
return getItemDescriptions(uid).article
endfunction getItemText(uid)
return getItemDescriptions(uid).text
endfunction getItemSpecialDescription(uid)
return getItemDescriptions(uid).special
endfunction getItemWriter(uid)
return getItemDescriptions(uid).writer
endfunction getItemDate(uid)
return getItemDescriptions(uid).date
endfunction getTilePzInfo(pos)
return getTileInfo(pos).protection
endfunction getTileZoneInfo(pos)
local tmp = getTileInfo(pos)
if(tmp.pvp) then
return 2
endif(tmp.nopvp) then
return 1
endreturn 0
endfunction doShutdown()
return doSetGameState(GAMESTATE_SHUTDOWN)
endfunction doSummonCreature(name, pos, displayError)
local displayError, cid = displayError or true, doCreateMonster(name, pos, displayError)
if(not cid) then
cid = doCreateNpc(name, pos, displayError)
endreturn cid
endfunction getOnlinePlayers()
local tmp = getPlayersOnline()
local players = {}
for i, cid in ipairs(tmp) do
table.insert(players, getCreatureName(cid))
endreturn players
endfunction getPlayerByName(name)
local cid = getCreatureByName(name)
return isPlayer(cid) and cid or nil
endfunction isPlayer(cid)
return isCreature(cid) and cid >= AUTOID_PLAYERS and cid < AUTOID_MONSTERS
endfunction isPlayerGhost(cid)
if(not isPlayer(cid)) then
return false
endreturn getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) or getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBESEEN)
endfunction isMonster(cid)
return isCreature(cid) and cid >= AUTOID_MONSTERS and cid < AUTOID_NPCS
endfunction isNpc(cid)
return isCreature(cid) and cid >= AUTOID_NPCS
endfunction doPlayerSetExperienceRate(cid, value)
return doPlayerSetRate(cid, SKILL__LEVEL, value)
endfunction doPlayerSetMagicRate(cid, value)
return doPlayerSetRate(cid, SKILL__MAGLEVEL, value)
endfunction doPlayerAddLevel(cid, amount, round)
local experience, level = 0, getPlayerLevel(cid)
if(amount > 0) then
experience = getExperienceForLevel(level + amount) - (round and getPlayerExperience(cid) or getExperienceForLevel(level))
else
experience = -((round and getPlayerExperience(cid) or getExperienceForLevel(level)) - getExperienceForLevel(level + amount))
endreturn doPlayerAddExperience(cid, experience)
endfunction doPlayerAddMagLevel(cid, amount)
for i = 1, amount do
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true) + 1) - getPlayerSpentMana(cid)) / getConfigInfo('rateMagic'))
end
return true
endfunction doPlayerAddSkill(cid, skill, amount, round)
amount = tonumber(amount) or 1
if amount <= 0 then amount = 1 end
if(skill == SKILL__LEVEL) then
return doPlayerAddLevel(cid, amount, round)
elseif(skill == SKILL__MAGLEVEL) then
return doPlayerAddMagLevel(cid, amount)
endfor i = 1, amount do
doPlayerAddSkillTry(cid, skill, (getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill)) / getConfigInfo('rateSkill'))
end
return true
endfunction getPartyLeader(cid)
local party = getPartyMembers(cid)
if(type(party) ~= 'table') then
return 0
endreturn party[1]
endfunction isInParty(cid)
return type(getPartyMembers(cid)) == 'table'
endfunction isPrivateChannel(channelId)
return channelId >= CHANNEL_PRIVATE
endfunction doPlayerResetIdleTime(cid)
return doPlayerSetIdleTime(cid, 0)
endfunction doBroadcastMessage(text, class)
local class = class or MESSAGE_STATUS_WARNING
if(type(class) == 'string') then
local className = MESSAGE_TYPES[class]
if(className == nil) then
return false
endclass = className
elseif(class < MESSAGE_FIRST or class > MESSAGE_LAST) then
return false
endlocal players = getPlayersOnline()
for _, pid in ipairs(players) do
doPlayerSendTextMessage(pid, class, text)
endprint("> Broadcasted message: \"" .. text .. "\".")
return true
endfunction doPlayerBroadcastMessage(cid, text, class, checkFlag, ghost)
local checkFlag, ghost, class = checkFlag or true, ghost or false, class or TALKTYPE_BROADCAST
if(checkFlag and not getPlayerFlagValue(cid, PLAYERFLAG_CANBROADCAST)) then
return false
endif(type(class) == 'string') then
local className = TALKTYPE_TYPES[class]
if(className == nil) then
return false
endclass = className
elseif(class < TALKTYPE_FIRST or class > TALKTYPE_LAST) then
return false
endlocal players = getPlayersOnline()
for _, pid in ipairs(players) do
doCreatureSay(cid, text, class, ghost, pid)
endprint("> " .. getCreatureName(cid) .. " broadcasted message: \"" .. text .. "\".")
return true
endfunction getBooleanFromString(input)
local tmp = type(input)
if(tmp == 'boolean') then
return input
endif(tmp == 'number') then
return input > 0
endlocal str = string.lower(tostring(input))
return (str == "yes" or str == "true" or (tonumber(str) ~= nil and tonumber(str) > 0))
endfunction doCopyItem(item, attributes)
local attributes = attributes or falselocal ret = doCreateItemEx(item.itemid, item.type)
if(attributes) then
if(item.actionid > 0) then
doItemSetAttribute(ret, "aid", item.actionid)
end
endif(isContainer(item.uid)) then
for i = (getContainerSize(item.uid) - 1), 0, -1 do
local tmp = getContainerItem(item.uid, i)
if(tmp.itemid > 0) then
doAddContainerItemEx(ret, doCopyItem(tmp, true).uid)
end
end
endreturn getThing(ret)
endfunction doRemoveThing(uid)
if(isCreature(uid)) then
return doRemoveCreature(uid)
endreturn doRemoveItem(uid)
endfunction setAttackFormula(combat, type, minl, maxl, minm, maxm, min, max)
local min, max = min or 0, max or 0
return setCombatFormula(combat, type, -1, 0, -1, 0, minl, maxl, minm, maxm, min, max)
endfunction setHealingFormula(combat, type, minl, maxl, minm, maxm, min, max)
local min, max = min or 0, max or 0
return setCombatFormula(combat, type, 1, 0, 1, 0, minl, maxl, minm, maxm, min, max)
endfunction doChangeTypeItem(uid, subtype)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
endlocal subtype = subtype or 1
return doTransformItem(thing.uid, thing.itemid, subtype)
endfunction doSetItemText(uid, text, writer, date)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
enddoItemSetAttribute(uid, "text", text)
if(writer ~= nil) then
doItemSetAttribute(uid, "writer", tostring(writer))
if(date ~= nil) then
doItemSetAttribute(uid, "date", tonumber(date))
end
endreturn true
endfunction getFluidSourceType(itemid)
local item = getItemInfo(itemid)
return item and item.fluidSource or false
endfunction getDepotId(uid)
return getItemAttribute(uid, "depotid") or false
endfunction getItemDescriptions(uid)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
endlocal item = getItemInfo(thing.itemid)
return {
name = getItemAttribute(uid, "name") or item.name,
plural = getItemAttribute(uid, "pluralname") or item.plural,
article = getItemAttribute(uid, "article") or item.article,
special = getItemAttribute(uid, "description") or "",
text = getItemAttribute(uid, "text") or "",
writer = getItemAttribute(uid, "writer") or "",
date = getItemAttribute(uid, "date") or 0
}
endfunction getItemWeightById(itemid, count, precision)
local item, count, precision = getItemInfo(itemid), count or 1, precision or false
if(not item) then
return false
endif(count > 100) then
-- print a warning, as its impossible to have more than 100 stackable items without "cheating" the count
print('[Warning] getItemWeightById', 'Calculating weight for more than 100 items!')
endlocal weight = item.weight * count
--[[if(precision) then
return weight
endlocal t = string.explode(tostring(weight), ".")
if(table.maxn(t) == 2) then
return tonumber(t[1] .. "." .. string.sub(t[2], 1, 2))
end]]--return weight
endfunction getItemWeaponType(uid)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
endreturn getItemInfo(thing.itemid).weaponType
endfunction getItemRWInfo(uid)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
endlocal item, flags = getItemInfo(thing.itemid), 0
if(item.readable) then
flags = 1
endif(item.writable) then
flags = flags + 2
endreturn flags
endfunction getItemLevelDoor(itemid)
local item = getItemInfo(itemid)
return item and item.levelDoor or false
endfunction isItemStackable(itemid)
local item = getItemInfo(itemid)
return item and item.stackable or false
endfunction isItemRune(itemid)
local item = getItemInfo(itemid)
return item and item.clientCharges or false
endfunction isItemDoor(itemid)
local item = getItemInfo(itemid)
return item and item.type == 5 or false
endfunction isItemContainer(itemid)
local item = getItemInfo(itemid)
return item and item.group == 2 or false
endfunction isItemFluidContainer(itemid)
local item = getItemInfo(itemid)
return item and item.group == 12 or false
endfunction isItemMovable(itemid)
local item = getItemInfo(itemid)
return item and item.movable or false
endfunction isCorpse(uid)
local thing = getThing(uid)
if(thing.itemid < 100) then
return false
endlocal item = getItemInfo(thing.itemid)
return item and item.corpseType ~= 0 or false
endfunction getContainerCapById(itemid)
local item = getItemInfo(itemid)
if(not item or item.group ~= 2) then
return false
endreturn item.maxItems
endfunction getMonsterAttackSpells(name)
local monster = getMonsterInfo(name)
return monster and monster.attacks or false
endfunction getMonsterHealingSpells(name)
local monster = getMonsterInfo(name)
return monster and monster.defenses or false
endfunction getMonsterLootList(name)
local monster = getMonsterInfo(name)
return monster and monster.loot or false
endfunction getMonsterSummonList(name)
local monster = getMonsterInfo(name)
return monster and monster.summons or false
end
function getPlayersInArea(area)
local players = {}for x = area.fromx,area.tox do
for y = area.fromy,area.toy do
for z = area.fromz,area.toz dolocal m = getTopCreature({x=x, y=y, z=z}).uid
if m ~= 0 and isPlayer(m) then
table.insert(players, m)
end
end
end
end
return players
endfunction getPlayerMarriage(player)
local rows = db.getResult("SELECT `marriage` FROM `players` WHERE `id` = " .. player .. ";")
local marry = rows:getDataInt("marriage")
if marry ~= 0 then
return marry
else
return FALSE
end
endfunction addMarryStatus(player,partner)
db.executeQuery("UPDATE `players` SET `marrystatus` = " .. partner .. " WHERE `id` = " .. player .. ";")
return TRUE
endfunction doCancelMarryStatus(player)
db.executeQuery("UPDATE `players` SET `marrystatus` = 0 WHERE `id` = " .. player .. ";")
return TRUE
endfunction getMarryStatus(player)
local stat = db.getResult("SELECT `id` FROM `players` WHERE `marrystatus` = " .. player .. ";")
if(stat:getID() == -1) then
return FALSE
else
local info = stat:getDataInt("id")
return info
end
endfunction getOwnMarryStatus(player)
local stat = db.getResult("SELECT `marrystatus` FROM `players` WHERE `id` = " .. player .. ";")
if(stat:getID() == -1) then
return FALSE
else
local info = stat:getDataInt("marrystatus")
return info
end
endfunction isOnline(player)
local rows = db.getResult("SELECT `online` FROM `players` WHERE `id` = " .. player .. ";")
local on = rows:getDataInt("online")
if on ~= 0 then
return TRUE
else
return FALSE
end
endfunction getPartner(cid)
if isPatner(cid) then
a = db.getResult("SELECT player_id FROM marriage_system WHERE partner = '"..getPlayerGUID(cid).."';")
b = "player_id"
else
a = db.getResult("SELECT partner FROM marriage_system WHERE player_id = '"..getPlayerGUID(cid).."';")
b = "partner"
end
end
local tapete = {
[13495] = 13496, -- TAPETE DESMONTADO
[13496] = 13495 -- TAPETE MONTADO
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(not tapete[item.itemid]) then
return false
end
if getHouseOwner(getHouseInfo(getPlayerPosition(cid))) == getPlayerGUID(cid) then
doTransformItem(item.uid, tapete[item.itemid])
doDecayItem(item.uid)
end
end
na sua sourcer não possui a getTileHouseInfo então coloquei uma função para tentar quebrar o galho.
tente colocar a função getTileHouseInfo na sourcer para funcionar!
Editado Junho 20 por ZikaLord
info
Grupo: Artesão
Registrado: 25/07/18
Posts: 112
Reputação: +8
Gênero: Outro
Ola , gostaria de ajuda nessa script de "Carpet System" , tentei modifica-la eu mesmo , mas não tive muito sucesso
Quando o player usa o carpet diretamente da bag no piso , o tapete some e causa um erro.
Eu gostaria que quando ele usasse diretamente da bag no piso, ela pegasse normal ou voltasse pra bag.
Para usar o carpet e necessario colocar ele no chao e usar no piso, e pra voltar a sua forma item e so clicar em cima, gostaria que tivesse o botao "Embrulhar" se possivel