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

Clean House

Sir Gabriiel

New Member
Joined
Mar 24, 2012
Messages
88
Reaction score
2
UPDATE

I want a script like this:
> Will clean houses of inactive players every time your server starts and move their items to their depots.
> I want you to NOT clean the Guildhall.
> I use MySql ...

Clean every 14 days
 
Last edited:
Create talkactions\scripts\cleanHouses.lua: and add:
PHP:
-- clean all houses except guildhouses 
-- Created by fec/layflette/3dzio/shtako

function onSay(cid, words, param)
	local GOD_ACCESS = 6 -- change to your god access
	if getPlayerAccess(cid) < GOD_ACCESS then
		return FALSE
	end
	local count = 0
	local houses_list = db.getResult("SELECT `id` FROM `houses` WHERE `guild` = 0")
	if houses_list:getID() ~= -1 then
		while true do
			local houseid = houses_list:getDataInt('id')
			 if doCleanHouse(houseid) then
				count = count + 1
			 else
				 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Cannot clean house with id = ' .. houseid)
			 end
			 if not houses_list:next() then break end
		end
	end
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Total cleaned: ' .. count)
	doSaveServer() -- if server will lag a lot, delete this line and save in-game.?
return TRUE
end

In talkactions.xml add:
PHP:
<talkaction words="!cleanHouses" script="cleanHouses.lua"/>
So, this script will clear all your houses in serv except guildhouses.

So you need "houses" table in your MySQL tables. Script not tested !
 
Last edited:
UPDATE

I want a script like this:
> Will clean houses of inactive players every time your server starts and move their items to their depots.
> I want you to NOT clean the Guildhall.
> I use MySql ...

Clean every 14 days
 
Last edited:
BUMP!
UPDATE

I want a script like this:
> Will clean houses of inactive players every time your server starts and move their items to their depots.
> I want you to NOT clean the Guildhall.
> I use MySql ...

Clean every 14 days
 
Last edited:
Back
Top