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

Function Save House

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Is possible a function that save house?
Example: Player 1 is logged in at 00:00(his house will save 2h, 4h, 6h..)
 
firstly you have to add this function:
http://otland.net/f35/dosavehouse-houseid-145403/

then add this in lib/050-function.lua
LUA:
function valid(f) --function by Mock
	return function(p,...)
		if isCreature(p) then
			return f(p,...)
		end
	end
end
		
function savehouse(cid)
	local playerHouseId = getHouseByPlayerGUID(getPlayerGUID(cid))
	doSaveHouse(playerHouseId) 
end

in login.lua add this :
LUA:
timetomakesave = 2*60*60*1000 --two hours
addEvent(valid(savehouse),timetomake,cid)
 
Back
Top