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

Training Moderator Bug [Help]

Northnorial

Member
Joined
May 30, 2009
Messages
742
Reaction score
5
Location
Germany
I'm getting this error message,
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+
 
Back
Top