1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function btp(id,sx,sy,ex,ey,mode)
local prp
if mode==1 then prp="" elseif mode==2 then prp="tile" end
return (player(id,"exists") and player(id,prp.."x")>sx and player(id,prp.."x")<ex and player(id,prp.."y")>sy and player(id,prp.."y")<ey)
end
dofile("sys/lua/configs.lua")
function initArray(m)
local array = {}
for i = 1, m do
array[i] = 0
end
return array
end
oldx=initArray(32)
oldy=initArray(32)
timer=initArray(32)
for i=1,#house do
house[i].var=initArray(32)
end
addhook("minute","addtime")
function addtime()
for i=1,#house do
if not house[i].owner==nil then
timer[i]=timer[i]+1
end
if timer[i]==1440 then
house[i].owner=nil
end
end
end
addhook("move","housecheck")
function housecheck(id,x,y,mode)
for i=1,#house do
if btp(x1,y1,x2,y2,2) then
if not house[i].owner==player(id,"usgn") then
msg2(id,"Its not your house!")
parse("setpos "..id.." "..oldx.." "..oldy)
end
else
oldx=x
oldy=y
end
end
end