Ir para conteúdo

Featured Replies

Postado

Testa:

local config = {
    rate = 10, -- Speed at which the skill will progress
    cooldown = 2, -- Time in seconds of character exhaustion
}

function onUse(cid, item, frompos, item2, topos)
    local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622,
        4623, 4624, 4625, 7236, 10499, 15401, 15402 }
    local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011
    local now = os.time()
    local check = (now - getPlayerStorageValue(cid, storage))
    if not isInArray(waterIds, item2.itemid) then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can only use the fishing rod in the water.")
        return true
    end

    if check < 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.")
        return true
    end

    if ((math.random(1, 100000)) <= (skill * 500)) then
        if skill > 50 then
            amount = math.random(1, ((skill / 10) - 3))
        end
        doPlayerAddItem(cid, 2667, amount)
        if amount > 7 then
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!")
        end
    end

    doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate))
    setPlayerStorageValue(cid, storage, (now + config.cooldown))

    return true
end

 

Editado por Anderson Sacani (veja o histórico de edições)

  • Respostas 10
  • Visualizações 701
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Anderson Sacani
    Anderson Sacani

    local config = { rate = 10, -- Speed at which the skill will progress cooldown = 2, -- Time in seconds of character exhaustion } function onUse(cid, item, frompos, item2, topos) local wat

  • funcionou certinho, obrigado! rep+

Postado
  • Autor
2 minutos atrás, Anderson Sacani disse:

Testa:


local config = {
    rate = 10, -- Speed at which the skill will progress
    cooldown = 2, -- Time in seconds of character exhaustion
}

function onUse(cid, item, frompos, item2, topos)
    local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622,
        4623, 4624, 4625, 7236, 10499, 15401, 15402 }
    local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011
    local now = os.time()
    local check = (now - getPlayerStorageValue(cid, storage))
    if not isInArray(waterIds, item2.itemid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You can only use the fishing rod in the water.")
        return true
    end

    if check < 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.")
        return true
    end

    if ((math.random(1, 100000)) <= (skill * 500)) then
        if skill > 50 then
            amount = math.random(1, ((skill / 10) - 3))
        end
        doPlayerAddItem(cid, 2667, amount)
        if amount > 7 then
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!")
        end
    end

    doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate))
    setPlayerStorageValue(cid, storage, (now + config.cooldown))

    return true
end

 

funcionou certinho, mas não aparece a animação de quando pesca, sabe? esqueci de mencionar no comentário anterior, perdão!

Postado
local config = {
    rate = 10, -- Speed at which the skill will progress
    cooldown = 2, -- Time in seconds of character exhaustion
}

function onUse(cid, item, frompos, item2, topos)
    local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622,
        4623, 4624, 4625, 7236, 10499, 15401, 15402 }
    local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011
    local now = os.time()
    local check = (now - getPlayerStorageValue(cid, storage))
    if not isInArray(waterIds, item2.itemid) then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can only use the fishing rod in the water.")
        return true
    end

    if check < 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.")
        return true
    end

    if ((math.random(1, 100000)) <= (skill * 500)) then
        if skill > 50 then
            amount = math.random(1, ((skill / 10) - 3))
        end
        doPlayerAddItem(cid, 2667, amount)
        if amount > 7 then
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!")
        end
    end

    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate))
    setPlayerStorageValue(cid, storage, (now + config.cooldown))

    return true
end

 

Postado
  • Autor
3 minutos atrás, Anderson Sacani disse:

local config = {
    rate = 10, -- Speed at which the skill will progress
    cooldown = 2, -- Time in seconds of character exhaustion
}

function onUse(cid, item, frompos, item2, topos)
    local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622,
        4623, 4624, 4625, 7236, 10499, 15401, 15402 }
    local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011
    local now = os.time()
    local check = (now - getPlayerStorageValue(cid, storage))
    if not isInArray(waterIds, item2.itemid) then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can only use the fishing rod in the water.")
        return true
    end

    if check < 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.")
        return true
    end

    if ((math.random(1, 100000)) <= (skill * 500)) then
        if skill > 50 then
            amount = math.random(1, ((skill / 10) - 3))
        end
        doPlayerAddItem(cid, 2667, amount)
        if amount > 7 then
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!")
        end
    end

    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate))
    setPlayerStorageValue(cid, storage, (now + config.cooldown))

    return true
end

 

funcionou certinho, obrigado! rep+

  • 4 weeks later...
Postado
  • Autor
Em 20/02/2023 em 18:44, Anderson Sacani disse:


local config = {
    rate = 10, -- Speed at which the skill will progress
    cooldown = 2, -- Time in seconds of character exhaustion
}

function onUse(cid, item, frompos, item2, topos)
    local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622,
        4623, 4624, 4625, 7236, 10499, 15401, 15402 }
    local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011
    local now = os.time()
    local check = (now - getPlayerStorageValue(cid, storage))
    if not isInArray(waterIds, item2.itemid) then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can only use the fishing rod in the water.")
        return true
    end

    if check < 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.")
        return true
    end

    if ((math.random(1, 100000)) <= (skill * 500)) then
        if skill > 50 then
            amount = math.random(1, ((skill / 10) - 3))
        end
        doPlayerAddItem(cid, 2667, amount)
        if amount > 7 then
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!")
        end
    end

    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate))
    setPlayerStorageValue(cid, storage, (now + config.cooldown))

    return true
end

 

Olá amigo, peço desculpas por reviver este tópico, mas quando se pesca com a fishing rod está aumento o skill fist fighting e não o fishing, saberia como resolver? já tentei mudar no getPlayerSkill(cid, 6) mas aparentemente este é o skill de fishing mesmo

Edit: Consegui arrumar, ao invés de LEVEL_SKILL_FISHING coloquei somente SKILL_FISHING e deu certo!

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

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.6k

Informação Importante

Confirmação de Termo