Ir para conteúdo
  • Cadastre-se

(Resolvido)SCRIPT FISHING OT/EXAUST


Ir para solução Resolvido por Storm,

Posts Recomendados

Boa tarde

 

 

Eu tenho um OT que tem um sistema de pescar, eu uso esse abaixo porém se eu fico dando use na agua ele pesca muito rapido, eu queria um exaust de por exemplo, uma bolinha na agua por segundo

 

 

Tipo, dar um USE por segundo entende?

 

 

image.png.0ed270f70542dc36ca7c35fe409c096c.png

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000
local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}
function onUse(cid, item, frompos, item2, topos)
    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end

 

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

Link para o post
Compartilhar em outros sites
local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000
local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}
function onUse(cid, item, frompos, item2, topos)

if exhaustion.check(cid, 120) == TRUE then
doPlayerSendCancel(cid, "You are exhausted.")
doSendMagicEffect(getCreaturePosition(cid), 3)
return TRUE
end


    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    exhaustion.set(cid, 120, 0.5)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end

 

Link para o post
Compartilhar em outros sites
4 minutos atrás, Sttorm disse:

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000
local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}
function onUse(cid, item, frompos, item2, topos)

if exhaustion.check(cid, 120) == TRUE then
doPlayerSendCancel(cid, "You are exhausted.")
doSendMagicEffect(getCreaturePosition(cid), 3)
return TRUE
end


    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    exhaustion.set(cid, 120, 0.5)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end

Erro

 

 

image.thumb.png.8c9b623f077e48861ee8b3fbaba52824.png

Link para o post
Compartilhar em outros sites

@Infused em Data>Lib crie um arquivo chamado 034-exhaustion e cole isso dentro

 

exhaustion =
{
	check = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		return getPlayerStorageValue(cid, storage) >= os.time(t)
	end,

	get = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		local exhaust = getPlayerStorageValue(cid, storage)
		if(exhaust > 0) then
			local left = exhaust - os.time(t)
			if(left >= 0) then
				return left
			end
		end

		return false
	end,

	set = function (cid, storage, time)
		setPlayerStorageValue(cid, storage, os.time(t) + time)
	end,

	make = function (cid, storage, time)
		local exhaust = exhaustion.get(cid, storage)
		if(not exhaust) then
			exhaustion.set(cid, storage, time)
			return true
		end

		return false
	end
}

 

Link para o post
Compartilhar em outros sites
19 minutos atrás, Sttorm disse:

@Infused em Data>Lib crie um arquivo chamado 034-exhaustion e cole isso dentro

 


exhaustion =
{
	check = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		return getPlayerStorageValue(cid, storage) >= os.time(t)
	end,

	get = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		local exhaust = getPlayerStorageValue(cid, storage)
		if(exhaust > 0) then
			local left = exhaust - os.time(t)
			if(left >= 0) then
				return left
			end
		end

		return false
	end,

	set = function (cid, storage, time)
		setPlayerStorageValue(cid, storage, os.time(t) + time)
	end,

	make = function (cid, storage, time)
		local exhaust = exhaustion.get(cid, storage)
		if(not exhaust) then
			exhaustion.set(cid, storage, time)
			return true
		end

		return false
	end
}

 

 

Continua 

 

 

 

image.thumb.png.34c29ae1ea9bcdeeb19ba8289641dc98.png

 

image.png

image.png

Link para o post
Compartilhar em outros sites
exhaustion = {
	check = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		return getPlayerStorageValue(cid, storage) >= os.time(t)
	end,

	get = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		local exhaust = getPlayerStorageValue(cid, storage)
		if(exhaust > 0) then
			local left = exhaust - os.time(t)
			if(left >= 0) then
				return left
			end
		end

		return false
	end,

	set = function (cid, storage, time)
		setPlayerStorageValue(cid, storage, os.time(t) + time)
	end,

	make = function (cid, storage, time)
		local exhaust = exhaustion.get(cid, storage)
		if(not exhaust) then
			exhaustion.set(cid, storage, time)
			return true
		end

		return false
	end
}

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000

function onUse(cid, item, frompos, item2, topos)

local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}

if exhaustion.check(cid, 120) == TRUE then
doPlayerSendCancel(cid, "You are exhausted.")
doSendMagicEffect(getCreaturePosition(cid), 3)
return TRUE
end


    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    exhaustion.set(cid, 120, 0.5)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end

 

Link para o post
Compartilhar em outros sites
3 minutos atrás, Sttorm disse:

exhaustion = {
	check = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		return getPlayerStorageValue(cid, storage) >= os.time(t)
	end,

	get = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		local exhaust = getPlayerStorageValue(cid, storage)
		if(exhaust > 0) then
			local left = exhaust - os.time(t)
			if(left >= 0) then
				return left
			end
		end

		return false
	end,

	set = function (cid, storage, time)
		setPlayerStorageValue(cid, storage, os.time(t) + time)
	end,

	make = function (cid, storage, time)
		local exhaust = exhaustion.get(cid, storage)
		if(not exhaust) then
			exhaustion.set(cid, storage, time)
			return true
		end

		return false
	end
}

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000

function onUse(cid, item, frompos, item2, topos)

local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}

if exhaustion.check(cid, 120) == TRUE then
doPlayerSendCancel(cid, "You are exhausted.")
doSendMagicEffect(getCreaturePosition(cid), 3)
return TRUE
end


    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    exhaustion.set(cid, 120, 0.5)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end

 

Não deu erro, mas continua bem rápido..

Link para o post
Compartilhar em outros sites
5 minutos atrás, Sttorm disse:

exhaustion = {
	check = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		return getPlayerStorageValue(cid, storage) >= os.time(t)
	end,

	get = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		local exhaust = getPlayerStorageValue(cid, storage)
		if(exhaust > 0) then
			local left = exhaust - os.time(t)
			if(left >= 0) then
				return left
			end
		end

		return false
	end,

	set = function (cid, storage, time)
		setPlayerStorageValue(cid, storage, os.time(t) + time)
	end,

	make = function (cid, storage, time)
		local exhaust = exhaustion.get(cid, storage)
		if(not exhaust) then
			exhaustion.set(cid, storage, time)
			return true
		end

		return false
	end
}

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000

function onUse(cid, item, frompos, item2, topos)

local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}

if exhaustion.check(cid, 120) == TRUE then
doPlayerSendCancel(cid, "You are exhausted.")
doSendMagicEffect(getCreaturePosition(cid), 3)
return TRUE
end


    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    exhaustion.set(cid, 120, 0.5)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end

 

Realmente, como sotten falou continua bem rapido

@up

 

Alguem?

Link para o post
Compartilhar em outros sites
3 minutos atrás, Sttorm disse:

Da um CTRL + F e procura por 


exhaustion.set(cid, 120, 0.5)

Onde tá 0.5 são os segundos , configure ao seu modo.

exhaustion.set(cid, 120, 1000.1000)

 

Coloquei até 1000 cara, continua rápido :( será que consigo arrumar isso?

Link para o post
Compartilhar em outros sites
Spoiler

exhaustion = {
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time(t)
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time(t)
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time(t) + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000

function onUse(cid, item, frompos, item2, topos)

local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}

local waittime = 1.5 -- Tempo de exhaustion
local storage = 250002

    if exhaustion.check(cid, storage) then
    doPlayerSendCancel(cid, "You are exhausted")
    return false
    end


    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    exhaustion.set(cid, storage, waittime)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end


Arrumei definitivamente ; configure aqui

local waittime = 1.5 -- Tempo de exhaustion
local storage = 250002

 

Link para o post
Compartilhar em outros sites
1 minuto atrás, Sttorm disse:
  Mostrar conteúdo oculto

exhaustion = {
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time(t)
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time(t)
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time(t) + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000

function onUse(cid, item, frompos, item2, topos)

local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}

local waittime = 1.5 -- Tempo de exhaustion
local storage = 250002

    if exhaustion.check(cid, storage) then
    doPlayerSendCancel(cid, "You are exhausted")
    return false
    end


    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    exhaustion.set(cid, storage, waittime)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end


Arrumei definitivamente ; configure aqui


local waittime = 1.5 -- Tempo de exhaustion
local storage = 250002

 

coloco onde?

4 minutos atrás, Sttorm disse:
  Ocultar conteúdo

exhaustion = {
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time(t)
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time(t)
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time(t) + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000

function onUse(cid, item, frompos, item2, topos)

local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}

local waittime = 1.5 -- Tempo de exhaustion
local storage = 250002

    if exhaustion.check(cid, storage) then
    doPlayerSendCancel(cid, "You are exhausted")
    return false
    end


    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    exhaustion.set(cid, storage, waittime)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end


Arrumei definitivamente ; configure aqui


local waittime = 1.5 -- Tempo de exhaustion
local storage = 250002

 

mudei, mas... nada

Link para o post
Compartilhar em outros sites
  • Solução
exhaustion = {
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time(t)
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time(t)
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time(t) + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000

function onUse(cid, item, frompos, item2, topos)

local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}

local waittime = 1.5 -- Tempo de exhaustion
local storage = 250002

    if exhaustion.check(cid, storage) then
    doPlayerSendCancel(cid, "You are exhausted")
    return false
    end

      exhaustion.set(cid, storage, waittime)

    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end

 

Link para o post
Compartilhar em outros sites
17 horas atrás, Sttorm disse:

exhaustion = {
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time(t)
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time(t)
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time(t) + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}

local configg = {
    waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825}
    }
local monsters = {
    {'rat'},
    {'rabit'}

}
local numero = 2 -- numero de monstros que você colocou /\
local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000

function onUse(cid, item, frompos, item2, topos)

local config = {
    rateSkill = getConfigValue("rateSkill"),
    allowFromPz = false,
    useWorms = false
}

local waittime = 1.5 -- Tempo de exhaustion
local storage = 250002

    if exhaustion.check(cid, storage) then
    doPlayerSendCancel(cid, "You are exhausted")
    return false
    end

      exhaustion.set(cid, storage, waittime)

    if isInArray(configg.waterIds, item2.itemid) == FALSE then
        return false
    end
    local chance = math.random(1,numero+number) --
    if chance >= 1 and chance <= numero then
    create = monsters[chance][1]
    doSummonCreature(create, getCreaturePosition(cid))
    doSendMagicEffect(topos, 11)
    doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and
        math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
        (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
        doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
        doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    else
    doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
    end
    return true
end

 

Resolvido.

 

Editado por Infused
resolvido (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo