• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Donate castle system error!

Teppo

New Member
Joined
Jul 18, 2013
Messages
62
Reaction score
2
Hello,

I got the system from here:
http://otland.net/threads/donation-castle-system-automatic.193348/

So, there is a problem like this:

rtgxhe.jpg


I have done everything right, atleast i think so. It was working earlier, but i had a "tp room" for those castles. It was in townid 6.

But, i decided to remove the "tp room" and just make a large area where the castles are, so i just deleted the old houses from town Castles (id 6) and just made new ones in there. Since then tfs is spamming this error all the time, and the castle doll doesn't work. But atleast, ALL the castles are owned by my god character. Does anyone know what might be the problem in here? i'm a beginner, so i don't know what i can do to fix it ( i tried to think, but with no result )


Thank you,
~Teppo
 
Oh, sorry for double post, but here is my castles.lua

PHP:
function onThink()
local castles = db.getResult('SELECT id FROM houses WHERE town=6')
if castles:getID() == -1 then
return true
end

local p = getPlayersOnline()[1]
repeat
local hid = castles:getDataInt('id')
local h = getHouseInfo(hid)
if h.owner == 0 then
setHouseOwner(hid, 6)
elseif p then
local n = tonumber(h.name:sub(-2)) or 0
h.entry.x = h.entry.x + (n % 2 == 0 and 3 or -3)
doCreatureSay(p, getPlayerNameByGUID(h.owner), TALKTYPE_ORANGE_1, false, 0, h.entry)
end
until not castles:next()
castles:free()

return true
end

EDIT: I was thinking, that i had the "tp room" earlier, but deleted it from the map, i had tp's in that 'town id 6 Castles'. So, can it f*ck it up somehow, because i didnt delete that 'town 6 Castles', i just deleted the houses from there and replaced them with the castles i have right now in my map. Should i try to edit the .lua to town id 7, and make new town in rme called Castles and put all houses in there?
 
Last edited:
Back
Top