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
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
license = initArray(32)
posy = initArray(32)
posx = initArray(32)
collect = initArray(32)
addhook("leave","license_leave")
function license_leave(id)
license[id]=0
collect[id]=0
posy[id]=0
posx[id]=0
end
addhook("serveraction","license_action")
function license_action(id,b)
if license[id]==1 and b==1 then
menu(id,"License Menu,Set Pos,Teleport,Collect")
elseif license[id]==0 and b==1 then
msg2(id,"You dont have license")
end
end
addhook("menu","license_menu")
function license_menu(id,title,button)
	if title=="License Menu" then
		if button==1 then
			posx[id]=player(id,"x")
			posy[id]=player(id,"y")
			msg2(id,"Youve saved ur positon")
		elseif button==2 and posy[id]==0 and posx[id]==0 then
			msg2(id,"You cant teleport your self, No position setted")
		else
			parse ("setpos "..id.." "..posx[id].." "..posy[id])
			msg2(id,"Youve teleported your self") end
		elseif button==3 and collect[id]==0 then
			msg2(id,"Collection ON")
			collect[id]=1
		elseif button==3 and collect[id]==1 then
			msg2(id,"Collection OFF")
			collect[id]=0
		end
	end
addhook("walkover","license_collect")
function license_collect(id)
	if collect[id]==1 then
		return 1
	elseif collect[id]==0 then
		return 0
	end
end