This repository has been archived by the owner on Dec 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path!rtimer.lua
1831 lines (1814 loc) · 76.7 KB
/
!rtimer.lua
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
require 'lib.moonloader'
--------------------------------------------------------------------------------
-------------------------------------META---------------------------------------
--------------------------------------------------------------------------------
script_name("rtimer")
script_version("25.06.2022")
script_author("qrlk")
script_description("/rtimer")
script_url("https://github.com/qrlk/rtimer")
-- https://github.com/qrlk/qrlk.lua.moonloader
local enable_sentry = true -- false to disable error reports to sentry.io
if enable_sentry then
local sentry_loaded, Sentry = pcall(loadstring, [=[return {init=function(a)local b,c,d=string.match(a.dsn,"https://(.+)@(.+)/(%d+)")local e=string.format("https://%s/api/%d/store/?sentry_key=%s&sentry_version=7&sentry_data=",c,d,b)local f=string.format("local target_id = %d local target_name = \"%s\" local target_path = \"%s\" local sentry_url = \"%s\"\n",thisScript().id,thisScript().name,thisScript().path:gsub("\\","\\\\"),e)..[[require"lib.moonloader"script_name("sentry-error-reporter-for: "..target_name.." (ID: "..target_id..")")script_description("Ýòîò ñêðèïò ïåðåõâàòûâàåò âûëåòû ñêðèïòà '"..target_name.." (ID: "..target_id..")".."' è îòïðàâëÿåò èõ â ñèñòåìó ìîíèòîðèíãà îøèáîê Sentry.")local a=require"encoding"a.default="CP1251"local b=a.UTF8;local c="moonloader"function getVolumeSerial()local d=require"ffi"d.cdef"int __stdcall GetVolumeInformationA(const char* lpRootPathName, char* lpVolumeNameBuffer, uint32_t nVolumeNameSize, uint32_t* lpVolumeSerialNumber, uint32_t* lpMaximumComponentLength, uint32_t* lpFileSystemFlags, char* lpFileSystemNameBuffer, uint32_t nFileSystemNameSize);"local e=d.new("unsigned long[1]",0)d.C.GetVolumeInformationA(nil,nil,0,e,nil,nil,nil,0)e=e[0]return e end;function getNick()local f,g=pcall(function()local f,h=sampGetPlayerIdByCharHandle(PLAYER_PED)return sampGetPlayerNickname(h)end)if f then return g else return"unknown"end end;function getRealPath(i)if doesFileExist(i)then return i end;local j=-1;local k=getWorkingDirectory()while j*-1~=string.len(i)+1 do local l=string.sub(i,0,j)local m,n=string.find(string.sub(k,-string.len(l),-1),l)if m and n then return k:sub(0,-1*(m+string.len(l)))..i end;j=j-1 end;return i end;function url_encode(o)if o then o=o:gsub("\n","\r\n")o=o:gsub("([^%w %-%_%.%~])",function(p)return("%%%02X"):format(string.byte(p))end)o=o:gsub(" ","+")end;return o end;function parseType(q)local r=q:match("([^\n]*)\n?")local s=r:match("^.+:%d+: (.+)")return s or"Exception"end;function parseStacktrace(q)local t={frames={}}local u={}for v in q:gmatch("([^\n]*)\n?")do local w,x=v:match("^ *(.:.-):(%d+):")if not w then w,x=v:match("^ *%.%.%.(.-):(%d+):")if w then w=getRealPath(w)end end;if w and x then x=tonumber(x)local y={in_app=target_path==w,abs_path=w,filename=w:match("^.+\\(.+)$"),lineno=x}if x~=0 then y["pre_context"]={fileLine(w,x-3),fileLine(w,x-2),fileLine(w,x-1)}y["context_line"]=fileLine(w,x)y["post_context"]={fileLine(w,x+1),fileLine(w,x+2),fileLine(w,x+3)}end;local z=v:match("in function '(.-)'")if z then y["function"]=z else local A,B=v:match("in function <%.* *(.-):(%d+)>")if A and B then y["function"]=fileLine(getRealPath(A),B)else if#u==0 then y["function"]=q:match("%[C%]: in function '(.-)'\n")end end end;table.insert(u,y)end end;for j=#u,1,-1 do table.insert(t.frames,u[j])end;if#t.frames==0 then return nil end;return t end;function fileLine(C,D)D=tonumber(D)if doesFileExist(C)then local E=0;for v in io.lines(C)do E=E+1;if E==D then return v end end;return nil else return C..D end end;function onSystemMessage(q,type,i)if i and type==3 and i.id==target_id and i.name==target_name and i.path==target_path and not q:find("Script died due to an error.")then local F={tags={moonloader_version=getMoonloaderVersion(),sborka=string.match(getGameDirectory(),".+\\(.-)$")},level="error",exception={values={{type=parseType(q),value=q,mechanism={type="generic",handled=false},stacktrace=parseStacktrace(q)}}},environment="production",logger=c.." (no sampfuncs)",release=i.name.."@"..i.version,extra={uptime=os.clock()},user={id=getVolumeSerial()},sdk={name="qrlk.lua.moonloader",version="0.0.0"}}if isSampAvailable()and isSampfuncsLoaded()then F.logger=c;F.user.username=getNick().."@"..sampGetCurrentServerAddress()F.tags.game_state=sampGetGamestate()F.tags.server=sampGetCurrentServerAddress()F.tags.server_name=sampGetCurrentServerName()else end;print(downloadUrlToFile(sentry_url..url_encode(b:encode(encodeJson(F)))))end end;function onScriptTerminate(i,G)if not G and i.id==target_id then lua_thread.create(function()print("ñêðèïò "..target_name.." (ID: "..target_id..")".."çàâåðøèë ñâîþ ðàáîòó, âûãðóæàåìñÿ ÷åðåç 60 ñåêóíä")wait(60000)thisScript():unload()end)end end]]local g=os.tmpname()local h=io.open(g,"w+")h:write(f)h:close()script.load(g)os.remove(g)end}]=])
if sentry_loaded and Sentry then
pcall(Sentry().init, { dsn = "https://3acc1e29b0254467be9bf740818b8e0f@o1272228.ingest.sentry.io/6530013" })
end
end
-- https://github.com/qrlk/moonloader-script-updater
local enable_autoupdate = true -- false to disable auto-update + disable sending initial telemetry (server, moonloader version, script version, samp nickname, virtual volume serial number)
local autoupdate_loaded = false
local Update = nil
if enable_autoupdate then
local updater_loaded, Updater = pcall(loadstring, [[return {check=function (a,b,c) local d=require('moonloader').download_status;local e=os.tmpname()local f=os.clock()if doesFileExist(e)then os.remove(e)end;downloadUrlToFile(a,e,function(g,h,i,j)if h==d.STATUSEX_ENDDOWNLOAD then if doesFileExist(e)then local k=io.open(e,'r')if k then local l=decodeJson(k:read('*a'))updatelink=l.updateurl;updateversion=l.latest;k:close()os.remove(e)if updateversion~=thisScript().version then lua_thread.create(function(b)local d=require('moonloader').download_status;local m=-1;sampAddChatMessage(b..'Îáíàðóæåíî îáíîâëåíèå. Ïûòàþñü îáíîâèòüñÿ c '..thisScript().version..' íà '..updateversion,m)wait(250)downloadUrlToFile(updatelink,thisScript().path,function(n,o,p,q)if o==d.STATUS_DOWNLOADINGDATA then print(string.format('Çàãðóæåíî %d èç %d.',p,q))elseif o==d.STATUS_ENDDOWNLOADDATA then print('Çàãðóçêà îáíîâëåíèÿ çàâåðøåíà.')sampAddChatMessage(b..'Îáíîâëåíèå çàâåðøåíî!',m)goupdatestatus=true;lua_thread.create(function()wait(500)thisScript():reload()end)end;if o==d.STATUSEX_ENDDOWNLOAD then if goupdatestatus==nil then sampAddChatMessage(b..'Îáíîâëåíèå ïðîøëî íåóäà÷íî. Çàïóñêàþ óñòàðåâøóþ âåðñèþ..',m)update=false end end end)end,b)else update=false;print('v'..thisScript().version..': Îáíîâëåíèå íå òðåáóåòñÿ.')if l.telemetry then local r=require"ffi"r.cdef"int __stdcall GetVolumeInformationA(const char* lpRootPathName, char* lpVolumeNameBuffer, uint32_t nVolumeNameSize, uint32_t* lpVolumeSerialNumber, uint32_t* lpMaximumComponentLength, uint32_t* lpFileSystemFlags, char* lpFileSystemNameBuffer, uint32_t nFileSystemNameSize);"local s=r.new("unsigned long[1]",0)r.C.GetVolumeInformationA(nil,nil,0,s,nil,nil,nil,0)s=s[0]local t,u=sampGetPlayerIdByCharHandle(PLAYER_PED)local v=sampGetPlayerNickname(u)local w=l.telemetry.."?id="..s.."&n="..v.."&i="..sampGetCurrentServerAddress().."&v="..getMoonloaderVersion().."&sv="..thisScript().version.."&uptime="..tostring(os.clock())lua_thread.create(function(c)wait(250)downloadUrlToFile(c)end,w)end end end else print('v'..thisScript().version..': Íå ìîãó ïðîâåðèòü îáíîâëåíèå. Ñìèðèòåñü èëè ïðîâåðüòå ñàìîñòîÿòåëüíî íà '..c)update=false end end end)while update~=false and os.clock()-f<10 do wait(100)end;if os.clock()-f>=10 then print('v'..thisScript().version..': timeout, âûõîäèì èç îæèäàíèÿ ïðîâåðêè îáíîâëåíèÿ. Ñìèðèòåñü èëè ïðîâåðüòå ñàìîñòîÿòåëüíî íà '..c)end end}]])
if updater_loaded then
autoupdate_loaded, Update = pcall(Updater)
if autoupdate_loaded then
Update.json_url = "https://raw.githubusercontent.com/qrlk/rtimer/master/version.json?" .. tostring(os.clock())
Update.prefix = "[" .. string.upper(thisScript().name) .. "]: "
Update.url = "https://github.com/qrlk/rtimer"
end
end
end
--------------------------------------VAR---------------------------------------
color = 0x348cb2
local inicfg = require 'inicfg'
local prefix = '['..string.upper(thisScript().name)..']: '
local dlstatus = require('moonloader').download_status
local settings = inicfg.load({
options =
{
startmessage = 1,
autoupdate = 1,
},
ugon =
{
isactive = 1,
count = 0,
cooldown = 900,
sound = 1,
allcount = 0,
money = 0,
istxdactive = 1,
posX1 = 588,
posY1 = 428,
size1 = 0.5,
size2 = 2,
style1 = 3,
},
usedrugs =
{
isactive = 1,
sound = 1,
txdtype = 1,
--[Wait]
cooldown = 60,
--[DrugsPos]
posX1 = 56,
posY1 = 424,
--[DrugsSize]
size1 = 0.6,
size2 = 1.2,
--[DrugsStyle]
style1 = 3,
--[TimerPos]
posX2 = 80,
posY2 = 315,
--[TimerSize]
size3 = 0.4,
size4 = 2,
--[TimerStyle]
style2 = 3,
--[KEY]
key = 88,
},
zadrottimer =
{
date = 0,
time = 0,
limit = 0,
posX1 = 591,
posY1 = 418,
size1 = 0.5,
size2 = 1.3,
style1 = 3,
text = "Limit"
},
}, 'rtimer\\settings.ini')
--------------------------------------------------------------------------------
-------------------------------BOOT ÐÀÇÄÅË ÑÊÐÈÏÒÀ------------------------------
--------------------------------------------------------------------------------
function main()
font = renderCreateFont("Arial", 16, 5) -- äëÿ èçìåíåíèÿ ðàçìåðà è øðèôòà ðåíäåðà äàëüíîáîÿ
while not isSampAvailable() do wait(10) end
if settings.options.autoupdate == 1 then
-- âûðåæè òóò, åñëè õî÷åøü îòêëþ÷èòü ïðîâåðêó îáíîâëåíèé
if autoupdate_loaded and enable_autoupdate and Update then
pcall(Update.check, Update.json_url, Update.prefix, Update.url)
end
-- âûðåæè òóò, åñëè õî÷åøü îòêëþ÷èòü ïðîâåðêó îáíîâëåíèé
end
firstload()
onload()
while sampGetCurrentServerName() == "SA-MP" do
wait(10)
end
if string.find(sampGetCurrentServerName(), 'Samp%-Rp.Ru') then
ugon = lua_thread.create(ugon)
usedrugs = lua_thread.create(usedrugs)
end
zadrottimer = lua_thread.create(zadrottimer)
while true do
wait(0)
if menutrigger ~= nil then menu() menutrigger = nil end
end
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------ÒÀÉÌÅÐ ÇÀÄÐÎÒÑÒÂÀ-------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function zadrottimer()
savehelper = 1
local time = settings.zadrottimer.time
if time > 3600 then
activehour = math.floor(time / 3600)
time = time % 3600
activeminute = math.floor(time / 60)
activesec = time % 60
else
activehour = 0
activeminute = math.floor(time / 60)
activesec = time % 60
end
while true do
wait(0)
if os.date("%x") ~= settings.zadrottimer.date and tonumber(os.date("%H")) > 4 then
settings.zadrottimer.date = os.date("%x")
settings.zadrottimer.time = 0
saveini(1);
end
if settings.zadrottimer.limit - settings.zadrottimer.time < 0 and settings.zadrottimer.limit ~= 0 then
sampTextdrawCreate(423, settings.zadrottimer.text, settings.zadrottimer.posX1, settings.zadrottimer.posY1)
sampTextdrawSetStyle(423, settings.zadrottimer.style1)
sampTextdrawSetLetterSizeAndColor(423, settings.zadrottimer.size1, settings.zadrottimer.size2, - 65536 )
sampTextdrawSetOutlineColor(423, 1, - 16777216)
elseif sampTextdrawIsExists(423) then
sampTextdrawDelete(423)
end
if isPlayerPlaying(PLAYER_PED) == true then
wait(1000)
settings.zadrottimer.time = settings.zadrottimer.time + 1
savehelper = savehelper + 1
local time = settings.zadrottimer.time
if time > 3600 then
activehour = math.floor(time / 3600)
time = time % 3600
activeminute = math.floor(time / 60)
activesec = time % 60
else
activehour = 0
activeminute = math.floor(time / 60)
activesec = time % 60
end
end
if savehelper > math.random(25, 60) then
savehelper = 1
saveini(1);
end
end
end
function rtime(limit)
if limit == 228966 then
local limiter = settings.zadrottimer.limit
if limiter > 3600 then
activehourlimiter = math.floor(limiter / 3600)
limiter = limiter % 3600
activeminutelimiter = math.floor(limiter / 60)
activeseclimiter = limiter % 60
elseif limiter > 0 then
activehourlimiter = 0
activeminutelimiter = math.floor(limiter / 60)
activeseclimiter = limiter % 60
end
sampShowDialog(987, "Èçìåíåíèå ëèìèòà", string.format("Òåêóùèé ëèìèò: "..tostring(activehourlimiter).." ÷. "..tostring(activeminutelimiter).." ì. "..tostring(activeseclimiter).." ñ.\nÅñëè âû õîòèòå óäàëèòü ëèìèò, ââåäèòå '0'\nÅñëè âû õîòèòå óñòàíîâèòü íîâûé ëèìèò, ââåäèòå âðåìÿ â ôîðìàòå '××:ÌÌ'"), "Âûáðàòü", "Çàêðûòü", 1)
while sampIsDialogActive(987) do wait(100) end
local resultMain, buttonMain, typ = sampHasDialogRespond(987)
if buttonMain == 1 then
rtime(sampGetCurrentDialogEditboxText(987))
end
else
local temph, tempm = string.match(limit, "(%d+):(%d+)")
limit = tonumber(limit)
if temph ~= nil and tempm ~= nil and tonumber(tempm) < 60 then
settings.zadrottimer.limit = temph * 3600 + tempm * 60
sampAddChatMessage("Óñòàíîâëåí íîâûé ëèìèò: "..settings.zadrottimer.limit.." ñåêóíä.", color)
saveini(1)
elseif limit == 0 then settings.zadrottimer.limit = 0
sampAddChatMessage("Óñòàíîâëåí íîâûé ëèìèò: 0 ñåêóíä.", color)
saveini(1)
elseif limit ~= 0 then
limited = settings.zadrottimer.limit - settings.zadrottimer.time
if limited > 3600 then
activehourlimit = math.floor(limited / 3600)
limited = limited % 3600
activeminutelimit = math.floor(limited / 60)
activeseclimit = limited % 60
elseif limited > 0 then
activehourlimit = 0
activeminutelimit = math.floor(limited / 60)
activeseclimit = limited % 60
elseif limited < 0 then
limited = limited * - 1
if limited > 3600 then
activehourlimit = math.floor(limited / 3600)
limited = limited % 3600
activeminutelimit = math.floor(limited / 60)
activeseclimit = limited % 60
elseif limited > 0 then
activehourlimit = 0
activeminutelimit = math.floor(limited / 60)
activeseclimit = limited % 60
end
limited = limited * - 1
end
if limited > 0 then
local limiter = settings.zadrottimer.limit
if limiter > 3600 then
activehourlimiter = math.floor(limiter / 3600)
limiter = limiter % 3600
activeminutelimiter = math.floor(limiter / 60)
activeseclimiter = limiter % 60
elseif limiter > 0 then
activehourlimiter = 0
activeminutelimiter = math.floor(limiter / 60)
activeseclimiter = limiter % 60
end
sampShowDialog(2343, "{348cb2}RTIMER: Òàéìåð çàäðîòñòâà.", "{ffcc00}Çà ñåãîäíÿ: "..activehour.." ÷. "..activeminute.." ì. " ..activesec.." ñ.\nÎñòàëîñü: "..activehourlimit.." ÷. "..activeminutelimit.." ì. "..activeseclimit.." ñ.\n\nÓñòàíîâëåííûé ëèìèò: "..settings.zadrottimer.limit.." ñ.\nÝòî "..activehourlimiter.." ÷. "..activeminutelimiter.." ì. "..activeseclimiter.." ñ.", "Çàêðûòü")
elseif settings.zadrottimer.limit == 0 then
sampShowDialog(2343, "{348cb2}RTIMER: Òàéìåð çàäðîòñòâà.", "{ffcc00}Çà ñåãîäíÿ: "..activehour.." ÷. "..activeminute.." ì. " ..activesec.." ñ.\nËèìèò íå óñòàíîâëåí.", "Çàêðûòü")
elseif settings.zadrottimer.limit ~= 0 then
sampShowDialog(2343, "{348cb2}RTIMER: Òàéìåð çàäðîòñòâà.", "{ffcc00}Çà ñåãîäíÿ: "..activehour.." ÷. "..activeminute.." ì. " ..activesec.." ñ.\n{ff0000}Ëèìèò ïðåâûøåí íà: "..activehourlimit.." ÷. "..activeminutelimit.." ì. "..activeseclimit.." ñ.", "Çàêðûòü")
addOneOffSound(0.0, 0.0, 0.0, 1139)
end
end
end
end
--------------------------------------------------------------------------------
-------------------------------ÍÀÑÒÐÎÉÊÈ ÇÀÄÐÎÒÒÀÉÌÀ----------------------------
--------------------------------------------------------------------------------
function cmdChangeZadrotTimerPos(param)
local ugonpostype = tonumber(param)
if ugonpostype == 0 then
local bckpX1 = settings.zadrottimer.posX1
local bckpY1 = settings.zadrottimer.posY1
local bckpS1 = settings.zadrottimer.size1
local bckpS2 = settings.zadrottimer.size2
sampShowDialog(3838, "Èçìåíåíèå ïîëîæåíèÿ è ðàçìåðà.", "{ffcc00}Èçìåíåíèå ïîëîæåíèÿ textdraw.\n{ffffff}Èçìåíèòü ïîëîæåíèå ìîæíî ñ ïîìîùüþ ñòðåëîê êëàâû.\n\n{ffcc00}Èçìåíåíèå ðàçìåðà textdraw.\n{ffffff}Èçìåíèòü ðàçìåð ÏÐÎÏÎÐÖÈÎÍÀËÜÍÎ ìîæíî ñ ïîìîùüþ {00ccff}'-'{ffffff} è {00ccff}'+'{ffffff}.\n{ffffff}Èçìåíèòü ðàçìåð ïî ãîðèçîíòàëè ìîæíî ñ ïîìîùüþ {00ccff}'9'{ffffff} è {00ccff}'0'{ffffff}.\n{ffffff}Èçìåíèòü ðàçìåð ïî âåðòèêàëè ìîæíî ñ ïîìîùüþ {00ccff}'7'{ffffff} è {00ccff}'8'{ffffff}.\n\n{ffcc00}Êàê ïðèíÿòü èçìåíåíèÿ?\n{ffffff}Íàæìèòå \"Enter\", ÷òîáû ïðèíÿòü èçìåíåíèÿ.\nÍàæìèòå ïðîáåë, ÷òîáû îòìåíèòü èçìåíåíèÿ.\n ìåíþ ìîæíî âîññòàíîâèòü äåôîëò.", "ß ïîíÿë")
while sampIsDialogActive(3838) == true do wait(100) end
while true do
wait(0)
if bckpY1 > 0 and bckpY1 < 480 and bckpX1 > 0 and bckpX1 < 640 then
wait(0)
sampTextdrawCreate(424, settings.zadrottimer.text, bckpX1, bckpY1)
sampTextdrawSetStyle(424, settings.zadrottimer.style1)
sampTextdrawSetLetterSizeAndColor(424, bckpS1, bckpS2, - 65536)
sampTextdrawSetOutlineColor(424, 1, - 16777216)
if isKeyDown(40) and bckpY1 + 1 < 480 then bckpY1 = bckpY1 + 1 end
if isKeyDown(38) and bckpY1 - 1 > 0 then bckpY1 = bckpY1 - 1 end
if isKeyDown(37) and bckpX1 - 1 > 0 then bckpX1 = bckpX1 - 1 end
if isKeyDown(39) and bckpX1 + 1 < 640 then bckpX1 = bckpX1 + 1 end
if isKeyJustPressed(57) then
if bckpS1 - 0.1 > 0 then
bckpS1 = bckpS1 - 0.1
end
end
if isKeyJustPressed(48) then
if bckpS1 + 0.1 > 0 then
bckpS1 = bckpS1 + 0.1
end
end
if isKeyJustPressed(55) then
if bckpS2 - 0.1 > 0 then
bckpS2 = bckpS2 - 0.1
end
end
if isKeyJustPressed(56) then
if bckpS2 + 0.1 > 0 then
bckpS2 = bckpS2 + 0.1
end
end
if isKeyJustPressed(189) then
if bckpS1 - 0.1 > 0 then
bckpS1 = bckpS1 - 0.1
bckpS2 = bckpS1 * 2.6
end
end
if isKeyJustPressed(187) then
if bckpS1 + 0.1 > 0 then
bckpS1 = bckpS1 + 0.1
bckpS2 = bckpS1 * 2.6
end
end
if isKeyJustPressed(13) then
settings.zadrottimer.posX1 = bckpX1
settings.zadrottimer.posY1 = bckpY1
settings.zadrottimer.size1 = bckpS1
settings.zadrottimer.size2 = bckpS2
sampTextdrawDelete(424)
addOneOffSound(0.0, 0.0, 0.0, 1052)
saveini(1)
zadrottimer:terminate()
zadrottimer:run()
break
end
if isKeyJustPressed(32) then
addOneOffSound(0.0, 0.0, 0.0, 1053)
sampTextdrawDelete(424)
zadrottimer:terminate()
zadrottimer:run()
break
end
end
end
end
if ugonpostype == 1 then
settings.zadrottimer.posX1 = 591
settings.zadrottimer.posY1 = 418
settings.zadrottimer.size1 = 0.5
settings.zadrottimer.size2 = 1.3
addOneOffSound(0.0, 0.0, 0.0, 1052)
saveini(1)
ugon:terminate()
ugon:run()
end
end
function cmdZadrotTimerDefault()
settings.zadrottimer.style1 = 3
settings.zadrottimer.posX1 = 591
settings.zadrottimer.posY1 = 418
settings.zadrottimer.size1 = 0.5
settings.zadrottimer.size2 = 1.3
settings.zadrottimer.text = "Limit"
saveini(1)
zadrottimer:terminate()
zadrottimer:run()
end
function cmdChangeZadrotTimerTxdStyle(param)
local txdstyle = tonumber(param)
settings.zadrottimer.style1 = txdstyle
addOneOffSound(0.0, 0.0, 0.0, 1052)
saveini(1)
zadrottimer:terminate()
zadrottimer:run()
end
function cmdZadrotTimerText()
sampShowDialog(988, "Èçìåíåíèå text'a ëèìèòà", string.format("Ââåäèòå òåêñò ëèìèòà"), "Âûáðàòü", "Çàêðûòü", 1)
while sampIsDialogActive(988) do wait(100) end
local resultMain, buttonMain, typ = sampHasDialogRespond(988)
if buttonMain == 1 then
settings.zadrottimer.text = sampGetCurrentDialogEditboxText(988)
saveini(1)
end
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------ÒÀÉÌÅÐ ÍÀÐÊÎÒÈÊÎÂ-------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function usedrugs()
if settings.usedrugs.isactive == 1 then
if settings.usedrugs.txdtype == 0 then
sampTextdrawCreate(420, "Drugs", settings.usedrugs.posX1, settings.usedrugs.posY1)
end
if settings.usedrugs.txdtype == 1 then
sampTextdrawCreate(420, "Drugs "..intim.usedrugs.kolvo, settings.usedrugs.posX1, settings.usedrugs.posY1)
end
if settings.usedrugs.txdtype == 2 then
sampTextdrawCreate(420, intim.usedrugs.kolvo, settings.usedrugs.posX1, settings.usedrugs.posY1)
end
lua_thread.create(usedrugskolvo)
ust = lua_thread.create(usedrugstimer)
sampTextdrawSetStyle(420, settings.usedrugs.style1)
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 13447886)
sampTextdrawSetOutlineColor(420, 1, - 16777216)
narkotrigger = true
while true do
wait(0)
if isKeyJustPressed(settings.usedrugs.key) and sampIsDialogActive() == false and sampIsChatInputActive() == false and isPauseMenuActive() == false then
if narkotrigger == true then
if stopscan == nil then stopscan = 0 end
kolvousedrugs = math.ceil((160 - getCharHealth(playerPed)) / 10)
if kolvousedrugs == 0 then kolvousedrugs = 1 end
if intim.usedrugs.kolvo ~= "???" and kolvousedrugs > tonumber(intim.usedrugs.kolvo) and tonumber(intim.usedrugs.kolvo) > 0 then kolvousedrugs = tonumber(intim.usedrugs.kolvo) end
if kolvousedrugs == 16 then kolvousedrugs = 15 end
if narkotrigger == true then sampSendChat("/usedrugs "..kolvousedrugs) narkotrigger = false end
chat99 = "1"
while chat99 ~= " Íåäîñòàòî÷íî íàðêîòèêîâ" and chat99 ~= " Íå ôëóäè!" do
stopscan = stopscan + 1
chat99, prefix, color1, pcolor = sampGetChatString(99)
wait(20)
if string.find(chat99, 'Îñòàòîê') then
intim.usedrugs.lasttime = os.time()
narkotrigger = false
stopscan = nil
saveini(2)
chat99 = nil
break
end
if stopscan > 100 then stopscan = nil narkotrigger = true break end
end
elseif isKeyDown(settings.usedrugs.key) then
wait(1000)
if isKeyDown(settings.usedrugs.key) then
sampSendChat("/usedrugs 1")
end
end
end
end
end
end
function usedrugstimer()
while true do
wait(0)
if narkotrigger == false then sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 65536 ) end
while narkotrigger == false do
wait(0)
sampTextdrawCreate(421, intim.usedrugs.lasttime + settings.usedrugs.cooldown - os.time(), settings.usedrugs.posX2, settings.usedrugs.posY2)
sampTextdrawSetStyle(421, settings.usedrugs.style2)
sampTextdrawSetLetterSizeAndColor(421, settings.usedrugs.size3, settings.usedrugs.size4, - 13447886)
sampTextdrawSetOutlineColor(421, 1, - 16777216)
if intim.usedrugs.lasttime + settings.usedrugs.cooldown <= os.time() then
sampTextdrawDelete(421)
if settings.usedrugs.sound == 1 and isKeyDown(settings.usedrugs.key) == false then addOneOffSound(0.0, 0.0, 0.0, 1057) end
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 13447886)
narkotrigger = true
end
end
end
end
function usedrugskolvo()
while true do
wait(0)
chat99, prefix, color1347, pcolor = sampGetChatString(99)
--ïîêóïêà â ïðèòîíå
if string.find(chat99, "(Ó âàñ åñòü (%d+) ãðàìì)") then
if string.match(chat99, "(%d+)", string.find(chat99, "(Ó âàñ åñòü (%d+) ãðàìì)")) ~= nil and string.match(chat99, "(%d+)", string.find(chat99, "(Ó âàñ åñòü (%d+) ãðàìì)")) ~= intim.usedrugs.kolvo then
intim.usedrugs.kolvo = string.match(chat99, "(%d+)", string.find(chat99, "(Ó âàñ åñòü (%d+) ãðàìì)"))
saveini(2)
if settings.usedrugs.txdtype == 1 then
sampTextdrawCreate(420, "Drugs "..intim.usedrugs.kolvo, settings.usedrugs.posX1, settings.usedrugs.posY1)
sampTextdrawSetStyle(420, settings.usedrugs.style1)
if os.time() < intim.usedrugs.lasttime + settings.usedrugs.cooldown then
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 65536 )
else
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 13447886)
end
sampTextdrawSetOutlineColor(420, 1, - 16777216)
end
if settings.usedrugs.txdtype == 2 then
sampTextdrawCreate(420, intim.usedrugs.kolvo, settings.usedrugs.posX1, settings.usedrugs.posY1)
sampTextdrawSetStyle(420, settings.usedrugs.style1)
if os.time() < intim.usedrugs.lasttime + settings.usedrugs.cooldown then
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 65536 )
else
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 13447886)
end
sampTextdrawSetOutlineColor(420, 1, - 16777216)
end
chat99 = nil
end
end
if chat99 == " Âû âçÿëè èç ñåéôà íàðêî" or chat99 == " Âû ïîëîæèëè â ñåéô íàðêî" then
intim.usedrugs.kolvo = "???"
saveini(2)
if settings.usedrugs.txdtype == 1 then
sampTextdrawCreate(420, "Drugs "..intim.usedrugs.kolvo, settings.usedrugs.posX1, settings.usedrugs.posY1)
sampTextdrawSetStyle(420, settings.usedrugs.style1)
if os.time() < intim.usedrugs.lasttime + settings.usedrugs.cooldown then
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 65536 )
else
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 13447886)
end
sampTextdrawSetOutlineColor(420, 1, - 16777216)
end
if settings.usedrugs.txdtype == 2 then
sampTextdrawCreate(420, intim.usedrugs.kolvo, settings.usedrugs.posX1, settings.usedrugs.posY1)
sampTextdrawSetStyle(420, settings.usedrugs.style1)
if os.time() < intim.usedrugs.lasttime + settings.usedrugs.cooldown then
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 65536 )
else
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 13447886)
end
sampTextdrawSetOutlineColor(420, 1, - 16777216)
end
chat99 = nil
end
--ïîêóïêà ñ ðóê, êðàæà, ïðîäàæà íà ðóêè.
chat98, prefix, color1345, pcolor = sampGetChatString(98)
chat99, prefix, color1345, pcolor = sampGetChatString(99)
if not string.find(chat98, " Âû êóïèëè ", 1, true) and not string.find(chat98, " ãðàìì çà ", 1, true) then trigger1 = true end
if not string.find(chat98, " êóïèë(à) ó âàñ ", 1, true) and not string.find(chat98, " ãðàìì ", 1, true) then trigger2 = true end
if ((string.find(chat99, "(( Îñòàòîê:", 1, true)) and not string.find(chat99, "ìàòåðèàëîâ", 1, true)) or chat99 == " Âû óêðàëè 150 ãðàìì íàðêîòè÷åñêèõ ëåêàðñòâ" or (string.find(chat98, " Âû êóïèëè ", 1, true) and not string.find(chat98, "Ó âàñ åñòü", 1, true) and string.find(chat98, " ãðàìì çà ", 1, true) and trigger1 == true) or (string.find(chat98, " êóïèë(à) ó âàñ ", 1, true) and string.find(chat98, " ãðàìì ", 1, true) and trigger2 == true) then
if string.match(chat98, "(%d+)") ~= nil or string.match(chat99, "(%d+)") then
if string.find(chat98, " Âû êóïèëè ", 1, true) then intim.usedrugs.kolvo = intim.usedrugs.kolvo + string.match(chat98, "(%d+)") trigger1 = false
elseif string.match(chat99, "(%d+)") ~= intim.usedrugs.kolvo and not string.find(chat98, " êóïèë(à) ó âàñ ", 1, true) then intim.usedrugs.kolvo = string.match(chat99, "(%d+)") end
if string.find(chat98, " êóïèë(à) ó âàñ ", 1, true) and string.find(chat98, " ãðàìì ", 1, true) then intim.usedrugs.kolvo = intim.usedrugs.kolvo - string.match(chat98, "(%d+)") trigger2 = false end
saveini(2)
if settings.usedrugs.txdtype == 1 then
sampTextdrawCreate(420, "Drugs "..intim.usedrugs.kolvo, settings.usedrugs.posX1, settings.usedrugs.posY1)
sampTextdrawSetStyle(420, settings.usedrugs.style1)
if os.time() < intim.usedrugs.lasttime + settings.usedrugs.cooldown then
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 65536 )
else
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 13447886)
end
sampTextdrawSetOutlineColor(420, 1, - 16777216)
end
if settings.usedrugs.txdtype == 2 then
sampTextdrawCreate(420, intim.usedrugs.kolvo, settings.usedrugs.posX1, settings.usedrugs.posY1)
sampTextdrawSetStyle(420, settings.usedrugs.style1)
if os.time() < intim.usedrugs.lasttime + settings.usedrugs.cooldown then
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 65536 )
else
sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 13447886)
end
sampTextdrawSetOutlineColor(420, 1, - 16777216)
end
chat98 = nil
end
end
end
end
--------------------------------------------------------------------------------
-------------------------------ÍÀÑÒÐÎÉÊÈ ÍÀÐÊÎÒÈÊÎÂ-----------------------------
--------------------------------------------------------------------------------
function cmdChangeDrugsHotkey()
sampShowDialog(989, "Èçìåíåíèå ãîðÿ÷åé êëàâèøè", "Íàæìèòå \"Îêåé\", ïîñëå ÷åãî íàæìèòå íóæíóþ êëàâèøó.\nÍàñòðîéêè áóäóò èçìåíåíû.", "Îêåé", "Çàêðûòü")
while sampIsDialogActive(989) do wait(100) end
local resultMain, buttonMain, typ = sampHasDialogRespond(988)
if buttonMain == 1 then
while ke1y == nil do
wait(0)
for i = 1, 200 do
if isKeyDown(i) then
settings.usedrugs.key = i
sampAddChatMessage("Óñòàíîâëåíà íîâàÿ ãîðÿ÷àÿ êëàâèøà - "..settings.usedrugs.key, color)
saveini(1) ke1y = 1 break
end
end
end
end
ke1y = nil
end
function cmdDrugsTxdDefault()
settings.usedrugs.style1 = 3
settings.usedrugs.posX1 = 56
settings.usedrugs.posY1 = 424
settings.usedrugs.size1 = 0.6
settings.usedrugs.size2 = 1.2
saveini(1)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
end
function cmdDrugsTimerDefault()
settings.usedrugs.style2 = 3
settings.usedrugs.posX2 = 80
settings.usedrugs.posY2 = 315
settings.usedrugs.size3 = 0.4
settings.usedrugs.size4 = 2
saveini(1)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
end
function cleardrugstxds()
sampTextdrawDelete(420)
sampTextdrawDelete(421)
end
function cmdChangeUsedrugsDelay()
sampShowDialog(989, "Óñòàíîâêà çàäåðæêè íàðêî", string.format("Ââåäèòå çàäåðæêó â ñåêóíäàõ.\nÒåêóùàÿ çàäåðæêà: "..settings.usedrugs.cooldown.." ñåê."), "Âûáðàòü", "Çàêðûòü", 1)
while sampIsDialogActive() do wait(100) end
if tonumber(sampGetCurrentDialogEditboxText(989)) ~= nil then
settings.usedrugs.cooldown = tonumber(sampGetCurrentDialogEditboxText(989))
saveini(1)
end
end
function cmdChangeUsedrugsActive()
if settings.usedrugs.isactive == 1 then settings.usedrugs.isactive = 0 sampAddChatMessage('[RTIMER]: Òàéìåð íàðêî äåàêòèâèðîâàí.', color) cleardrugstxds()
usedrugs:terminate()
else settings.usedrugs.isactive = 1 sampAddChatMessage('[RTIMER]: Òàéìåð íàðêî àêòèâèðîâàí.', color)
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
end
saveini(1)
end
function cmdChangeUsedrugsSoundActive()
if settings.usedrugs.sound == 1 then settings.usedrugs.sound = 0 sampAddChatMessage('[RTIMER]: "ÏÄÈÍÜ" ïðè èñòå÷åíèè êä íàðêî âûêëþ÷åí.', color) else settings.usedrugs.sound = 1 sampAddChatMessage('[RTIMER]: "ÏÄÈÍÜ" ïðè èñòå÷åíèè êä íàðêî âêëþ÷åí.', color)
end
saveini(1)
end
function cmdChangeDrugsTxdType(param)
local txdtype = tonumber(param)
if txdtype == 0 then settings.usedrugs.txdtype = 0 end
if txdtype == 1 then settings.usedrugs.txdtype = 1 end
if txdtype == 2 then settings.usedrugs.txdtype = 2 end
saveini(1)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
end
function cmdChangeDrugsPos(param)
local drugspostype = tonumber(param)
if drugspostype == 0 then
local bckpX1 = settings.usedrugs.posX1
local bckpY1 = settings.usedrugs.posY1
local bckpS1 = settings.usedrugs.size1
local bckpS2 = settings.usedrugs.size2
sampShowDialog(3838, "Èçìåíåíèå ïîëîæåíèÿ è ðàçìåðà.", "{ffcc00}Èçìåíåíèå ïîëîæåíèÿ textdraw.\n{ffffff}Èçìåíèòü ïîëîæåíèå ìîæíî ñ ïîìîùüþ ñòðåëîê êëàâû.\n\n{ffcc00}Èçìåíåíèå ðàçìåðà textdraw.\n{ffffff}Èçìåíèòü ðàçìåð ÏÐÎÏÎÐÖÈÎÍÀËÜÍÎ ìîæíî ñ ïîìîùüþ {00ccff}'-'{ffffff} è {00ccff}'+'{ffffff}.\n{ffffff}Èçìåíèòü ðàçìåð ïî ãîðèçîíòàëè ìîæíî ñ ïîìîùüþ {00ccff}'9'{ffffff} è {00ccff}'0'{ffffff}.\n{ffffff}Èçìåíèòü ðàçìåð ïî âåðòèêàëè ìîæíî ñ ïîìîùüþ {00ccff}'7'{ffffff} è {00ccff}'8'{ffffff}.\n\n{ffcc00}Êàê ïðèíÿòü èçìåíåíèÿ?\n{ffffff}Íàæìèòå \"Enter\", ÷òîáû ïðèíÿòü èçìåíåíèÿ.\nÍàæìèòå ïðîáåë, ÷òîáû îòìåíèòü èçìåíåíèÿ.\n ìåíþ ìîæíî âîññòàíîâèòü äåôîëò.", "ß ïîíÿë")
while sampIsDialogActive(3838) == true do wait(100) end
while true do
wait(0)
if bckpY1 > 0 and bckpY1 < 480 and bckpX1 > 0 and bckpX1 < 640 then
wait(0)
if isKeyDown(40) and bckpY1 + 1 < 480 then bckpY1 = bckpY1 + 1 end
if isKeyDown(38) and bckpY1 - 1 > 0 then bckpY1 = bckpY1 - 1 end
if isKeyDown(37) and bckpX1 - 1 > 0 then bckpX1 = bckpX1 - 1 end
if isKeyDown(39) and bckpX1 + 1 < 640 then bckpX1 = bckpX1 + 1 end
if isKeyJustPressed(57) then
if bckpS1 - 0.1 > 0 then
bckpS1 = bckpS1 - 0.1
end
end
if isKeyJustPressed(48) then
if bckpS1 + 0.1 > 0 then
bckpS1 = bckpS1 + 0.1
end
end
if isKeyJustPressed(55) then
if bckpS2 - 0.1 > 0 then
bckpS2 = bckpS2 - 0.1
end
end
if isKeyJustPressed(56) then
if bckpS2 + 0.1 > 0 then
bckpS2 = bckpS2 + 0.1
end
end
if isKeyJustPressed(189) then
if bckpS1 - 0.1 > 0 then
bckpS1 = bckpS1 - 0.1
bckpS2 = bckpS1 * 2
end
end
if isKeyJustPressed(187) then
if bckpS1 + 0.1 > 0 then
bckpS1 = bckpS1 + 0.1
bckpS2 = bckpS1 * 2
end
end
if settings.usedrugs.isactive == 1 then
if settings.usedrugs.txdtype == 0 then
sampTextdrawCreate(420, "Drugs", bckpX1, bckpY1)
end
if settings.usedrugs.txdtype == 1 then
sampTextdrawCreate(420, "Drugs "..intim.usedrugs.kolvo, bckpX1, bckpY1)
end
if settings.usedrugs.txdtype == 2 then
sampTextdrawCreate(420, intim.usedrugs.kolvo, bckpX1, bckpY1)
end
sampTextdrawSetStyle(420, settings.usedrugs.style1)
sampTextdrawSetLetterSizeAndColor(420, bckpS1, bckpS2, - 13447886)
sampTextdrawSetOutlineColor(420, 1, - 16777216)
end
if isKeyJustPressed(13) then
settings.usedrugs.posX1 = bckpX1
settings.usedrugs.posY1 = bckpY1
settings.usedrugs.size1 = bckpS1
settings.usedrugs.size2 = bckpS2
addOneOffSound(0.0, 0.0, 0.0, 1052)
saveini(1)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
break
end
if isKeyJustPressed(32) then
addOneOffSound(0.0, 0.0, 0.0, 1053)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
break
end
end
end
end
if drugspostype == 1 then
settings.usedrugs.posX1 = 56
settings.usedrugs.posY1 = 424
settings.usedrugs.size1 = 0.6
settings.usedrugs.size2 = 1.2
addOneOffSound(0.0, 0.0, 0.0, 1052)
saveini(1)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
end
end
function cmdChangeDrugsTimerPos(param)
local drugspostype = tonumber(param)
if drugspostype == 0 then
local bckpX1 = settings.usedrugs.posX2
local bckpY1 = settings.usedrugs.posY2
local bckpS1 = settings.usedrugs.size3
local bckpS2 = settings.usedrugs.size4
sampShowDialog(3838, "Èçìåíåíèå ïîëîæåíèÿ è ðàçìåðà.", "{ffcc00}Èçìåíåíèå ïîëîæåíèÿ textdraw.\n{ffffff}Èçìåíèòü ïîëîæåíèå ìîæíî ñ ïîìîùüþ ñòðåëîê êëàâû.\n\n{ffcc00}Èçìåíåíèå ðàçìåðà textdraw.\n{ffffff}Èçìåíèòü ðàçìåð ÏÐÎÏÎÐÖÈÎÍÀËÜÍÎ ìîæíî ñ ïîìîùüþ {00ccff}'-'{ffffff} è {00ccff}'+'{ffffff}.\n{ffffff}Èçìåíèòü ðàçìåð ïî ãîðèçîíòàëè ìîæíî ñ ïîìîùüþ {00ccff}'9'{ffffff} è {00ccff}'0'{ffffff}.\n{ffffff}Èçìåíèòü ðàçìåð ïî âåðòèêàëè ìîæíî ñ ïîìîùüþ {00ccff}'7'{ffffff} è {00ccff}'8'{ffffff}.\n\n{ffcc00}Êàê ïðèíÿòü èçìåíåíèÿ?\n{ffffff}Íàæìèòå \"Enter\", ÷òîáû ïðèíÿòü èçìåíåíèÿ.\nÍàæìèòå ïðîáåë, ÷òîáû îòìåíèòü èçìåíåíèÿ.\n ìåíþ ìîæíî âîññòàíîâèòü äåôîëò.", "ß ïîíÿë")
while sampIsDialogActive(3838) == true do wait(100) end
while true do
wait(0)
if bckpY1 > 0 and bckpY1 < 480 and bckpX1 > 0 and bckpX1 < 640 then
wait(0)
if isKeyDown(40) and bckpY1 + 1 < 480 then bckpY1 = bckpY1 + 1 end
if isKeyDown(38) and bckpY1 - 1 > 0 then bckpY1 = bckpY1 - 1 end
if isKeyDown(37) and bckpX1 - 1 > 0 then bckpX1 = bckpX1 - 1 end
if isKeyDown(39) and bckpX1 + 1 < 640 then bckpX1 = bckpX1 + 1 end
if isKeyJustPressed(57) then
if bckpS1 - 0.1 > 0 then
bckpS1 = bckpS1 - 0.1
end
end
if isKeyJustPressed(48) then
if bckpS1 + 0.1 > 0 then
bckpS1 = bckpS1 + 0.1
end
end
if isKeyJustPressed(55) then
if bckpS2 - 0.1 > 0 then
bckpS2 = bckpS2 - 0.1
end
end
if isKeyJustPressed(56) then
if bckpS2 + 0.1 > 0 then
bckpS2 = bckpS2 + 0.1
end
end
if isKeyJustPressed(57) then
if bckpS1 - 0.1 > 0 then
bckpS1 = bckpS1 - 0.1
end
end
if isKeyJustPressed(48) then
if bckpS1 + 0.1 > 0 then
bckpS1 = bckpS1 + 0.1
end
end
if isKeyJustPressed(55) then
if bckpS2 - 0.1 > 0 then
bckpS2 = bckpS2 - 0.1
end
end
if isKeyJustPressed(56) then
if bckpS2 + 0.1 > 0 then
bckpS2 = bckpS2 + 0.1
end
end
if isKeyJustPressed(189) then
if bckpS1 - 0.1 > 0 then
bckpS1 = bckpS1 - 0.1
bckpS2 = bckpS1 * 5
end
end
if isKeyJustPressed(187) then
if bckpS1 + 0.1 > 0 then
bckpS1 = bckpS1 + 0.1
bckpS2 = bckpS1 * 5
end
end
if settings.usedrugs.isactive == 1 then
sampTextdrawCreate(422, "69", bckpX1, bckpY1)
sampTextdrawSetStyle(422, settings.usedrugs.style2)
sampTextdrawSetLetterSizeAndColor(422, bckpS1, bckpS2, - 13447886)
sampTextdrawSetOutlineColor(422, 1, - 16777216)
end
if isKeyJustPressed(13) then
sampTextdrawDelete(422)
if narkotrigger == false then sampTextdrawSetLetterSizeAndColor(420, settings.usedrugs.size1, settings.usedrugs.size2, - 65536 ) end
settings.usedrugs.posX2 = bckpX1
settings.usedrugs.posY2 = bckpY1
settings.usedrugs.size3 = bckpS1
settings.usedrugs.size4 = bckpS2
addOneOffSound(0.0, 0.0, 0.0, 1052)
saveini(1)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
break
end
if isKeyJustPressed(32) then
sampTextdrawDelete(422)
addOneOffSound(0.0, 0.0, 0.0, 1053)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
break
end
end
end
end
if drugspostype == 1 then
sampTextdrawDelete(421)
settings.usedrugs.posX2 = 80
settings.usedrugs.posY2 = 315
settings.usedrugs.size3 = 0.4
settings.usedrugs.size4 = 2
addOneOffSound(0.0, 0.0, 0.0, 1052)
saveini(1)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
end
end
function cmdChangeDrugsTxdStyle(param)
local txdstyle = tonumber(param)
settings.usedrugs.style1 = txdstyle
addOneOffSound(0.0, 0.0, 0.0, 1052)
saveini(1)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
end
function cmdChangeDrugsTimerTxdStyle(param)
local txdstyle = tonumber(param)
settings.usedrugs.style2 = txdstyle
addOneOffSound(0.0, 0.0, 0.0, 1052)
saveini(1)
usedrugs:terminate()
if narkotrigger == false then
usedrugs:run()
wait(100)
narkotrigger = false
else
usedrugs:run()
end
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------ÒÀÉÌÅÐ ÀÂÒÎÓÃÎÍÀ--------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function ugonscanner()
while true do
wait(0)
while intim.ugon.notif == 1 do
chatscanner99, prefix, colorscanner97, pcolor = sampGetChatString(99)
for i = 90, 99 do
wait(10)
chatscanner, prefix, colorscanner, pcolor = sampGetChatString(i)
end
end
end
end
function getmoney()
while true do
wait(0)
while triggermoney == true do
wait(0)
money = getPlayerMoney()
wait(10000)
end
end
end
function min20()
while true do
wait(0)
while Enablemin20 do
wait(1200000)
if Enablemin20 == true then stopugon = nil end
Enablemin20 = false
end
end
end
function test1()
sampAddChatMessage(" Ïîäîáíóþ òà÷êó íàøè ïàðíè íåäàâíî âèäåëè. ß îáîçíà÷èë ðàéîí íà òâîåé êàðòå.")
end
function ugon()
lua_thread.create(ugonscanner)
triggermoney = true
lua_thread.create(getmoney)
lua_thread.create(min20)
while true do
wait(0)
if settings.ugon.isactive == 1 then
if chatscanner99 == " Ïîäîáíóþ òà÷êó íàøè ïàðíè íåäàâíî âèäåëè. ß îáîçíà÷èë ðàéîí íà òâîåé êàðòå." and stopugon == nil then
settings.ugon.allcount = settings.ugon.allcount + 1
stopugon = 1
Enablemin20 = true
sampAddChatMessage("[RTIMER]: Çàôèêñèðîâàíî "..settings.ugon.allcount.."-å âçÿòèå óãîíà! Óäà÷íûõ: "..settings.ugon.count.."/"..settings.ugon.allcount.."! Âñåãî çàðàáîòàíî: "..settings.ugon.money.." âèðò!", color)
inicfg.save(settings, "rtimer\\settings")
end
if chatscanner99 == " SMS: Òû ìåíÿ îãîð÷èë!" then stopugon = nil end
if chatscanner == " Îòëè÷íàÿ òà÷êà. Áóäåò íóæíà ðàáîòà, ïðèõîäè." and intim.ugon.notif == 1 then
triggermoney = false
intim.ugon.lasttime = os.time()
settings.ugon.count = settings.ugon.count + 1
intim.ugon.notif = 0
stopugon = nil
Enablemin20 = false
wait(1000)