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

Advenced Training System - Problem

MrBAD

Jestem Fajny!
Joined
Jan 3, 2009
Messages
69
Reaction score
0
Location
Poland
Witam, piszę w tym dziale ponieważ nie operuję dobrze angielskim. Liczę na pomoc. Otóż:
Chciałem zainstalować na moim serwerze
http://otland.net/f81/advanced-training-system-anti-bot-protection-8986/

ten skrypt. Korzystam z TFS w wersji 0.2.22. Nie mam tam pliku functions.lua , jednak w temacie tym ludzie piszą że wystarczy zawartość którą powinienem wkleić do functions.lua wkleił do global.lua . Do global.lua lecą więc dwie rzeczy z tego skryptu.
Gdy wkładam je do global.lua nie mogę zalogować się na serwer.

GoD BAD has logged in.
GoD BAD has logged out.

i tak w kółko. Co robię źle? Bardzo proszę o szybką pomoc.
 
Po 1 . Po co ci ten system nie lepiej zwykle salki zrobic.
Po 2 . functions.lua jest w data/lib/functions.lua
Po 3 . Skoro cie nawet nie chce zalowgowac to pewnie cos zle wkleiles.
Po 4. Ale Pierw to spróbuj wgrac to do functios.lua a jak nie zadziala to zrób to powoli i od nowa
 
Slawkens wkleił te funkcje z dwoma niepotrzebnymi enterami we fragmencie funkcji, musisz je usunąć i będzie wszystko działało git.

@up: Gówno wiesz. w 0.2 nie ma /lib.

@edit: To powinno być chyba tak:
PHP:
--training rooms by slawkens
function getNextPosFromDir(fromPos, dir, size)
    local newPos =
    {
        [0]={x=fromPos.x,    y=fromPos.y-size,    z=fromPos.z}, 
        [1]={x=fromPos.x+size,    y=fromPos.y,        z=fromPos.z}, 
        [2]={x=fromPos.x,    y=fromPos.y+size,    z=fromPos.z}, 
        [3]={x=fromPos.x-size,    y=fromPos.y,        z=fromPos.z}
    }
    return newPos[dir]
end

function isPlayerTraining(cid)
    return getPlayerStorageValue(cid, STORAGEVALUE_TRAINING)
end

function getMinExtend(time)
    min = 'minutes'
    if time == 1 then
        min = 'minute'
    end
    return  time..' '..min
end

function doPlayerEndTraining(cid)
    if isPlayerTraining(cid) == TRUE then
        doTeleportThing(cid, TRAIN_EXIT_POS, FALSE)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        if getPlayerStorageValue(cid, STORAGEVALUE_TRAIN_CODE) > 1 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '(TrainMod): You didnt wrote code...')
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '(TrainMod): Its end of your training.')
        end
        setPlayerStorageValue(cid, STORAGEVALUE_TRAINING, 0)
        setPlayerStorageValue(cid, STORAGEVALUE_TRAIN_CODE, 0)

    end
end

function setPlayerTrainCode(cid)
    if isPlayerTraining(cid) == TRUE then
        code = math.random(1000, 9999)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '(TrainMod): If you want still train you need to write !train '.. code ..'. You have 60 seconds to write it.')
        setPlayerStorageValue(cid, STORAGEVALUE_TRAIN_CODE, code)
    end
end

function isItEndOfTraining(cid)
    if getPlayerStorageValue(cid, STORAGEVALUE_TRAIN_CODE) ~= 1 then
        doPlayerEndTraining(cid)
    end
end

function doPlayerExtendTraining(cid)
    addEvent(setPlayerTrainCode, TRAIN_TIME * 1000 * 60, cid)
    addEvent(isItEndOfTraining, (TRAIN_TIME * 1000 * 60) + 60000, cid)
end
 
Back
Top