• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua stopEvent Help

A

Alw

Guest
Okay so my problem is that the event (cleanWholeArea) dosn't get stopped. Could anyone tell me how to fix this?

Code:
    local Tasks = {
        [1] = {
            BossName = "The Old Widow",

        },
        [2] = {
            BossName = "Hellspawn",       
        },
    }
function onStepIn(cid, item, position, fromPosition)
local tppos = {x=1571,y=557,z=8}
local outpos = {x=1578,y=553,z=7}
local bossspawn = {x=1584,y=561,z=8}

local postop = {x=1564,y=549,z=8}
local posbot = {x=1591,y=568,z=8}
if (item.uid == 6501) then
    if(taskBoss(cid)) then
        if(getKillCount(cid) < 1) then   
            if(checkArean(postop, posbot) == false) then
                cleanWholeArea(postop, posbot)
                doTeleportThing(cid, tppos)
                doSendMagicEffect(tppos, 38)
                doForceSummonCreature(Tasks[getPlayerTask(cid)].BossName, bossspawn)
                Player(cid):say("You have 10 minutes to slay "..Tasks[getPlayerTask(cid)].BossName..". Otherwise you will be teleported out." , TALKTYPE_MONSTER_SAY)
                Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "You can always escape through the teleport and try again.")
               
                addEvent(cleanWholeArea, 60*1000, postop, posbot)   
            else
                doTeleportThing(cid, fromPosition, true)
                Player(cid):say("Someone is already fighting a boss.", TALKTYPE_MONSTER_SAY)
                Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "Someone is already fighting a boss, please be patient.")
                doSendMagicEffect(fromPosition, 3)       
            end       
        else
               
            doTeleportThing(cid, fromPosition, true)
            Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "You already killed "..Tasks[getPlayerTask(cid)].BossName..". Report back to name.")
            doSendMagicEffect(fromPosition, 3)   
        end   
    else
        doTeleportThing(cid, fromPosition, true)
        Player(cid):say("You have to finish a task first.", TALKTYPE_MONSTER_SAY)
        Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "To get a task visit name.. and ask him for a task.")
        doSendMagicEffect(fromPosition, 3)   
    end   
elseif (item.uid == 6502) then   
if(getKillCount(cid) > 0) then
    Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "Report your progress to the npc.")
else
    Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "Pussy.")
end
    doTeleportThing(cid, outpos)
    cleanWholeArea(postop, posbot)   
    doSendMagicEffect(outpos, 38)
    stopEvent(addEvent(cleanWholeArea, 60*1000, postop, posbot))
end       
    return true
end
 
Okay so my problem is that the event (cleanWholeArea) dosn't get stopped. Could anyone tell me how to fix this?

Code:
    local Tasks = {
        [1] = {
            BossName = "The Old Widow",

        },
        [2] = {
            BossName = "Hellspawn",      
        },
    }
function onStepIn(cid, item, position, fromPosition)
local tppos = {x=1571,y=557,z=8}
local outpos = {x=1578,y=553,z=7}
local bossspawn = {x=1584,y=561,z=8}

local postop = {x=1564,y=549,z=8}
local posbot = {x=1591,y=568,z=8}
if (item.uid == 6501) then
    if(taskBoss(cid)) then
        if(getKillCount(cid) < 1) then  
            if(checkArean(postop, posbot) == false) then
                cleanWholeArea(postop, posbot)
                doTeleportThing(cid, tppos)
                doSendMagicEffect(tppos, 38)
                doForceSummonCreature(Tasks[getPlayerTask(cid)].BossName, bossspawn)
                Player(cid):say("You have 10 minutes to slay "..Tasks[getPlayerTask(cid)].BossName..". Otherwise you will be teleported out." , TALKTYPE_MONSTER_SAY)
                Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "You can always escape through the teleport and try again.")
              
                addEvent(cleanWholeArea, 60*1000, postop, posbot)  
            else
                doTeleportThing(cid, fromPosition, true)
                Player(cid):say("Someone is already fighting a boss.", TALKTYPE_MONSTER_SAY)
                Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "Someone is already fighting a boss, please be patient.")
                doSendMagicEffect(fromPosition, 3)      
            end      
        else
              
            doTeleportThing(cid, fromPosition, true)
            Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "You already killed "..Tasks[getPlayerTask(cid)].BossName..". Report back to name.")
            doSendMagicEffect(fromPosition, 3)  
        end  
    else
        doTeleportThing(cid, fromPosition, true)
        Player(cid):say("You have to finish a task first.", TALKTYPE_MONSTER_SAY)
        Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "To get a task visit name.. and ask him for a task.")
        doSendMagicEffect(fromPosition, 3)  
    end  
elseif (item.uid == 6502) then  
if(getKillCount(cid) > 0) then
    Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "Report your progress to the npc.")
else
    Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "Pussy.")
end
    doTeleportThing(cid, outpos)
    cleanWholeArea(postop, posbot)  
    doSendMagicEffect(outpos, 38)
    stopEvent(addEvent(cleanWholeArea, 60*1000, postop, posbot))
end      
    return true
end

change this
Code:
stopEvent(addEvent(cleanWholeArea, 60*1000, postop, posbot))
to
Code:
stopEvent(cleanWholeArea, 60*1000, postop, posbot
 
Back
Top