Ir para conteúdo

Featured Replies

  • Respostas 11
  • Visualizações 1.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local items = {{itemid, count}, {itemid, count}, {itemid, count}, ...}     --{{ID_do_item, quantia_requerida}, {ID_do_item, quantia_requerida}, ...} function onSay(cid)     local str = ""     for _, i

  • local items = {{itemid, count}, {itemid, count}, {itemid, count}, ...}     --{{ID_do_item, quantia_requerida}, {ID_do_item, quantia_requerida}, ...} function onSay(cid)     local str = ""     for _, i

  • function ExistItemByName(name) -- by vodka local items = io.open("data/items/items.xml", "r"):read("*all") local get = items:match('name="' .. name ..'"') if get == nil or get == "" then return false

Postado
ai va em talkations.xml i add isso 

<talkaction words="!armas" script="armas.lua"/>

agr vai em talkations>scripts i crie um arquivo chamado "armas"
i add

function onSay(cid, param)


local yalahar = getPlayerItemCount(cid, 2160)
local demonshield = getPlayerItemCount(cid, 2160)
local storage = 10-getPlayerStorageValue(cid, 19253)
local storage2 = 10-getPlayerStorageValue(cid, 19254)
if param == ""
doPlayerSendCancel(cid,"Use os seguintes valores junto ao comando: demonshield/yalahar.")
end
if param == "demonshield" then
if demonshield >= 1 then
setPlayerStorageValue(cid, 19253, demonshield)
doPlayerPopupFYI(cid, "Voce possui atualmente ".. demonshield .." itens da quest faltando ".. storage ..".")
else
doPlayerSendCancel(cid, "Voce nao possui nenhum item da quest.")
end
return true
end
if param == "yalahar" then
if yalahar >= 1 then
setPlayerStorageValue(cid, 19254, yalahar)
doPlayerPopupFYI(cid, "Voce possui atualmente ".. yalahar .." itens da quest faltando ".. storage2 ..".")
else
doPlayerSendCancel(cid,"Voce nao possui nenhum item da quest.")
end
return true
end

Postado

 

ai va em talkations.xml i add isso 

<talkaction words="!armas" script="armas.lua"/>

agr vai em talkations>scripts i crie um arquivo chamado "armas"
i add

function onSay(cid, param)

local yalahar = getPlayerItemCount(cid, 2160)

local demonshield = getPlayerItemCount(cid, 2160)

local storage = 10-getPlayerStorageValue(cid, 19253)

local storage2 = 10-getPlayerStorageValue(cid, 19254)

if param == ""

doPlayerSendCancel(cid,"Use os seguintes valores junto ao comando: demonshield/yalahar.")

end

if param == "demonshield" then

if demonshield >= 1 then

setPlayerStorageValue(cid, 19253, demonshield)

doPlayerPopupFYI(cid, "Voce possui atualmente ".. demonshield .." itens da quest faltando ".. storage ..".")

else

doPlayerSendCancel(cid, "Voce nao possui nenhum item da quest.")

end

return true

end

if param == "yalahar" then

if yalahar >= 1 then

setPlayerStorageValue(cid, 19254, yalahar)

doPlayerPopupFYI(cid, "Voce possui atualmente ".. yalahar .." itens da quest faltando ".. storage2 ..".")

else

doPlayerSendCancel(cid,"Voce nao possui nenhum item da quest.")

end

return true

end

 

Não entendi oque você mudou...  :hum:

Postado
  • Autor
 

 

local items = {{itemid, count}, {itemid, count}, {itemid, count}, ...}     --{{ID_do_item, quantia_requerida}, {ID_do_item, quantia_requerida}, ...}
function onSay(cid)
    local str = ""
    for _, item in pairs(items) do
        if str == "" then
            str = getItemNameById(item[1]).." - ["..getPlayerItemCount(cid, item[1]).."/"..item[2].."]"
        else
            str = str.."\n"..getItemNameById(item[1]).." - ["..getPlayerItemCount(cid, item[1]).."/"..item[2].."]"
        end
    end
    doPlayerPopupFYI(cid, "You have:\n"..str)
    return true
end

 

Tá dando um erro na minha distro... eu testei em outra funcionou mais na outra não... 

[Error - TalkAction Interface]
data/talkactions/scripts/quest.lua:onSay
Description:
data/lib/100-shortcut.lua:260: attempt to index a boolean value
stack traceback:
        data/lib/100-shortcut.lua:260: in function 'getItemNameById'
        data/talkactions/scripts/quest.lua:6: in function <data/talkactions/scripts/quest.lua:2>
 
Alguém ajuda ?
Postado

local items = {{itemid, count}, {itemid, count}, {itemid, count}, ...}     --{{ID_do_item, quantia_requerida}, {ID_do_item, quantia_requerida}, ...}
function onSay(cid)
    local str = ""
    for _, item in pairs(items) do
        if str == "" then
            str = getItemInfo(item[1]).name.." - ["..getPlayerItemCount(cid, item[1]).."/"..item[2].."]"
        else
            str = str.."\n"..getItemInfo(item[1]).name.." - ["..getPlayerItemCount(cid, item[1]).."/"..item[2].."]"
        end
    end
    doPlayerPopupFYI(cid, "You have:\n"..str)
    return true
end

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96k
  • Posts 512.6k

Informação Importante

Confirmação de Termo