Tem esse daqui que eu fiz só falta eu atualizar mais é rapidinho
http://www.xtibia.com/forum/topic/200470-create-item/page__p__1408266#entry1408266
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

Tem esse daqui que eu fiz só falta eu atualizar mais é rapidinho
http://www.xtibia.com/forum/topic/200470-create-item/page__p__1408266#entry1408266
info
Grupo: Conde
Registrado: 10/07/08
Posts: 574
Reputação: +13
Gênero: Masculino
Char no Tibia: Hebi Of Amera

é quase isso mesmo lek, só que eu queria um que ao invés dele bloquear determinados IDs, eu queria que só pudesse fazer os items que estivessem no scripts.
info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: No Have

E só pegar o script do skymagmun e modificar:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você deve digitar /i nome do item, quantidade(opcional, se for stackable criara 100).")
return true
end
local t = string.explode(param, ",")
local ret = RETURNVALUE_NOERROR
local pos = getCreaturePosition(cid)
local allowedPlayers = {"[ADM] Castiel", "[GOD] Dean"}
local blockedIds = {2150, 2159}
local arq = 'createItemLogs.txt'
local file = io.open("data/logs/".. arq, "a")
local id = tonumber(t[1])
if(not id) then
id = getItemIdByName(t[1], false)
if(not id) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Esse item não existe.")
return true
end
end
if not isInArray(blockedIds, tonumber(t[1])) and not isInArray(allowedPlayers, getCreatureName(cid)) then
doPlayerSendTextMessage(cid, 27, "Você não pode criar este item um registro foi mandado para o hoster.")
file:write("[" .. os.date("%d %B %Y %X ", os.time()) .. "] " .. getCreatureName(cid) .. " tentou criar um item proibido ID(" .. t[1] .. ")\n") return false
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, "Não foi possível adicionar o item: " .. t[1])
return true
end
doDecayItem(item)
if(not isPlayerGhost(cid)) then
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
end
return true
end
info
Grupo: Barão
Registrado: 18/10/10
Posts: 246
Reputação: +89
Char no Tibia: Elite Pamcadaum

E só pegar o script do skymagmun e modificar:
function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você deve digitar /i nome do item, quantidade(opcional, se for stackable criara 100).") return true end local t = string.explode(param, ",") local ret = RETURNVALUE_NOERROR local pos = getCreaturePosition(cid) local allowedPlayers = {"[ADM] Castiel", "[GOD] Dean"} local blockedIds = {2150, 2159} local arq = 'createItemLogs.txt' local file = io.open("data/logs/".. arq, "a") local id = tonumber(t[1]) if(not id) then id = getItemIdByName(t[1], false) if(not id) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Esse item não existe.") return true end end if not isInArray(blockedIds, tonumber(t[1])) and not isInArray(allowedPlayers, getCreatureName(cid)) then doPlayerSendTextMessage(cid, 27, "Você não pode criar este item um registro foi mandado para o hoster.") file:write("[" .. os.date("%d %B %Y %X ", os.time()) .. "] " .. getCreatureName(cid) .. " tentou criar um item proibido ID(" .. t[1] .. ")\n") return false 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, "Não foi possível adicionar o item: " .. t[1]) return true end doDecayItem(item) if(not isPlayerGhost(cid)) then doSendMagicEffect(pos, CONST_ME_MAGIC_RED) endreturn true
end
Cara, variáveis que na inicialização não dependem do escopo principal não precisam ser declaradas nele, coloca elas antes da declaração do escopo principal, para economizar memória durante a execução.
Flw.
info
Grupo: Conde
Registrado: 10/07/08
Posts: 574
Reputação: +13
Gênero: Masculino
Char no Tibia: Hebi Of Amera
Galera tem como fazer um talkactions do /i só que limitado só com os items que eu quero que ele possa fazer? valeu