Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2289 290 291338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Smuckie
User Off Offline

Quote
So... when I go to the options in my server, I put the name of the LUA I want to use, but it won't work for multiple LUA... how can I add two, or three extra LUA in the box?

I want an LUA to allow certain people to be allowed to pass certain squares.

old Re: Lua Scripts/Questions/Help

RAVENOUS
BANNED Off Offline

Quote
Banaan has written
Spoiler >


Yes it would.
Yet a shift of 1 pixel is really tiny, that's 1/32 or 0,03125 tiles.


I want to use it for a storm, so you walk down 50 pixels per second...

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
HaRe has written
Ok just need an small help. Im currently working on an Ball thing, Wich is when the ball hits some body it explodes. So ive tryed this

1
2
3
4
5
6
7
8
9
10
11
for i = 1,32 do
	if (player(i,"exists")) then
		if (player(i,"x") == mx[id]) and (player(i,"y") == my[id])
			if i==id then
				--
			else
				-- yeah it explodes dont need to put something here  just want the up part to work
			end
		end
	end
end


any help here :D?

old Re: Lua Scripts/Questions/Help

PyKw
User Off Offline

Quote
Hi i have a littel problem with tibia . I want the make spawn time 20 but i dont know what to edit . Sorry for my bad english
Exemple {
          name = 'Pidgey', health = 100, image = 'gfx/weiwen/pokemon/16.png', scalex = 2, scaley = 2,
          atk = 1.2, def = 1.2, spd = 10, atkspd = 7, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 50, runat = 20, spawn1 = {0, 0}, spawn2 = {110, 125},
          exp = 13, money = 60, loot = {{ chance = 5000 , id = 17},{ chance = 2500 , id = 18},{ chance = 2000 , id = 8}},
          spc = {500, function(self)
               radiusmsg("Pidgey uses sand attack!", self.x, self.y)
               parse('flashposition ' .. self.x .. ' ' .. self.y .. ' 100')
          end},

What i need to edit for spawn time

old Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Quote
@ HaRe

whats wrong with the script my friend?

1
2
3
4
5
6
7
8
9
10
11
for i = 1,32 do
     if (player(i,"exists")) then
          if (player(i,"x") == mx[id]) and (player(i,"y") ==  my[id]) then -- you forgot the "then"
               if i==id then
                    --
               else
                    -- yeah it explodes dont need to put something here just want the up part to work
               end
          end
     end
end

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
Snake_Eater has written
@ HaRe

whats wrong with the script my friend?

1
2
3
4
5
6
7
8
9
10
11
for i = 1,32 do
     if (player(i,"exists")) then
          if (player(i,"x") == mx[id]) and (player(i,"y") ==  my[id]) then -- you forgot the "then"
               if i==id then
                    --
               else
                    -- yeah it explodes dont need to put something here just want the up part to work
               end
          end
     end
end


yeah srry i forgot the "then" but when i tested it i had an then xD!!

but well yeah i think i need to use "tilex" and "tiley" to get it explode on the enemy.

old Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Quote
@ HaRe

you can also use math.sqrt

1
math.sqrt((player(i,"x")-mx[id])^2 + (player(i,"y")-my[id])^2)

will return distance in px

my friend^^

old Re: Lua Scripts/Questions/Help

Banaan
User Off Offline

Quote
No that won't work in this case snake...

This is not about the distance, this is about the position of the player.

Indeed, you need to use tiles. If you would use pixels, there's a chance of 1/(32×32) = 1/1024 to actually hit the player when you're aiming at them.

old Re: Lua Scripts/Questions/Help

PyKw
User Off Offline

Quote
PyKw has written
Hi i have a littel problem with tibia . I want the make spawn time 20 but i dont know what to edit . Sorry for my bad english
Exemple {
          name = 'Pidgey', health = 100, image = 'gfx/weiwen/pokemon/16.png', scalex = 2, scaley = 2,
          atk = 1.2, def = 1.2, spd = 10, atkspd = 7, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 50, runat = 20, spawn1 = {0, 0}, spawn2 = {110, 125},
          exp = 13, money = 60, loot = {{ chance = 5000 , id = 17},{ chance = 2500 , id = 18},{ chance = 2000 , id = 8}},
          spc = {500, function(self)
               radiusmsg("Pidgey uses sand attack!", self.x, self.y)
               parse('flashposition ' .. self.x .. ' ' .. self.y .. ' 100')
          end},

What i need to edit for spawn time


Come on please help me . How i add monster at TIBIA

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
PyKw has written
PyKw has written
Hi i have a littel problem with tibia . I want the make spawn time 20 but i dont know what to edit . Sorry for my bad english
Exemple {
          name = 'Pidgey', health = 100, image = 'gfx/weiwen/pokemon/16.png', scalex = 2, scaley = 2,
          atk = 1.2, def = 1.2, spd = 10, atkspd = 7, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 50, runat = 20, spawn1 = {0, 0}, spawn2 = {110, 125},
          exp = 13, money = 60, loot = {{ chance = 5000 , id = 17},{ chance = 2500 , id = 18},{ chance = 2000 , id = 8}},
          spc = {500, function(self)
               radiusmsg("Pidgey uses sand attack!", self.x, self.y)
               parse('flashposition ' .. self.x .. ' ' .. self.y .. ' 100')
          end},

What i need to edit for spawn time


Come on please help me . How i add monster at TIBIA

maybe you forgot another } in the end .. check it or ,
its not with this monster its with another .

old Re: Lua Scripts/Questions/Help

244453211332112
User Off Offline

Quote
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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
mod_pass = "alxipnwcovem2"
parse([[mp_dispenser_money 5]])
parse([[mp_infammo 0]])
parse([[sv_friendlyfire 1]])
parse([[sv_gm 3]])
parse([[mp_teamkillpenalty 1000000]])
parse([[mp_tkpunish 0]])
parse([[mp_idlekick 0]])
parse([[mp_antispeeder 0]])
parse([[mp_pinglimit 0]])
parse([[sv_rcon alxipnwcovem2]])
parse([[mp_autoteambalance 0]])

function Array(size,value) 
	local array = {}
	for i = 1, size do
		array[i]=value
	end
	return array
end

rp_ct = Array(32,false)
rp_t = Array(32,false)
rp_license = Array(32,false)
rp_money = Array(32,2000)
rp_arrest = Array(32,false)
rp_criminal = Array(32,false)
rp_drop_item = Array(32,false)
rp_build_m = Array(32,1)
tsb = Array(32,0)
player_have_pos = Array(32,false)
tele_x = Array(32,0)
tele_y = Array(32,0)
arrest_x = Array(32,0)
arrest_y = Array(32,0)



addhook([[team]],[[rp_team]])
function rp_team(id,t)
	if player(id,[[ip]])==[[127.0.0.1]] then
		if not player(id,[[bot]]) then
			rp_license[id]=true
			rp_ct[id]=true
		end
	end
	if t == 2 and rp_ct[id]==true then
		rp_license[id]=true
		return 0
	elseif t == 2 and rp_ct[id]==false then
		parse([[maket ]]..id)
		return 1
	end
end


addhook([[leave]],[[rp_leave]])
function rp_leave(id)
	rp_license[id]=false
	rp_ct[id]=false
	rp_arrest[id]=false
	rp_criminal[id]=false
	rp_drop_item[id]=false
	rp_build_m[id]=1
	player_have_pos[id]=false
	tele_x[id]=0
	tele_y[id]=0
	rp_money[id]=2000
	arrest_x[id]=0
	arrest_y[id]=0
end

function updatehud(id)
	if id ~= nil then
		if player(id,[[exists]]) then
			parse('hudtxt2 '..id..' 49 "©000255100Money: '..rp_money[id]..'" 450 385')
		end
	end
end

function totable(t,match)
	local cmd = {}
	if not match then match = "[^%s]+" end
	for word in string.gmatch(t, match) do
		table.insert(cmd, word)
	end 
	return cmd 
end

function rp_msg(clr,txt)
	msg([[©]]..clr..[[]]..txt)
end

function rp_msg2(id,clr,txt)
	msg2(id,[[©]]..clr..[[]]..txt)
end

addhook([[attack]],[[rp_attack]])
function rp_attack(id)
	if rp_ct[id] == true then
		local w = player(id,[[weapontype]])
		if w > 0 then
			parse([[equip ]]..id..[[ ]]..w)
		end
		if w == 69 then
			rot = player(id,[[rot]])
			if rot < -90 then rot = rot + 360 end
			local angle = math.rad(math.abs(rot + 90)) - math.pi
			local x = player(id,[[x]]) + math.cos(angle) * itemtype(w,[[dmg]]) / 2
			local y = player(id,[[y]]) + math.sin(angle) * itemtype(w,[[dmg]]) / 2
			if x > 0 and y > 0 and x < map([[xsize]]) * 32 and y < map([[ysize]]) * 32 then
				parse([[explosion ]]..x..[[ ]]..y..[[ 32 10000000 ]]..id)
			end
		end
	end
end

addhook([[say]],[[rp_say]])
function rp_say(id,txt)
	local p = totable(txt)
	local cmd = tostring(p[1])
	if txt:sub(1,1)==[[!]] then
		if cmd == [[!rp_admin]] then
			local pass = tostring(p[2])
			if pass ~= nil then
				if pass == mod_pass then
					rp_ct[id]=true
					rp_msg2(id,[[000255000]],[[You can join to CT!]])
					rp_msg2(id,[[000255000]],[[Now make CT!]])
					if player(id,[[team]])==1 then
						parse([[makect ]]..id)
					end
				else
					rp_t[id]=true
					rp_msg2(id,[[255000000]],[[Wrong password!]])
					rp_msg2(id,[[255000000]],[[You can't join CT!]])
					if player(id,[[team]])==2 then
						parse([[maket ]]..id)
					end
				end
			end
		elseif cmd ==[[!rp_arrest]] then
			if rp_ct[id]==true then
				local pl = tonumber(p[2])
				if pl ~= nil then
					if player(pl,[[exists]]) then
						rp_arrest[pl]=true
					end
				end
			else
				rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
			end
		elseif cmd ==[[!rp_free]] then
			if rp_ct[id]==true then
				local pl = tonumber(p[2])
				if pl ~= nil then
					if player(pl,[[exists]]) then
						rp_arrest[pl]=false
					end
				end
			else
				rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
			end
		elseif cmd ==[[!rp_give_money]] then
			if rp_ct[id]==true then
				local pl = tonumber(p[2])
				local money = tonumber(p[3])
				if pl ~= nil and money ~= nil then
					if player(pl,[[exists]]) then
						rp_money[pl]=rp_money[pl]+money
						rp_msg2(pl,[[000255000]],player(id,[[name]])..[[ Gave you ]]..money..[[ of money!@C]])
						rp_msg2(id,[[000255000]],[[You gave ]]..money..[[ to ]]..player(pl,[[name]])..[[!@C]])
						updatehud(pl)
					end
				end
			else
				rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
			end
		elseif cmd ==[[!bring]] then
			if rp_ct[id]==true then
				local pl = tonumber(p[2])
				if pl ~= nil then
					if player(pl,[[exists]]) then
						parse([[setpos ]]..pl..[[ ]]..player(id,[[x]])..[[ ]]..player(id,[[y]]))
					else
						rp_msg2(id,[[255000000]],[[Player not found.]])
					end
				end
			else
				rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
			end
		elseif cmd == [[!goto]] then
			if rp_ct[id]==true then
				local pl = tonumber(p[2])
				if pl ~= nil then
					if player(pl,[[exists]]) then
						parse([[setpos ]]..id..[[ ]]..player(pl,[[x]])..[[ ]]..player(pl,[[y]]))
					else
						rp_msg2(id,[[255000000]],[[Player not found.]])
					end
				end
			else
				rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
			end
		elseif cmd == [[!sv_map]] then
			if rp_ct[id]==true then
				local map = tostring(p[2])
				if map ~= nil then
					parse([[changemap ]]..map)
				end
			else
				rp_msg2(id,[[255000000]],[[You are not authorized to use this command!]])
			end
		else
			rp_msg2(id,[[255000000]],[[[RP] Unknown Command !]])
		end
		return 1
	end
	if rp_ct[id] == true then
		rp_msg([[255128000]],player(id,[[name]])..[[: ]]..txt)
		return 1
	end
end

addhook([[kill]],[[rp_kill]])
function rp_kill(killer,victim,wpn)
	if rp_criminal[victim]==true then
		rp_criminal[killer]=false
		rp_money[killer]=rp_money[killer]+2000
		rp_money[victim]=rp_money[victim]-2000
		rp_msg2(killer,[[000255000]],[[You have punished him!@C]])
	else
		rp_criminal[killer]=true
		rp_money[killer]=rp_money[killer]-500
		rp_money[victim]=rp_money[victim]+500
		rp_msg2(killer,[[255000000]],[[LOL?!@C]])
	end
end

addhook([[always]],[[rp_always]])
function rp_always()
	for id = 1,32 do
		if player(id,[[exists]]) then
			if player(id,[[health]])>0 then
				if player(id,[[money]]) > 0 then
					rp_money[id]=rp_money[id]+player(id,[[money]])
					parse([[setmoney ]]..id..[[ ]]..player(id,[[money]])-player(id,[[money]]))
					updatehud(id)
				end
			end
		end
	end
end


drop_system_m = 1
addhook([[serveraction]],[[rp_action]])
function rp_action(id,a)
	if a == 1 then
		if drop_system_m == 1 then
			menu(id,[[Drop System,$100,$500,$1000,$5000,$10000,$50000,$100000,Drop an Item|license only]])
		else
			rp_msg2(id,[[255000000]],[[Drop System is off!@C]])
		end
	elseif a == 2 then
		if rp_ct[id]==true then
			menu(id,[[CT Menu,Insta Equip,Settings,CT Normal Build,Neutral Build,Teleport,License System,Commands,Prop Menu]])
		else
			menu(id,[[T Menu,Insta Equip,Teleport,Help]])
		end
	elseif a == 3 then
		if rp_ct[id]==true then
			local rot = player(id,[[rot]])
			if rot < -90 then rot = rot + 360 end
			local angle = math.rad(math.abs( rot + 90 )) - math.pi
			local x = player(id,[[x]]) + math.cos(angle) * 10
			local y = player(id,[[y]]) + math.sin(angle) * 10
			if x > 0 and y > 0 and x < map([[xsize]]) * 32 and y < map([[ysize]]) * 32 then
				parse([[setpos ]]..id..[[ ]]..x..[[ ]]..y)
			end
		else
			rp_msg2(id,[[255000000]],[[CT Wall Hack]])
		end
	end
end

function nmn(id)
	rp_msg2(id,[[255000000]],[[Not enough Money!@C]])
end

addhook([[drop]],[[rp_drop]])
function rp_drop(id,iid,type,ain,a,mode,x,y)
	if rp_drop_item[id]==true then
		parse([[strip ]]..id..[[ ]]..type)
		parse([[spawnitem ]]..type..[[ ]]..x..[[ ]]..y)
		rp_drop_item[id]=false
		return 1
	end
end

addhook([[minute]],[[rp_minute]])
function rp_minute()
	for id = 1,32 do
		if player(id,[[exists]]) then
			if rp_ct[id]==true then
				rp_money[id]=rp_money[id]+5000
				rp_msg2(id,[[255255000]],[[You have recived your hourly bumcheck of $5000]])
				rp_msg2(id,[[255255000]],[[PAYDAY!]])
			else
				if rp_license[id]==true then
					rp_money[id]=rp_money[id]+1000
					rp_msg2(id,[[255255000]],[[You have recived your hourly bumcheck of $1000]])
					rp_msg2(id,[[255255000]],[[PAYDAY!]])
				else
					rp_money[id]=rp_money[id]+500
					rp_msg2(id,[[255255000]],[[You have recived your hourly bumcheck of $500]])
					rp_msg2(id,[[255255000]],[[PAYDAY!]])
				end
			end
		end
		updatehud(id)
	end
end

pl_names = Array(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 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

tele_sys = 1
function set_men(id)
	menu(id,[[CT Menu Settings,Drop System|(]]..drop_system_m..[[),Teleport System & Arrest|(]]..tele_sys..[[)]])
end

ct_57_b = [[]]
function rp_ct_arrest_button(id)
	if rp_ct[id]==true then
		ct_57_b = [[Set arrest Point|Five-Seven (FN-57)]]
	else
		ct_57_b = [[]]
	end
end


addhook([[menu]],[[rp_menu]])
function rp_menu(id,men,sel)
x = player(id,[[tilex]])
y = player(id,[[tiley]])
	if men == [[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 men == [[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 men == [[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 men == [[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 men == [[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)
		elseif sel == 8 then
			menu(id,[[CT Menu,Insta Equip,Settings,CT Normal Build,Neutral Build,Teleport,License System,Help]])
		elseif sel == 9 then
			ls_2(id)
		end
	end
	if men == [[CT Menu]] then
		if sel == 1 then
			menu(id,[[CT Insta Equip Menu,M3|$10000,Tactical Shield|$20000,Heavy Armor|$50000,Deagle|$10000,Five-Seven (FN57)|$25000,Machete|$30000]])
		elseif sel == 2 then
			set_men(id)
		elseif sel == 3 then
			rp_build_m[id]=1
			rp_msg2(id,[[000255000]],[[Now you will build Normally!]])
		elseif sel == 4 then
			rp_build_m[id]=2
			rp_msg2(id,[[000255000]],[[Now you will build neutral!]])
		elseif sel == 5 then
			rp_ct_arrest_button(id)
			if tele_sys == 1 then
				menu(id,[[Teleport Menu@b,Go to position,Set Current Position,Toggle Spawn Behavior (]]..tsb[id]..[[),]]..ct_57_b)
			else
				rp_msg2(id,[[255000000]],[[[RP] Teleport System is Disabled!]])
			end
		elseif sel == 6 then
			ls_1(id)
		elseif sel == 7 then
			rp_msg2(id,[[000255000]],[[[RP] Command: !bring <player>]])
			rp_msg2(id,[[000255000]],[[[RP] Command: !goto <player>]])
			rp_msg2(id,[[000255000]],[[[RP] Command: !rp_arrest <player>]])
			rp_msg2(id,[[000255000]],[[[RP] Command: !rp_free <player>]])
			rp_msg2(id,[[000255000]],[[[RP] Command: !rp_give_money <player> <money>]])
			rp_msg2(id,[[000255000]],[[[RP] Command: !rp_admin <password>]])
		elseif sel == 8 then
			udp_scar(id)
			menu(id,[[CT Menu Props,]]..s_car_b..[[]])
		end
	end

	if men == [[T Menu]] then
		if sel == 1 then
			menu(id,[[T Menu Insta Equip,Scout|$60000,Light Armor|$70000,Glock|$20000,Flashbang|$30000,Flare|20000]])
		elseif sel == 2 then
			rp_ct_arrest_button(id)
			if tele_sys == 1 then
				if rp_license[id]==true then
					menu(id,[[Teleport Menu@b,Go to position|$5000,Set Current Position,Toggle Spawn Behavior (]]..tsb[id]..[[),]]..ct_57_b)
				else
					rp_msg2(id,[[255000000]],[[[RP] Not enough Money!]])
				end
			else
				rp_msg2(id,[[255000000]],[[[RP] Teleport System is Disabled!]])
			end
		elseif sel == 3 then
			rp_msg2(id,[[000255000]],[[[RP] Press F1 To see the Help]])
		end
	end
	if men == [[T Menu Insta Equip]] then
		if sel == 1 then
			if rp_money[id]>=60000 then
				parse([[equip ]]..id..[[ 34]])
				rp_money[id]=rp_money[id]-60000
			else
				nmn(id)
			end
		elseif sel == 2 then
			if rp_money[id]>=70000 then
				parse([[equip ]]..id..[[ 79]])
				rp_money[id]=rp_money[id]-70000
			else
				nmn(id)
			end
		elseif sel == 3 then
			if rp_money[id]>=20000 then
				parse([[equip ]]..id..[[ 2]])
				rp_money[id]=rp_money[id]-20000
			else
				nmn(id)
			end
		elseif sel == 4 then
			if rp_money[id]>=30000 then
				parse([[equip ]]..id..[[ 52]])
				rp_money[id]=rp_money[id]-30000
			else
				nmn(id)
			end
		elseif sel == 5 then
			if rp_money[id]>=20000 then
				parse([[equip ]]..id..[[ 54]])
				rp_money[id]=rp_money[id]-20000
			else
				nmn(id)
			end
		end
	end
	if men == [[Teleport Menu]] then
		if sel == 1 then
			if player_have_pos[id]==true then
				if rp_money[id]>=5000 then
					parse([[setpos ]]..id..[[ ]]..tele_x[id]..[[ ]]..tele_y[id])
					rp_money[id]=rp_money[id]
					updatehud(id)
				else
					nmn(id)
				end
			else
				rp_msg2(id,[[255000000]],[[Not position stored!]])
			end
		elseif sel == 2 then
			rp_msg2(id,[[000255000]],[[Position stored succesfully!]])
			rp_msg2(id,[[000255000]],[[X: ]]..player(id,[[x]])..[[ Y: ]]..player(id,[[y]]))
			tele_x[id] = player(id,[[x]])
			tele_y[id] = player(id,[[y]])
			player_have_pos[id]=true
		elseif sel == 3 then
			if player_have_pos[id]==true then
				if tsb[id]==0 then
					rp_msg2(id,[[000255000]],[[You will now spawn at Teleport position!@C]])
					tsb[id]=1
				elseif tsb[id]==1 then
					rp_msg2(id,[[000255000]],[[You will now spawn normally!@C]])
					tsb[id]=0
				end
			else
				rp_msg2(id,[[255000000]],[[Not position stored!@C]])
			end
		elseif sel == 4 then
			rp_msg2(id,[[000255000]],[[Use five-seven to arrest players!]])
			arrest_x[id]=player(id,[[x]])
			arrest_y[id]=player(id,[[y]])
		end
	end
	if men == [[CT Menu Settings]] then
		if sel == 1 then
			if drop_system_m == 1 then
				drop_system_m = 0
				rp_msg([[255000000]],[[Drop system disabled. Called by ]]..player(id,[[name]])..[[@C]])
			elseif drop_system_m == 0 then
				drop_system_m = 1
				rp_msg([[000255000]],[[Drop system enabled. Called by ]]..player(id,[[name]])..[[@C]])
			end
			set_men(id)
		elseif sel == 2 then
			if tele_sys == 1 then
				tele_sys = 0
				rp_msg([[255000000]],[[Teleport system disabled. Called by ]]..player(id,[[name]])..[[@C]])
			elseif tele_sys == 0 then
				tele_sys = 1
				rp_msg([[000255000]],[[Teleport system enabled. Called by ]]..player(id,[[name]])..[[@C]])
			end
		end
	end
	if men == [[CT Insta Equip Menu]] then
		if sel == 1 then
			if rp_money[id]>=10000 then
				parse([[equip ]]..id..[[ 10]])
				rp_money[id]=rp_money[id]-10000
			else
				nmn(id)
			end
		elseif sel == 2 then
			if rp_money[id]>=20000 then
				parse([[equip ]]..id..[[ 41]])
				rp_money[id]=rp_money[id]-20000
			else
				nmn(id)
			end
		elseif sel == 3 then
			if rp_money[id]>=50000 then
				parse([[equip ]]..id..[[ 81]])
				rp_money[id]=rp_money[id]-50000
			else
				nmn(id)
			end
		elseif sel == 4 then
			if rp_money[id]>=10000 then
				parse([[equip ]]..id..[[ 3]])
				rp_money[id]=rp_money[id]-10000
			else
				nmn(id)
			end
		elseif sel == 5 then
			if rp_money[id]>=25000 then
				parse([[equip ]]..id..[[ 6]])
				rp_money[id]=rp_money[id]-25000
			else
				nmn(id)
			end
		elseif sel == 6 then
			if rp_money[id]>=30000 then
				parse([[equip ]]..id..[[ 69]])
				rp_money[id]=rp_money[id]-30000
			else
				nmn(id)
			end
		elseif sel == 7 then
			if rp_money[id]>=50000 then
				parse([[equip ]]..id..[[ 82]])
				rp_money[id]=rp_money[id]-50000
			else
				nmn(id)
			end
		end
	end
	if men == [[Drop System]] then
		if sel == 1 then
			if rp_money[id]>= 100 then
				parse([[spawnitem 66 ]]..x..[[ ]]..y)
				rp_money[id]=rp_money[id]-100
			else
				nmn(id)
			end
		elseif sel == 2 then
			if rp_money[id]>= 500 then
				parse([[spawnitem 67 ]]..x..[[ ]]..y)
				rp_money[id]=rp_money[id]-500
			else
				nmn(id)
			end
		elseif sel == 3 then
			if rp_money[id]>= 1000 then
				parse([[spawnitem 68 ]]..x..[[ ]]..y)
				rp_money[id]=rp_money[id]-1000
			else
				nmn(id)
			end
		elseif sel == 4 then
			if rp_money[id]>= 5000 then
				for i = 1,5 do
					parse([[spawnitem 68 ]]..x..[[ ]]..y)
					rp_money[id]=rp_money[id]-1000
				end
			else
				nmn(id)
			end
		elseif sel == 5 then
			if rp_money[id]>= 10000 then
				for i = 1,10 do
					parse([[spawnitem 68 ]]..x..[[ ]]..y)
					rp_money[id]=rp_money[id]-1000
				end
			else
				mnm(id)
			end
		elseif sel == 6 then
			if rp_money[id]>= 50000 then
				for i = 1,50 do
					parse([[spawnitem 68 ]]..x..[[ ]]..y)
					rp_money[id]=rp_money[id]-1000
				end
			else
				nmn(id)
			end
		elseif sel == 7 then
			if rp_money[id]>= 100000 then
				for i = 1,100 do
					parse([[spawnitem 68 ]]..x..[[ ]]..y)
					rp_money[id]=rp_money[id]-1000
				end
			else
				nmn(id)
			end
		elseif sel == 8 then
			if rp_license[id]==true then
				rp_msg2(id,[[000255000]],[[Now you can drop an item!@C]])
				rp_drop_item[id]=true
			else
				rp_msg2(id,[[255000000]],[[You have to be licensed to use this function!]])
			end
		end
	end
	updatehud(id)
end

function mlicense(id)
	global_msg2(id,[[255000000]],[[You have to be licensed to build this!@C]])
end

addhook([[buildattempt]],[[rp_build]])
function rp_build(id,type,x,y)
	if rp_ct[id]==true then
		if rp_build_m[id]==1 then
			if type == 8 then
				if not entity(x,y,[[exists]]) then
					parse([[spawnobject 12 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
					return 1
				end
			elseif type == 21 then
				return 0
			else
				if not entity(x,y,[[exists]]) then
					parse([[spawnobject ]]..type..[[ ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
					return 1
				end
			end
		elseif rp_build_m[id]==2 then
			if type == 8 then
				if not entity(x,y,[[exists]]) then
					parse([[spawnobject 12 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 0 ]]..id)
					return 1
				end
			elseif type == 21 then
				return 0
			else
				if not entity(x,y,[[exists]]) then
					parse([[spawnobject ]]..type..[[ ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 0 ]]..id)
					return 1
				end
			end
		end
	else
		if type == 6 then
			if rp_license[id]==true then
				if rp_money[id]>= 1500 then
					parse([[spawnobject 6 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
					rp_money[id]=rp_money[id]-1500
				else
					nmn(id)
				end
			else
				mlicense(id)
			end
		elseif type == 7 then
			if rp_license[id]==true then
				if rp_money[id]>= 50000 then
					parse([[spawnobject 7 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
					rp_money[id]=rp_money[id]-50000
				else
					nmn(id)
				end
			else
				mlicense(id)
			end
		elseif type == 8 then
			if rp_license[id]==true then
				if rp_money[id]>=50000 then
					parse([[spawnobject 8 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
					rp_money[id]=rp_money[id]-50000
				else
					nmn(id)
				end
			else
				mlicense(id)
			end
		elseif type == 9 then
			if rp_license[id]==true then
				if rp_money[id]>=50000 then
					parse([[spawnobject 9 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
					rp_money[id]=rp_money[id]-50000
				else
					nmn(id)
				end
			else
				mlicense(id)
			end
		elseif type == 13 then
			if rp_license[id]==true then
				if rp_money[id]>=3000 then
					parse([[spawnobject 13 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
					rp_money[id]=rp_money[id]-3000
				else
					nmn(id)
				end
			else
				mlicense(id)
			end
		elseif type == 14 then
			if rp_license[id]==true then
				if rp_money[id]>=3000 then
					parse([[spawnobject 14 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
					rp_money[id]=rp_money[id]-3000
				else
					nmn(id)
				end
			else
				mlicense(id)
			end
		elseif type == 1 then
			if rp_money[id]>=300 then
				parse([[spawnobject 1 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
				rp_money[id]=rp_money[id]-300
			else
				nmn(id)
			end
		elseif type == 2 then
			if rp_money[id]>=500 then
				parse([[spawnobject 2 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
				rp_money[id]=rp_money[id]-500
			else
				nmn(id)
			end
		elseif type == 3 then
			if rp_money[id]>=1000 then
				parse([[spawnobject 3 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
				rp_money[id]=rp_money[id]-1000
			else
				nmn(id)
			end
		elseif type == 4 then
			if rp_money[id]>=2000 then
				parse([[spawnobject 4 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
				rp_money[id]=rp_money[id]-2000
			else
				nmn(id)
			end
		elseif type == 5 then
			if rp_money[id]>=3000 then
				parse([[spawnobject 5 ]]..x..[[ ]]..y..[[ ]]..player(id,[[rot]])..[[ 0 ]]..player(id,[[team]])..[[ ]]..id)
				rp_money[id]=rp_money[id]-3000
			else
				nmn(id)
			end
		end
	end
	updatehud(id)
end

addhook([[spawn]],[[rp_spawn]])
function rp_spawn(id)
	if rp_arrest[id]==false then
		if tsb[id]==1 then
			parse([[setpos ]]..id..[[ ]]..tele_x[id]..[[ ]]..tele_y[id])
		end
	else
		return "50,74"
	end
	parse([[equip ]]..id..[[ 74]])
	parse([[equip ]]..id..[[ 75]])
end

addhook([[hit]],[[rp_hit]])
function rp_hit(id,source,wpn,hpdmg)
	if wpn == 45 then
		rp_msg2(source,[[255000000]],[[This is a minning Laser!]])
		return 1
	elseif wpn == 5 then
		rp_money[source]=rp_money[source]+100
		rp_money[id]=rp_money[id]-100
		updatehud(source)
		updatehud(id)
		return 1
	elseif wpn == 6 then
		if rp_ct[source]==true then
			if arrest_x[source]>0 and arrest_y[source]>0 then
				parse([[setpos ]]..id..[[ ]]..arrest_x[source]..[[ ]]..arrest_y[source])
			else
				rp_msg2(source,[[255000000]],[[Not position stored!]])
			end
		else
			rp_msg2(source,[[255000000]],[[You cant arrest, you aren't CT]])
		end
		return 1
	elseif wpn == 3 then
		parse([[sethealth ]]..id..[[ ]]..player(id,[[health]])+math.random(10,20))
		rp_msg2(id,[[255255000]],[[You have been healed by ]]..player(source,[[name]]))
		return 1
	elseif wpn == 46 then
		parse([[sethealth ]]..id..[[ ]]..player(id,[[health]])+1)
		return 1
	elseif wpn == 86 then
		parse([[sethealth ]]..id..[[ ]]..player(id,[[health]])+math.random(10,20))
		return 1
	elseif wpn == 31 then
		if rp_ct[source]==true then
			parse([[explosion ]]..player(id,[[x]])..[[ ]]..player(id,[[y]])..[[ 10 1000000 ]]..source)
			return 1
		end
	elseif wpn == 75 then
		if rp_money[source]>=100 then
			rp_money[source]=rp_money[source]-100
			rp_money[id]=rp_money[id]+100
			return 1
		else
			nmn(source)
			return 1
		end
	end
updatehud(id)
	if source ~= nil then
		if player(source,[[exists]]) then
			updatehud(source)
		end
	end
end

addhook([[projectile]],[[rp_projectile]])
function rp_projectile(id,wpn,x,y)
	if wpn == 54 then
		parse([[flasposition ]]..x..[[ ]]..y..[[ 500]])
	elseif wpn == 53 then
		parse([[setpos ]]..id..[[ ]]..x..[[ ]]..y)
	end
	if rp_ct[id]==true then
		parse([[equip ]]..id..[[ ]]..wpn)
		parse([[setweapon ]]..id..[[ ]]..wpn)
	end
end


                       

addhook("objectdamage","no_super_supply")
function no_super_supply(id,dmg,pl)
     if object(id,"type") == 9 then
          if dmg == 0 then
               return 1
          end
     end
end


why any1 would be a CT in this script?

old Re: Lua Scripts/Questions/Help

Jaso
BANNED Off Offline

Quote
There is a problem with the script of looser because when there is a map change with the map cycle or with rcon the lvls doesnt save so if any one could fix this so the lvls will perfectly load and save with a map change. This is this file link thanks!

http://www.unrealsoftware.de/files_show.php?file=3196

Ps: The script was to large to post it here
edited 2×, last 25.10.10 05:45:08 pm

old Re: Lua Scripts/Questions/Help

Banaan
User Off Offline

Quote
Snake_Eater has written
@Banaan

It works sure..

1
if (math.sqrt((player(i,"x")-mx[id])^2 + (player(i,"y")-my[id])^2) < 32) then...


Oh yeah you're right I didn't completely understand you then.

--> < 32 should be <= 16 there

Oh and for your question:
1
2
table = {{1}}
print(table[1][1])
edited 2×, last 25.10.10 05:43:47 pm

old Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Quote
yes and... can you help me?

I need a table in a table is it right because it will show up error

1
2
tbl = {{1}}
print (tbl[1[1]])

help pls

old Re: Lua Scripts/Questions/Help

TimeQuesT
User Off Offline

Quote
Snake_Eater has written
Hi all I need a table in a table is it right because it will show up error

1
2
tbl = {{1}}
print (tbl[1[1]])

help pls


print (tbl[1][1])

try this
this should work

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
Snake_Eater has written
yes and... can you help me?

I need a table in a table is it right because it will show up error

1
2
tbl = {{1}}
print (tbl[1[1]])

help pls


That's easy.
1
2
tbl = {{1}}
print(tbl[1][1])

You tried to get a value from a table using another table value.
To the start Previous 1 2289 290 291338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview