E o comando /i
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
local t = string.explode(param, ",")
local ret = RETURNVALUE_NOERROR
local pos = getCreaturePosition(cid)
local id = tonumber(t[1])
if(not id) then
id = getItemIdByName(t[1], false)
if(not id) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
return true
end
end
local amount = 100
if(t[2]) then
amount = t[2]
end
local item = doCreateItemEx(id, amount)
if(t[3] and getBooleanFromString(t[3])) then
if(t[4] and getBooleanFromString(t[4])) then
pos = getCreatureLookPosition(cid)
end
ret = doTileAddItemEx(pos, item)
else
ret = doPlayerAddItemEx(cid, item, true)
end
if(ret ~= RETURNVALUE_NOERROR) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1])
return true
end
doDecayItem(item)
if(not isPlayerGhost(cid)) then
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
end
return true
end
Troca por esse e vê se funciona









info
Grupo: Infante
Registrado: 27/08/11
Posts: 1.9k
Reputação: +85
Gênero: Masculino
Char no Tibia: Bruno Maciel
Estou tendo um problema estou adicionando o systema de addons no meu server e estou adicionando tudo certinho em actions e itens.xml
Quando fui testa um addons pra ve se deu certo!
Deu este bug e no jogo fala como se o item nao tive-se ele ja foi adicionado certinho no cliente!
BUG
[08/04/2016 22:19:53] [Error - TalkAction Interface]
[08/04/2016 22:19:53] data/talkactions/scripts/createitem.lua:onSay
[08/04/2016 22:19:53] Description:
[08/04/2016 22:19:53] (luaDoCreateItemEx) Item not found