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

How to send all items in all houses to their owners?

Grinch

www.loronia.se
Joined
Oct 19, 2007
Messages
217
Reaction score
0
Location
Sweden/Värnamo
Got a question. I need to clean all houses on my server. But i want the items to come to the houseowners dp's. Anyone knows how to do it?
 
--Adam 2008

--Goosio OT

local safelist = {1,2,6,9,10,11}

function onSay(cid, words, param)
if getPlayerGroupId(cid) > 2 then
pdelete = "Inactive Players With Houses:\n\n"
days = 10*3600*24
t=os.date('*t')
local house = db.getResult("SELECT `owner`,`id` FROM `houses`")
if(house:getID() ~= -1) then
while (true) do
local owner = house:getDataInt("owner")
local hid = house:getDataInt("id")
local player = db.getResult("SELECT `id`,`name`,`lastlogin` FROM `players` WHERE `id` = '"..owner.."' ")
if(player:getID() ~= -1) then
local lastlogin = player:getDataInt("lastlogin")
local pid = player:getDataInt("id")
local name = player:getDataString("name")
time=os.time(t) - lastlogin
offline = time - days
if offline >= 0 then
pdelete = pdelete.."House #"..hid.." owned by "..name.."\n"
if isInArray(safelist,hid) == FALSE then
setHouseOwner(hid, 0)
end
end
player:free()
end
if not(house:next()) then
break
end
end

house:free()
doShowTextDialog(cid, 5958, pdelete)
else
doPlayerSendCancel(cid, "Error.")
end
end
return TRUE
end

Use this, it will automatically clean houses where player is not online for 10 days and more and send items to players dp. If you want to clean all houses then you can just easly edit this script.
 
last time i checked when u wrote /owner none all items/house got reseted on it's normal state. If you dont mean tfs 0.3 then i dont got anything to say.
 
Back
Top