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

Problem with saving chars coordinates.

kapax88

New Member
Joined
Jan 5, 2010
Messages
1
Reaction score
0
I have few problems with tfs(crying damnson) 3.6.0 pl1 when I logout with char the server isn't saving it's logout position. After loging back on the char it respawns in the temple. Second problem few types of the doors to houses isn't seen as the house doors. I would be gratefull if someone could help with those listed problems.
 
Haha, same error as me but it doesn't bother me :)
i only use my server to test atm.

But it would be great to have someone post solution.
 
Maybe something like this?
Lua:
function onLogout(cid)
	db.executeQuery("UPDATE `players` SET `posx` = ".. getCreaturePosition(cid).x ..", `posy` = ".. getCreaturePosition(cid).y ..", `posz` ".. getCreaturePosition(cid).z .." WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1;")
return true
end

or if that doesn't work...

Lua:
function onLogout(cid)
	db.executeQuery("UPDATE `players` SET `posx` = ".. getCreaturePosition(cid).x .." WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1;")
	db.executeQuery("UPDATE `players` SET `posy` = ".. getCreaturePosition(cid).y .." WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1;")
	db.executeQuery("UPDATE `players` SET `posz` = ".. getCreaturePosition(cid).z .." WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1;")
return true
end
 
Sorry for necro bump, but i've this problem and this was the more close result that the search show me.

The problem is the coord, when player logout his coord don't update and when login again his respawn in temple, anyway to fix?

the Niskafase show error both in console but if update anyway to fix his script so it can solve my problem xD

PS; And yes a distro based in TFS using SQLite.

Niskafe's script bug:
[4/7/2011 8:51:4] Test Sorc has logged in.
[4/7/2011 8:51:8] OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "LIMIT": syntax error (UPDATE "players" SET "posx" = 1025 WHERE "id" = 8 LIMIT 1;)
[4/7/2011 8:51:8] OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "LIMIT": syntax error (UPDATE "players" SET "posy" = 1060 WHERE "id" = 8 LIMIT 1;)
[4/7/2011 8:51:8] OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "LIMIT": syntax error (UPDATE "players" SET "posz" = 7 WHERE "id" = 8 LIMIT 1;)
[4/7/2011 8:51:8] Test Sorc has logged out.
 
Back
Top