Like I said I want to make that Build Helper only administrators can use, I tried this code is giving more errors. And you wonder: What's wrong? What was supposed to build behind you is building on top. Can anyone help me? Pardon my mistakes, I am using translator. Let the script code.
More 

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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
-------------------------------------- --		Build Helper		-- --		By Vectar666		-- -- Traduzido por CUBE(ISAC MERLO) -- -------------------------------------- --presetup admins = {45777,49248} function initArray(m) 	local array = {} 	for i = 1, m do 		array[i]=0 	end 	return array end function contains(table, element) for _, value in pairs(table) do if value == element then return true end end return false end vbh_px=initArray(32) vbh_py=initArray(32) vbh_mode=initArray(32) vbh_mode2=initArray(32) vbh_mode3=initArray(32) vbh_mode4=initArray(32) --hooks addhook("say","vbh_say") addhook("movetile","vbh_movetile") addhook("spawn","vbh_spawn") addhook("parse","vbh_con") --funcao do contains function contains(table, element) for _, value in pairs(table) do if value == element then return true end end return false end --funcs function toTable(t,match) 	for id=1,32 do 		if (contains(admins,player(id,"usgn"))) then local cmd = {} if not match then match = "[^%s]+" else match = "[^"..match.."]+" end for word in string.gmatch(t, match) do table.insert(cmd, word) end return cmd end function vbh_con(text) 	if(text=="construcao_destruir_ct") then 		ii=object(0,"table") 		for i=1,#ii do 			if(player(object(i,"player"),"team")==2) then parse("killobject "..i) end 		end 		print("Construcoes de CT destruidas") 		return 1 	elseif(text=="construcao_destruir_t") then 		ii=object(0,"table") 		for i=1,#ii do 			if(player(object(i,"player"),"team")==1) then parse("killobject "..i) end 		end 		print("Construcoes de TR destruidas") 		return 1 	elseif(text=="construcao_destruir_neutros") then 		ii=object(0,"table") 		for i=1,#ii do 			if(object(i,"player")==0) then parse("killobject "..i) end 		end 		print("Edificios destruidos Neutro") 		return 1 	elseif(text=="construcao_destruir_todos") then 		ii=object(0,"table") 		for i=1,#ii do 			parse("killobject "..i) 		end 		print("Todos os edificios destruidos") 		return 1 	end 	iii=toTable(text) 	if(iii[1]=="construcao_destruir_player") then 		ii=object(0,"table") 		for i=1,#ii do 			if(object(i,"player")==tonumber(iii[2])) then parse("killobject "..i) end 		end 		return 1 	end end function vbh_say(id,message) --Wall 1 	if (message=="-c w1") then 		vbh_mode[id]=3 		msg2(id,"Foi construido a Wall 1 Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Wall 2 	elseif (message=="-c w2") then 		vbh_mode[id]=4 		msg2(id,"Foi construido a Wall 2 Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Wall 3 	elseif (message=="-c w3") then 		vbh_mode[id]=5 		msg2(id,"Foi construido a Wall 3 Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Barricade 	elseif (message=="-c b") then 		vbh_mode[id]=1 		msg2(id,"Foi construido a Barricada Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Barbed Wire 	elseif (message=="-c a") then 		vbh_mode[id]=2 		msg2(id,"Foi construido o Arame Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Turret 	elseif (message=="-c t1") then 		vbh_mode[id]=8 		msg2(id,"Foi construido o Turret 1 Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Double Turret 	elseif (message=="-c t2") then 		vbh_mode[id]=11 		msg2(id,"Foi construido o Turret 2 Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Triple Turret 	elseif (message=="-c t3") then 		vbh_mode[id]=12 		msg2(id,"Foi construido o Turret 3 Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Gate Field 	elseif (message=="-c gf") then 		vbh_mode[id]=6 		msg2(id,"Foi construido o Gate Field Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Supply 	elseif (message=="-c s") then 		vbh_mode[id]=9 		msg2(id,"Foi construido o Supply Digite:-p para parar de construir -dt para destruir todos") 		return 1 --DispenSer 	elseif (message=="-c d") then 		vbh_mode[id]=7 		msg2(id,"Foi construido o Dispenser Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Super Supply 	elseif (message=="-c ss") then 		vbh_mode[id]=15 		msg2(id,"Foi construido o Super Supply Digite:-p para parar de construir -dt para destruir todos") 		return 1 --Super Supply Neutro 	elseif (message=="-c ss n") then 		vbh_mode2[id]=15 		msg2(id,"Foi construido o Super Supply Neutro Digite:-p n para parar de construir -dt para destruir todos") 		return 1 --Turret 3 Neutro 	elseif (message=="-c t3 n") then 		vbh_mode2[id]=12 		msg2(id,"Foi construido o Turret 3 Neutro Digite:-p n para parar de construir -dt para destruir todos") 		return 1 --Turret 2 Neutro 	elseif (message=="-c t2 n") then 		vbh_mode2[id]=11 		msg2(id,"Foi construido o Turret 3 Neutro Digite:-p n para parar de construir -dt para destruir todos") 		return 1 --Turret 1 Neutro 	elseif (message=="-c t1 n") then 		vbh_mode2[id]=8 		msg2(id,"Foi construido o Turret 3 Neutro Digite:-p n para parar de construir -dt para destruir todos") 		return 1 --Gate Field Neutro 	elseif (message=="-c gf n") then 		vbh_mode2[id]=6 		msg2(id,"Foi construido o Gate Field Neutro Digite:-p n para parar de construir -dt para destruir todos") 		return 1 --Supply Neutro 	elseif (message=="-c s n") then 		vbh_mode2[id]=9 		msg2(id,"Foi construido o Supply Neutro Digite:-p n para parar de construir -dt para destruir todos") 		return 1 --DispenSer Neutro 	elseif (message=="-c d n") then 		vbh_mode2[id]=7 		msg2(id,"Foi construido o Dispenser Neutro Digite:-p n para parar de construir -dt para destruir todos") 		return 1 --Stop building 	elseif (message=="-p") then 		vbh_mode[id]=0 		msg2(id,"Nao esta mais construindo.") 		return 1 --Stop building Neutros 	elseif (message=="-p n") then 		vbh_mode2[id]=0 		msg2(id,"Nao esta mais construindo Neutros.") 		return 1 --Stop building CT 	elseif (message=="-p ct") then 		vbh_mode3[id]=0 		msg2(id,"Nao esta mais construindo construcoes de CT.") 		return 1 --Stop building TR 	elseif (message=="-p tr") then 		vbh_mode4[id]=0 		msg2(id,"Nao esta mais construindo construcoes de TR.") 		return 1 --Turret tr 	elseif (message=="-c t1 tr") then 		vbh_mode4[id]=8 		msg2(id,"Foi construido o Turret 1 Digite:-p tr para parar de construir -dt para destruir todos") 		return 1 --Double Turret tr 	elseif (message=="-c t2 tr") then 		vbh_mode4[id]=11 		msg2(id,"Foi construido o Turret 2 Digite:-p tr para parar de construir -dt para destruir todos") 		return 1 --Triple Turret tr 	elseif (message=="-c t3 tr") then 		vbh_mode4[id]=12 		msg2(id,"Foi construido o Turret 3 Digite:-p tr para parar de construir -dt para destruir todos") 		return 1 --Gate Field tr 	elseif (message=="-c gf tr") then 		vbh_mode4[id]=6 		msg2(id,"Foi construido o Gate Field Digite:-p tr para parar de construir -dt para destruir todos") 		return 1 --Supply tr 	elseif (message=="-c s tr") then 		vbh_mode4[id]=9 		msg2(id,"Foi construido o Supply Digite:-p tr para parar de construir -dt para destruir todos") 		return 1 --DispenSer tr 	elseif (message=="-c d tr") then 		vbh_mode4[id]=7 		msg2(id,"Foi construido o Dispenser Digite:-p tr para parar de construir -dt para destruir todos") 		return 1 --Super Supply tr 	elseif (message=="-c ss tr") then 		vbh_mode4[id]=15 		msg2(id,"Foi construido o Super Supply Digite:-p tr para parar de construir -dt para destruir todos") 		return 1 --Turret ct 	elseif (message=="-c t1 ct") then 		vbh_mode3[id]=8 		msg2(id,"Foi construido o Turret 1 Digite:-p ct para parar de construir -dt para destruir todos") 		return 1 --Double Turret ct 	elseif (message=="-c t2 ct") then 		vbh_mode3[id]=11 		msg2(id,"Foi construido o Turret 2 Digite:-p ct para parar de construir -dt para destruir todos") 		return 1 --Triple Turret ct 	elseif (message=="-c t3 ct") then 		vbh_mode3[id]=12 		msg2(id,"Foi construido o Turret 3 Digite:-p ct para parar de construir -dt para destruir todos") 		return 1 --Gate Field ct 	elseif (message=="-c gf ct") then 		vbh_mode3[id]=6 		msg2(id,"Foi construido o Gate Field Digite:-p ct para parar de construir -dt para destruir todos") 		return 1 --Supply ct 	elseif (message=="-c s ct") then 		vbh_mode3[id]=9 		msg2(id,"Foi construido o Supply Digite:-p ct para parar de construir -dt para destruir todos") 		return 1 --DispenSer ct 	elseif (message=="-c d ct") then 		vbh_mode3[id]=7 		msg2(id,"Foi construido o Dispenser Digite:-p ct para parar de construir -dt para destruir todos") 		return 1 --Super Supply ct 	elseif (message=="-c ss ct") then 		vbh_mode3[id]=15 		msg2(id,"Foi construido o Super Supply Digite:-p ct para parar de construir -dt para destruir todos") 		return 1 --DESTROY!!! 	elseif (message=="-dt") then 		ii=object(0,"table") 		for i=1,#ii do 			if(object(i,"player")==id) then parse("killobject "..i) end 		end 		msg2(id,"Seus edificios foram destruidos") 		return 1 	end end function vbh_movetile(id,x,y) 	if(vbh_mode[id]>0) then 		parse("spawnobject "..vbh_mode[id].." "..vbh_px[id].." "..vbh_py[id].." 0 1 "..player(id,"team").." "..id) 	elseif(vbh_mode2[id]>0) then 		parse("spawnobject "..vbh_mode2[id].." "..vbh_px[id].." "..vbh_py[id].." 0 1 0 "..id) 	elseif(vbh_mode3[id]>0) then 		parse("spawnobject "..vbh_mode3[id].." "..vbh_px[id].." "..vbh_py[id].." 0 1 2 "..id) 	elseif(vbh_mode4[id]>0) then 		parse("spawnobject "..vbh_mode4[id].." "..vbh_px[id].." "..vbh_py[id].." 0 1 1 "..id) 	end 	vbh_px[id]=player(id,"tilex") 	vbh_py[id]=player(id,"tiley") end function vbh_spawn(id) 	vbh_px[id]=player(id,"tilex") 	vbh_py[id]=player(id,"tiley") 		end 	end end
edited 1×, last 12.03.11 01:25:12 am