john290
Banned User
witam!
Gdy uzywam tego skryptu, gdy już ma kogoś wywalić po 15 minutach serwer się crashuje;/ wie ktoś dla czego?
Pozdro
PS tfs 0.3.5
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
PS tfs 0.3.5
Last edited by a moderator: