• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Skrypt crashuje serwer

john290

Banned User
Joined
May 22, 2008
Messages
291
Reaction score
0
Location
Podkarpacie, Krosno
witam!

Gdy uzywam tego skryptu, gdy już ma kogoś wywalić po 15 minutach serwer się crashuje;/ wie ktoś dla czego?
Code:
  local config = {
        new_Pos = {x=925, y=1002, z=7}, -- Players New Position (After teleported)
        storage = 17435, -- Players Storage
        timeToRemove = 15, -- MINUTES
        timeToResolve = 60 -- SECONDS
}

local event = 0

function onStepIn(cid, item, frompos, item2, topos)
        local playerPos = getCreaturePosition(cid)

        if(playerPos ~= config.new_Pos) then
                doPlayerPopupFYI(cid, "Training Moderator: \n \nYou now have [".. config.timeToRemove .." minutes] to train without disturbance. \nYou are noted that botting is illegal.")
                setPlayerStorageValue(cid, config.storage, 1)
                event = addEvent(_doTeleportThing, config.timeToRemove * 60000, cid)
        end
end

function onStepOut(cid, item, frompos, item2, topos)
        if(playerPos ~= config.new_Pos) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your training session has ended.")
                setPlayerStorageValue(cid, config.storage, -1)
                stopEvent(event)
        end
end

local event2 = 0

function _doTeleportThing(cid)
        if(getPlayerStorageValue(cid, config.storage) == 1) then
                doPlayerPopupFYI(cid, "Training Moderator: \n \nStep [OFF and ON] the tile to continue training. \nYou have [".. config.timeToResolve .." seconds] to complete this request.")
                event2 = addEvent(expireTime, config.timeToResolve * 1000, cid)
        end
end

function expireTime(cid)
        if(isPlayer(cid) == TRUE) then
                setPlayerStorageValue(cid, config.storage, -1)
                doPlayerPopupFYI(cid, "Training Moderator: \n \nYou did not comply with the request. \nTherefor you were teleported.")
                doTeleportThing(cid, config.new_Pos)
                stopEvent(event2)
        end
end
Pozdro

PS tfs 0.3.5
 
Last edited by a moderator:
Back
Top