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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
copyright=string.char(169)
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end
rp_license = initArray(32,false)
player_have_pos = initArray(32,false)
collect = initArray(32,0)
tele_x = initArray(32,0)
tele_y = initArray(32,0)
ctlicense = initArray(32,false)
addhook("leave","license_leave")
function license_leave(id)
	rp_license[id]=0
	collect[id]=0
	player_have_pos[id]=false
	tele_x[id]=0
	tele_y[id]=0
	ctlicense[id]=false
end
addhook("serveraction","license_action")
function license_action(id,key)
	if key==2 then
		if rp_license[id]==true then
			menu(id,"License Menu,Set Position,Teleport to Position,Collect Mode")
		else
			msg2(id,"You don't have a license!")
			return 1
		end
	elseif key==3 then
		if ctlicense[id]==true then
			print("Hi from serveraction")
			menu(id,"License System Page 1")
		else
			return 1
		end
	end
end
addhook("menu","license_menu")
function license_menu(id,title,button)
	x = player(id,"tilex")
	y = player(id,"tiley")
	if title=="License Menu" then
		if button==1 then
			tele_x[id] = player(id,"x")
			tele_y[id] = player(id,"y")
			player_have_pos[id]=true
			msg2(id,"You've saved your Position!")
		elseif button==2 and player_have_pos[id]==true then
			local x, y
			x = player( id, "x")
			y = player( id, "y")
			parse("setpos "..id.." "..tele_x[id].." "..tele_y[id])
			parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 20 20 255 192 203')
			msg2(id,"Teleport sucess!")
		elseif button==2 and player_have_pos[id]==false then
			msg2(id,"You can't teleport yourself without position setted!")
		elseif button==3 and collect[id]==0 then
			msg2(id,"Collection OFF")
			collect[id]=1
		elseif button==3 and collect[id]==1 then
			msg2(id,"Collection ON")
			collect[id]=0
		end
	end
end
addhook("buildattempt","rp_build")
function rp_build(id)
	if rp_license[id]==true then
		return 0
	elseif rp_license[id]==false then
		msg2(id,copyright.."255000000You must to be licensed to build!@C")
		return 1
	end
end
addhook("team","licenseteam")
function licenseteam(id,team,look)
	if team == 2 then
		ctlicense[id] = true
		return 0
	else
		return 1
	end
end
function haslicense(id)
	return ctlicense[id]
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
pl_names = initArray(32,"")
function b_names()
for i = 1,32 do
if player(i,"exists") then
pl_names[i]=player(i,"name")
else
pl_names[i]=""
end
end
end
function rp_msg2(id,clr,txt)
msg2(id,copyright..clr..txt)
end
addhook("menu","rp_menu")
function rp_menu(id,menu,sel)
x = player(id,"tilex")
y = player(id,"tiley")
if menu == "License System Page 5" then
if sel == 1 then
gv_ls(id,29,5)
elseif sel == 2 then
gv_ls(id,30,5)
elseif sel == 3 then
gv_ls(id,31,5)
elseif sel == 4 then
gv_ls(id,32,5)
elseif sel == 7 then
ls_4(id)
end
end
if menu == "License System Page 4" then
if sel == 1 then
gv_ls(id,22,4)
elseif sel == 2 then
gv_ls(id,23,4)
elseif sel == 3 then
gv_ls(id,24,4)
elseif sel == 4 then
gv_ls(id,25,4)
elseif sel == 5 then
gv_ls(id,26,4)
elseif sel == 6 then
gv_ls(id,27,4)
elseif sel == 7 then
gv_ls(id,28,4)
elseif sel == 8 then
ls_3(id)
elseif sel == 9 then
ls_5(id)
end
end
if menu == "License System Page 3" then
if sel == 1 then
gv_ls(id,15,3)
elseif sel == 2 then
gv_ls(id,16,3)
elseif sel == 3 then
gv_ls(id,17,3)
elseif sel == 4 then
gv_ls(id,18,3)
elseif sel == 5 then
gv_ls(id,19,3)
elseif sel == 6 then
gv_ls(id,20,3)
elseif sel == 7 then
gv_ls(id,21,3)
elseif sel == 8 then
ls_2(id)
elseif sel == 9 then
ls_4(id)
end
end
if menu == "License System Page 2" then
if sel == 1 then
gv_ls(id,8,2)
elseif sel == 2 then
gv_ls(id,9,2)
elseif sel == 3 then
gv_ls(id,10,2)
elseif sel == 4 then
gv_ls(id,11,2)
elseif sel == 5 then
gv_ls(id,12,2)
elseif sel == 6 then
gv_ls(id,13,2)
elseif sel == 7 then
gv_ls(id,14,2)
elseif sel == 8 then
ls_1(id)
elseif sel == 9 then
ls_3(id)
end
end
if menu == "License System Page 1" then
if sel == 1 then
gv_ls(id,1,1)
elseif sel == 2 then
gv_ls(id,2,1)
elseif sel == 3 then
gv_ls(id,3,1)
elseif sel == 4 then
gv_ls(id,4,1)
elseif sel == 5 then
gv_ls(id,5,1)
elseif sel == 6 then
gv_ls(id,6,1)
elseif sel == 7 then
gv_ls(id,7,1)
function ls_1(id)
b_names()
menu(id,"License System Page 1@b,"..pl_names[1]..","..pl_names[2]..","..pl_names[3]..","..pl_names[4]..","..pl_names[5]..","..pl_names[6]..","..pl_names[7]..",Back,Next")
end
function ls_2(id)
b_names()
menu(id,"License System Page 2@b,"..pl_names[8]..","..pl_names[9]..","..pl_names[10]..","..pl_names[11]..","..pl_names[12]..","..pl_names[13]..","..pl_names[14]..",Back,Next")
end
function ls_3(id)
b_names()
menu(id,"License System Page 3@b,"..pl_names[15]..","..pl_names[16]..","..pl_names[17]..","..pl_names[18]..","..pl_names[19]..","..pl_names[20]..","..pl_names[21]..",Back,Next")
end
function ls_4(id)
b_names()
menu(id,"License System Page 4@b,"..pl_names[22]..","..pl_names[23]..","..pl_names[24]..","..pl_names[25]..","..pl_names[26]..","..pl_names[27]..","..pl_names[28]..",Back,Next")
end
function ls_5(id)
b_names()
menu(id,"License System Page 5@b,"..pl_names[29]..","..pl_names[30]..","..pl_names[31]..","..pl_names[32]..",,,,Back")
end
function gv_ls(id,pl,page)
if rp_license[pl]==true then
rp_license[pl]=false
rp_msg2(pl,"255000000",player(id,"name").." Remove your license!")
rp_msg2(id,"255000000","You Remove license to "..player(pl,"name").."!")
else
rp_license[pl]=true
rp_msg2(pl,"000255000",player(id,"name").." Gave you license!")
rp_msg2(id,"000255000","You gave license to "..player(pl,"name").."!")
end
if page == 1 then
ls_1(id)
elseif page == 2 then
ls_2(id)
elseif page == 3 then
ls_3(id)
elseif page == 4 then
ls_4(id)
elseif page == 5 then
ls_5(id)
end
end
end
end
end