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

TFS 0.X New player born in Venore with ACC Manager (TFS 0.4)

tiago cysneiros

New Member
Joined
Apr 23, 2017
Messages
23
Reaction score
2
I want to new players born in Rookgaard but they going to Venore.

Config.lua

Code:
accountManager = true
namelockManager = true
newPlayerChooseVoc = false
newPlayerSpawnPosX = 32097
newPlayerSpawnPosY = 32219
newPlayerSpawnPosZ = 7
newPlayerTownId = 6
newPlayerLevel = 1
newPlayerMagicLevel = 1
generateAccountNumber = true

I've changed all this lines to aleatory numbers but they still borning in Venore:

newPlayerSpawnPosX
newPlayerSpawnPosY
newPlayerSpawnPosZ



This is my Player Table at db.sql

Code:
22 town_id int(11)  6
23 posx int(11) 32097
24 posy int(11) 32219
25 posz int(11)  7

the interesting is: When I turn on my server at windows, I haven't this bug. But I've compiled to linux and now I'm having this problem.
 
Open Remers Map editor -> Towns -> Select Town -> Get Town Id

Change this line in config.lua
Lua:
newPlayerTownId = YOUR_TOWN_ID
 
I've already did this
I'd first check if there is some sort of login script that's performing this unwanted action.

Usually it's login.lua, but you may have other scripts.

Look for anything that teleports your character.
Someone might have changed it to teleport to a specific city instead of using the config.

If you can't find anything manually, you could try using this.
This isn't something you want to keep running forever, as it will spam your console mercilessly..

I can't remember where I had gotten it, but it basically prints the (files?) that are being triggered.
It may or may not help. ¯\_(ツ)_/¯


Place it at the bottom of data/lib/000-constant.lua
Lua:
debug.sethook(function()
    local info = debug.getinfo(2)
    if info and info.source and not isInPatternArray(info.source, ignore) then
        if info.source == "=[C]" then
            print(info.name or "=[C]")
        else
            print(info.source)
        end
    end
end, "c")

If you still can't find the code that is doing this..

I'd suggest adding a work-around into login.lua

Your login.lua should look something like this...

DO NOT COPY THIS PART
Lua:
function onLogin(cid)
    .
    .
    .
    local accountManager = getPlayerAccountManager(cid)
    if(accountManager == MANAGER_NONE) then
        local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
        if(lastLogin > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
            str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
            doPlayerPopupFYI(cid, "blah blah 2!")
        else
            str = str .. " Welcome to Titan Kingdoms!"
            doPlayerPopupFYI(cid, "blah blah 1!")
        end
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    elseif(accountManager == MANAGER_NAMELOCK) then
        addEvent(valid(doCreatureSay), 500, cid, "Hello, it appears that your character has been locked for name violating rules, what new name would you like to have?", TALKTYPE_PRIVATE_NP, true, cid)
    elseif(accountManager == MANAGER_ACCOUNT) then
        addEvent(valid(doCreatureSay), 500, cid, "Hello, type {account} to manage your account. If you would like to start over, type {cancel} anywhere.", TALKTYPE_PRIVATE_NP, true, cid)
    else
        addEvent(valid(doCreatureSay), 500, cid, "Hello, type {account} to create an account or {recover} to recover an account.", TALKTYPE_PRIVATE_NP, true, cid)
    end
    .
    .
    .
    return true
end

For the work-around.. after this line in YOUR login.lua..
Lua:
doPlayerPopupFYI(cid, "blah blah 1!")
place this line
Lua:
addEvent(doTeleportThing, 10, cid, getTownTemplePosition(getPlayerTown(cid)))
This will forcibly teleport the player to their town position, after 10 milliseconds, but only on their first login to the server, ever.

Hope that helps,

Xikini
 
Back
Top