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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
safe = {
[1] = {46, 42, 67, 62},
}
cursafe = 2
addhook('hit', 'AA_hit')
addhook('movetile', 'AA_movetile')
function AA_hit(id, source)
for i = 1, cursafe do
if AA_check(player(id, 'tilex'), player(id, 'tiley'), safe[i][1], safe[i][2], safe[i][3], safe[i][4]) then
parse('hudtxt2 '..id..' 5 "©000255255SAFE ZONE" 320 200 1')
return 1;
end
end
end
kt = {x1 = {46}, y1 = {42}, x2 = {67}, y2 = {62}}
function zone(x1, y1, x2, y2)
table.insert(kt.x1, x1)
table.insert(kt.x2, x2)
table.insert(kt.y1, y1)
table.insert(kt.y2, y2)
end
--Settings
zone(1,1,1,1) -- Zone coö.
attack_limit = 0
atk_msg = " Don't attack in this zone! "
for i = 1, 32 do
kt[i] = attack_limit
end
function f2(id)
for ix1, x1 in ipairs(kt.x1) do
for iy1, y1 in ipairs(kt.y1) do
for ix2, x2 in ipairs(kt.x2) do
for iy2, y2 in ipairs(kt.y2) do
if ix1 == iy1 and iy1 == ix2 and ix2 == iy2 then
if player(id, "tilex") < x2 and player(id, "tilex") > x1 and player(id, "tiley") > y1 and player(id, "tiley") < y2 then
return true
end
end
end
end
end
end
return false
end
addhook("attack","attack_hook")
function attack_hook(id)
if f2(id) then
msg2(id,string.format(atk_msg, kt[id]..'/'..attack_limit))
if kt[id] <= 0 then
parse("killplayer "..id.."; No shopattacking!")
end
kt[id] = kt[id] - 1
end
end
addhook([[leave]], [[leave_hook]])
function leave_hook(id, r)
kt[id] = attack_limit
end
as={}
And my hud txt is not working