Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

 

Ola galera Bom dia, Boa tarde e Boa noite. Estou com um problema que acredito que pra vcs que ja tem bastante experiencia pode ser bem facil e rapido de resolver, é um sistema de lenhador porem quando eu corto a arvore ela n some mas aparece o toco que era pra ficar no lugar da arvore normalmente, e a segunda coisa que eu queria perdir é que quando vc usa o item para corta a arvore a outfit troca e eu NÃO queria que trocasse, alguem poderia me ajudar PF ???

 

 

Citar

 

 

Você tem o código disponível? Se tiver publique-o aqui: 

local config = {
   
    item = {13048}, -- Itens que poderão ser cortados
    chance = 70, -- Chance de cortar (1 a 100)
    madeiras = {26381, 2674}, -- Itens que o player poderá ganhar
    transformItem = 26147, -- Item o qual a árvore será transformado
    texts = {"Tuc", "Toc", "Trec"}, -- Texto aleatorio ao cortar a árvore
    time = 1, -- Minutos para a arvore crescer novamente
   outfit = {[0] = 0, [1] = 0}, -- Outfits female e male
    out_time = 0 -- Tempo em segundos que a outfit estará trocada.
    
   
}
 
local function checkMove(uid)
    if isPlayer(uid) then
        doCreatureSetNoMove(uid, FALSE)
    end
end
 
local function Arvore(pos, t)
    doCleanTile(pos)
    doCreateItem(config.transformItem, 1, pos)
    addEvent(function()
        doCleanTile(pos)
        doCreateItem(t, 1, pos)
    end, config.time * 60 * 1000)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local text = config.texts[math.random(1, #config.texts)]
local t = nil    
    if isInArray(config.item, itemEx.itemid) then
        doSetCreatureOutfit(cid, {lookType = config.outfit[getPlayerSex(cid)]}, config.out_time * 1000)
        doCreatureSetNoMove(cid, TRUE)
        addEvent(checkMove, config.out_time * 1000, cid)
        if math.random(1,100) >= config.chance then
            local wood = math.random(3, 7)
            local prem = config.madeiras[math.random(1, #config.madeiras)]
            doPlayerAddItem(cid, prem, wood)
            doSendMagicEffect(toPosition, 1)
            doSendMagicEffect(fromPosition, 1)
            doSendAnimatedText(fromPosition, "Sucess", TEXTCOLOR_WHITE)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce coletou " .. wood .. " ".. getItemInfo(prem).name ..".")
            doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE)
            t = itemEx.itemid
            Arvore(toPosition, t)
        else
            doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE)
            doSendMagicEffect(toPosition, 1)
            doSendAnimatedText(fromPosition, "Fail", TEXTCOLOR_WHITE)
        end
        return true
    end
end 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Editado por Capitao wyz (veja o histórico de edições)

Postado
local config = {
   
    item = {13048}, -- Itens que poderão ser cortados
    chance = 70, -- Chance de cortar (1 a 100)
    madeiras = {26381, 2674}, -- Itens que o player poderá ganhar
    transformItem = 26147, -- Item o qual a árvore será transformado
    texts = {"Tuc", "Toc", "Trec"}, -- Texto aleatorio ao cortar a árvore
    time = 1, -- Minutos para a arvore crescer novamente
   --outfit = {[0] = 0, [1] = 0}, -- Outfits female e male
    --out_time = 0 -- Tempo em segundos que a outfit estará trocada.
    
   
}
 
local function checkMove(uid)
    if isPlayer(uid) then
        doCreatureSetNoMove(uid, FALSE)
    end
end
 
local function Arvore(pos, t)
    doCleanTile(pos)
    doCreateItem(config.transformItem, 1, pos)
    addEvent(function()
        doCleanTile(pos)
        doCreateItem(t, 1, pos)
    end, config.time * 60 * 1000)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local text = config.texts[math.random(1, #config.texts)]
local t = nil    
    if isInArray(config.item, itemEx.itemid) then
        --doSetCreatureOutfit(cid, {lookType = config.outfit[getPlayerSex(cid)]}, config.out_time * 1000)
        doCreatureSetNoMove(cid, TRUE)
        --addEvent(checkMove, config.out_time * 1000, cid)
        if math.random(1,100) >= config.chance then
            local wood = math.random(3, 7)
            local prem = config.madeiras[math.random(1, #config.madeiras)]
            doPlayerAddItem(cid, prem, wood)
            doSendMagicEffect(toPosition, 1)
            doSendMagicEffect(fromPosition, 1)
            doSendAnimatedText(fromPosition, "Sucess", TEXTCOLOR_WHITE)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce coletou " .. wood .. " ".. getItemInfo(prem).name ..".")
            doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE)
            t = itemEx.itemid
            Arvore(toPosition, t)
        else
            doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE)
            doSendMagicEffect(toPosition, 1)
            doSendAnimatedText(fromPosition, "Fail", TEXTCOLOR_WHITE)
        end
        return true
    end
end

 

Postado
  • Autor
1 hora atrás, Encrypton disse:

local config = {
   
    item = {13048}, -- Itens que poderão ser cortados
    chance = 70, -- Chance de cortar (1 a 100)
    madeiras = {26381, 2674}, -- Itens que o player poderá ganhar
    transformItem = 26147, -- Item o qual a árvore será transformado
    texts = {"Tuc", "Toc", "Trec"}, -- Texto aleatorio ao cortar a árvore
    time = 1, -- Minutos para a arvore crescer novamente
   --outfit = {[0] = 0, [1] = 0}, -- Outfits female e male
    --out_time = 0 -- Tempo em segundos que a outfit estará trocada.
    
   
}
 
local function checkMove(uid)
    if isPlayer(uid) then
        doCreatureSetNoMove(uid, FALSE)
    end
end
 
local function Arvore(pos, t)
    doCleanTile(pos)
    doCreateItem(config.transformItem, 1, pos)
    addEvent(function()
        doCleanTile(pos)
        doCreateItem(t, 1, pos)
    end, config.time * 60 * 1000)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local text = config.texts[math.random(1, #config.texts)]
local t = nil    
    if isInArray(config.item, itemEx.itemid) then
        --doSetCreatureOutfit(cid, {lookType = config.outfit[getPlayerSex(cid)]}, config.out_time * 1000)
        doCreatureSetNoMove(cid, TRUE)
        --addEvent(checkMove, config.out_time * 1000, cid)
        if math.random(1,100) >= config.chance then
            local wood = math.random(3, 7)
            local prem = config.madeiras[math.random(1, #config.madeiras)]
            doPlayerAddItem(cid, prem, wood)
            doSendMagicEffect(toPosition, 1)
            doSendMagicEffect(fromPosition, 1)
            doSendAnimatedText(fromPosition, "Sucess", TEXTCOLOR_WHITE)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce coletou " .. wood .. " ".. getItemInfo(prem).name ..".")
            doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE)
            t = itemEx.itemid
            Arvore(toPosition, t)
        else
            doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE)
            doSendMagicEffect(toPosition, 1)
            doSendAnimatedText(fromPosition, "Fail", TEXTCOLOR_WHITE)
        end
        return true
    end
end

 

Ola bom dia, amigo deu certo porem quando eu corto a arvore eu n consigo mais me mover .

1 hora atrás, Encrypton disse:

local config = {
   
    item = {13048}, -- Itens que poderão ser cortados
    chance = 70, -- Chance de cortar (1 a 100)
    madeiras = {26381, 2674}, -- Itens que o player poderá ganhar
    transformItem = 26147, -- Item o qual a árvore será transformado
    texts = {"Tuc", "Toc", "Trec"}, -- Texto aleatorio ao cortar a árvore
    time = 1, -- Minutos para a arvore crescer novamente
   --outfit = {[0] = 0, [1] = 0}, -- Outfits female e male
    --out_time = 0 -- Tempo em segundos que a outfit estará trocada.
    
   
}
 
local function checkMove(uid)
    if isPlayer(uid) then
        doCreatureSetNoMove(uid, FALSE)
    end
end
 
local function Arvore(pos, t)
    doCleanTile(pos)
    doCreateItem(config.transformItem, 1, pos)
    addEvent(function()
        doCleanTile(pos)
        doCreateItem(t, 1, pos)
    end, config.time * 60 * 1000)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local text = config.texts[math.random(1, #config.texts)]
local t = nil    
    if isInArray(config.item, itemEx.itemid) then
        --doSetCreatureOutfit(cid, {lookType = config.outfit[getPlayerSex(cid)]}, config.out_time * 1000)
        doCreatureSetNoMove(cid, TRUE)
        --addEvent(checkMove, config.out_time * 1000, cid)
        if math.random(1,100) >= config.chance then
            local wood = math.random(3, 7)
            local prem = config.madeiras[math.random(1, #config.madeiras)]
            doPlayerAddItem(cid, prem, wood)
            doSendMagicEffect(toPosition, 1)
            doSendMagicEffect(fromPosition, 1)
            doSendAnimatedText(fromPosition, "Sucess", TEXTCOLOR_WHITE)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce coletou " .. wood .. " ".. getItemInfo(prem).name ..".")
            doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE)
            t = itemEx.itemid
            Arvore(toPosition, t)
        else
            doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE)
            doSendMagicEffect(toPosition, 1)
            doSendAnimatedText(fromPosition, "Fail", TEXTCOLOR_WHITE)
        end
        return true
    end
end

 

consegui arrumar aqui amigo muito obg pela ajuda s2 

1 hora atrás, Encrypton disse:

local config = {
   
    item = {13048}, -- Itens que poderão ser cortados
    chance = 70, -- Chance de cortar (1 a 100)
    madeiras = {26381, 2674}, -- Itens que o player poderá ganhar
    transformItem = 26147, -- Item o qual a árvore será transformado
    texts = {"Tuc", "Toc", "Trec"}, -- Texto aleatorio ao cortar a árvore
    time = 1, -- Minutos para a arvore crescer novamente
   --outfit = {[0] = 0, [1] = 0}, -- Outfits female e male
    --out_time = 0 -- Tempo em segundos que a outfit estará trocada.
    
   
}
 
local function checkMove(uid)
    if isPlayer(uid) then
        doCreatureSetNoMove(uid, FALSE)
    end
end
 
local function Arvore(pos, t)
    doCleanTile(pos)
    doCreateItem(config.transformItem, 1, pos)
    addEvent(function()
        doCleanTile(pos)
        doCreateItem(t, 1, pos)
    end, config.time * 60 * 1000)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local text = config.texts[math.random(1, #config.texts)]
local t = nil    
    if isInArray(config.item, itemEx.itemid) then
        --doSetCreatureOutfit(cid, {lookType = config.outfit[getPlayerSex(cid)]}, config.out_time * 1000)
        doCreatureSetNoMove(cid, TRUE)
        --addEvent(checkMove, config.out_time * 1000, cid)
        if math.random(1,100) >= config.chance then
            local wood = math.random(3, 7)
            local prem = config.madeiras[math.random(1, #config.madeiras)]
            doPlayerAddItem(cid, prem, wood)
            doSendMagicEffect(toPosition, 1)
            doSendMagicEffect(fromPosition, 1)
            doSendAnimatedText(fromPosition, "Sucess", TEXTCOLOR_WHITE)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce coletou " .. wood .. " ".. getItemInfo(prem).name ..".")
            doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE)
            t = itemEx.itemid
            Arvore(toPosition, t)
        else
            doSendAnimatedText(toPosition, "".. text .."", TEXTCOLOR_WHITE)
            doSendMagicEffect(toPosition, 1)
            doSendAnimatedText(fromPosition, "Fail", TEXTCOLOR_WHITE)
        end
        return true
    end
end

 

amigo descobri um bug poderia me ajudar ? so esta funcionando quando eu sumono o arvore com o adm, as arvores que estao salva no mapa ainda estao com o mesmo problema que n some quando é cortada 

Postado
  • Autor
2 horas atrás, Encrypton disse:

as arvores do mapa são do ID 13048?

Caso não forem é só adicionar o ID do itemID que esta no remeres condizente a todas arvores que deverão ser cortadas no mapa 

Sim é o mesmo ID, eu tentei com varias outras arvores como no print a baixo e o o problema continua, a arvore só é cortada corretamente quando sumono com o adm =/

ffffffff.png

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 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo