• 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!

TFS 0.X [MoveEvent] In a timer event called from:

lSenturion2

Active Member
Joined
Oct 2, 2019
Messages
124
Reaction score
29
Hello guys!
I have a problem with my onStepIn script. It works perfectly but I want to fix something...
when the player disconnects or dies, the script spamms the console and causes a lag disaster or freeze, I have a serious headache wanting to repair it. I want when the player dies or disconnects, the script stop.
this is my script
Code:
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) then
                addEvent(function(cid, item, position, fromPosition)
    doPlayerSendCancel(cid," [ GAME Time left: 180 ]")
    end, 100)
    
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 179 ]")
    end, 2100)
    
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 178 ]")
    end, 3100)
    
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 177 ]")
    end, 4100)
    
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 176 ]")
    end, 5100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 175 ]")
    end, 6100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 174 ]")
    end, 7100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 173 ]")
    end, 8100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 172 ]")
    end, 9100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 171 ]")
    end, 10100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 170 ]")
    end, 11100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 169 ]")
    end, 12100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 168 ]")
    end, 13100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 167 ]")
    end, 14100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 166 ]")
    end, 15100)
                    addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 165 ]")
    end, 16100)
    
                        addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 164 ]")
    end, 17100)
                        addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 163 ]")
    end, 18100)
                        addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 162 ]")
    end, 19100)
                        addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 161 ]")
    end, 20100)
                        addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 160 ]")
    end, 21100)
                        addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 159 ]")
    end, 22100)
                        addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 158 ]")
    end, 23100)
                            addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 157 ]")
    end, 24100)
                            addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 156 ]")
    end, 25100)
                            addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 155 ]")
    end, 26100)
                            addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 154 ]")
    end, 27100)
                            addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 153 ]")
    end, 28100)
                            addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 152 ]")
    end, 29100)
                            addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 151 ]")
    end, 30100)
                            addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 150 ]")
    end, 31100)
                                addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 149 ]")
    end, 32100)
                                addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 148 ]")
    end, 33100)
                                addEvent(function()
    doPlayerSendCancel(cid," [ GAME Time left: 147 ]")
    end, 34100)


    end
end

This is the spammed console image:
luz.png
 
Back
Top