Discovery
Developing myself
Hello everyone!
I have a doubt about the function inRange. I tried now put a limit in the party area based in leader, but I fail.
The idea is adapt to the player counts +1 in the task if him there in this specific range.
How I can use the range based in the party leader?
This is my code now:
Anyone can help me update this code with X area range limit?
Thanks in advance!

I have a doubt about the function inRange. I tried now put a limit in the party area based in leader, but I fail.
The idea is adapt to the player counts +1 in the task if him there in this specific range.
How I can use the range based in the party leader?
This is my code now:
Code:
domodlib('task_func')
function onKill(cid, target, lastHit)
if(isMonster(target) == true) then
local n = string.lower(getCreatureName(target))
for race, mob in pairs(tasktabble) do
if getPlayerParty(cid) then
membersList = getPartyMembers(cid)
if membersList ~= FALSE then
for i, _cid in pairs(membersList) do
if getPlayerStorageValue(_cid,mob .storage_start) >= 1 then
for i = 1,#mob.monster_race do
if n == mob.monster_race[i] then
local contagem = getPlayerStorageValue(_cid, mob.storage)
if (contagem == -1) then contagem = 1 end
if not tonumber(contagem) then return true end
if contagem > mob.count then return true end
if contagem > mob.count then return true end
setPlayerStorageValue(_cid, mob.storage, contagem+1)
doPlayerSendTextMessage(_cid, MESSAGE_STATUS_CONSOLE_ORANGE,""..(contagem == mob.count and "Congratulations! You finished the task of "..race.."." or "defeated. Total [" .. contagem .. "/" .. mob.count .. "] " .. race .. ".").."")
end
end
end
end
end
else
if getPlayerStorageValue(cid,mob .storage_start) >= 1 then
for i = 1,#mob.monster_race do
if n == mob.monster_race[i] then
local contagem = getPlayerStorageValue(cid, mob.storage)
if (contagem == -1) then contagem = 1 end
if not tonumber(contagem) then return true end
if contagem > mob.count then return true end
if contagem > mob.count then return true end
setPlayerStorageValue(cid, mob.storage, contagem+1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,""..(contagem == mob.count and "Congratulations! You finished the task of "..race.."." or "defeated. Total [" .. contagem .. "/" .. mob.count .. "] " .. race .. ".").."")
end
end
end
end
end
end
return true
end
Anyone can help me update this code with X area range limit?
Thanks in advance!