Northnorial
Member
I'm getting this error message,
when I use this script for my training moderator
I'm using TFS 0.3.5 ..
Need help, fast, thanks
rep+
Code:
[30/11/2009 13:58:09] Lua Script Error: [MoveEvents Interface]
[30/11/2009 13:58:09] in a timer event called from:
[30/11/2009 13:58:09] data/movements/scripts/training tile.lua:onStepIn
[30/11/2009 13:58:09] luaGetPlayerStorageValue(). Player not found
when I use this script for my training moderator
PHP:
local config = {
storage = 12345, -- storage
timeToRemoveMin = 8, -- minutes min
timeToRemoveMax = 15, -- minutes max
timeToResolve = 60 -- seconds
}
local event = 0
local event2 = 0
function onStepIn(cid, item, frompos, item2, topos)
timeToRemove = math.random(config.timeToRemoveMin, config.timeToRemoveMax)
doPlayerPopupFYI(cid, "Training moderator:\n\nYou now have ".. timeToRemove .." minutes to train without disturbance.\n\nYou are noted that botting is illegal.")
setPlayerStorageValue(cid, config.storage, 1)
event = addEvent(_doTeleportThing, timeToRemove * 60000, cid)
end
function onStepOut(cid, item, frompos, item2, topos)
if(getPlayerStorageValue(cid, config.storage) == 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your training session has ended.")
setPlayerStorageValue(cid, config.storage, -1)
stopEvent(event)
stopEvent(event2)
end
end
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)
doTeleportThing(cid, getClosestFreeTile(cid, getTownTemplePosition(getPlayerTown(cid))))
doRemoveCreature(cid)
end
end
I'm using TFS 0.3.5 ..
Need help, fast, thanks
rep+