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

Lua Login wrong temple position (rela tibia map)

artofwork

Well-Known Member
Joined
Dec 3, 2008
Messages
420
Reaction score
61
I have changed all of the the towns temple positions to thais
s temple position, including the account managers xyz coordinates and set the xyz in the config file i still get the same error. -wrong temple position please contact administrator-

I'm running tfs 0.3b3 and the real tibia map i made an mysql query to help solve the player temple problem, when the player logs out their temple position is set to null. This is a temporary solution but won't last forever.

Maybe someone here can help solve this little problem or atleast give me a heads up.

This code here works but its not a solution just sorta like a bandaid.

here is what im working with:
this script is located in \data\creaturescripts\scripts\login.lua
PHP:
local mposx = getConfigInfo('newPlayerSpawnPosX')
local mposy = getConfigInfo('newPlayerSpawnPosY')
local mposz = getConfigInfo('newPlayerSpawnPosZ')
local mtid = getConfigInfo('newPlayerTownId')

function onLogin(cid, pos)
local text = ", welcome to Malacalypse!"

db.executeQuery("SELECT `id` , `posx` , `posy` , `posz` `town_id` FROM `players` WHERE id >0 AND posx=0 AND posy=0 AND posz=0 AND town_id=0;")
db.executeQuery("UPDATE players SET posx="..mposx..", posy="..mposy..", posz="..mposz..", town_id="..mtid.." WHERE id>0 AND posx=0 AND posy=0 AND posz=0 AND town_id=0;")


  if getPlayerStorageValue(cid, 50002) == -1 then
        doPlayerPopupFYI(cid, "Hello "..getPlayerName(cid)..text)
                setPlayerStorageValue(cid, 50002, 1)
				end
				
	registerCreatureEvent(cid, "PlayerDeath")
	return TRUE
end
 
They actually need to login before the onLogin function is executed, what you should do though is to check what town id most players has (most likely it will be set to 1), then create a new town in your mapeditor somewhere (preferably in Thais) which has ID 1.

If you are not able to set the ID manually in the town settings (in the mapeditor obviously), I'd recommend you to remove all towns and redo them.
 
They actually need to login before the onLogin function is executed, what you should do though is to check what town id most players has (most likely it will be set to 1), then create a new town in your mapeditor somewhere (preferably in Thais) which has ID 1.

If you are not able to set the ID manually in the town settings (in the mapeditor obviously), I'd recommend you to remove all towns and redo them.

Since this script will work even if the account manager logs in it will reset any players with a null xyz or town position, the town position isn't a manditory thing atm especially since all the temple coordinates for all the citys are set to one location.

I tried adding these queries to the playerdeath.lua, but it never executes, I have racked my brain enough trying to solve this.

Thanks for the advice but I think have covered that type of solution already, its not a source issue since I've used this server on other maps.

BTW I am the one who created all the cities and the houses, no ty i will not start over
 
Last edited:
I was late for school so forgot to tell you my second, and probably the easiest way of solving this. Run this query through your phpMyAdmin.
PHP:
UPDATE `players` SET `town_id` = 1
That would update every town_id to 1.
 
Back
Top