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!support.lua
6511 lines (6188 loc) · 253 KB
/
!support.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"
script_name("Support's Heaven")
script_author("qrlk")
script_version("25.06.2022")
script_dependencies('CLEO 4+', 'SAMPFUNCS', 'Dear Imgui', 'SAMP.Lua')
script_moonloader(026)
script_url("https://github.com/qrlk/supports-heaven")
-- 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://85c7f1ca1c124c69a9231cc5915ca046@o1272228.ingest.sentry.io/6530068" })
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/supports-heaven/master/version.json?" .. tostring(os.clock())
Update.prefix = "[" .. string.upper(thisScript().name) .. "]: "
Update.url = "https://github.com/qrlk/supports-heaven"
end
end
end
script_changelog = [[ v25.06.2022
* NEW: Äîáàâëåíà ñèñòåìà ñáîðà îøèáîê ñêðèïòà.
* UPD: Ñèñòåìà àâòîîáíîâëåíèÿ çàìåíåíà íà áîëåå ñòàáèëüíóþ.
v28.08.2021
* UPD: Àäàïòàöèÿ ïîä èçìåíåíèå íàçâàíèé ñåðâåðîâ ñàìï-ðï.
v22.08.2021
* UPD: Äîáàâëåíî îïðåäåëåíà ìîäà ñåðâåðà ïî åãî íàçâàíèþ.
* UPD: Ñèñòåìà àâòîîáíîâëåíèÿ îáíîâëåíà äî ïîñëåäíåé âåðñèè.
v11.05.2021
* UPD: Îáíîâëåíû IP àäðåñà ñåðâåðîâ.
v04.05.2021
* UPD: Îáíîâëåíû IP àäðåñà ñåðâåðîâ.
v23.02.2021-1
* UPD: Ìåëêîå èçìåíåíèå ñèñòåìû àâòîîáíîâëåíèÿ è ñòàòèñòèêè.
* UPD: Îáíîâëåíû IP àäðåñà ñåðâåðîâ.
v1.10 [14.03.2019]
* FIX: Èñïðàâåíà ñèñòåìà ïðîâåðêè ëèöåíçèè.
* FIX: Îáíîâëåíû ññûëêè íà íîâûé ñàéò ñêðèïòåðà.
v1.09 [11.11.2018]
* FIX: Àäàïòàöèÿ Samp-Rp ê îáíîâëåíèþ 11.11.
v1.08 [16.10.2018]
* NEW: Ïîëíàÿ ïîääåðæêà Evolve-Rp, êðîìå êíîïêè ïðîâåðêè àôê â ñìñ-ìåññåíäæåðå.
* INFO: Äàííîå îáíîâëåíèå íèêàê íå ïîâëèÿëî íà ñàïïîðòîâ Samp-Rp.
v1.07 [20.09.2018]
* FIX: çàâèñàíèå â ãëàâíîì ìåíþ âåðîÿòíî èñïðàâëåíî. Ïðîáëåìà ñâÿçàíà ñ ôèêñîì v1.05, ïîýòîìó àâòî /sduty ìîæåò âíîâü
ðàáîòàòü íåêîððåêòíî, íî ýòî ëó÷øå, ÷åì âèñíóòü íàìåðòâî ïîñëå 10 ñåêóíä èãðû.
Îáíîâëÿþ ñêðèïò òàê êàê óñòàë ñêèäûâàòü âðåìåííûé ôèêñ íîâûì ïîëüçîâàòåëÿì.
* FIX: ïåðåí¸ñ ôàéë àâòîîáíîâëåíèÿ íà ñâîé ñàéò, ò.ê. ó íåê ïîëüçîâàòåëåé âîçíèêàëè ïðîáëåìû ñ äîñòóïîì ê gitlab.
v1.06 [21.08.2018]
* FIX: âûëåò "in function 'sampGetPlayerNickname'".
* FIX: âûëåò "cannot resume non-suspended coroutine stack traceback: [C]: in function 'sampGetCurrentServerAddress'"
* FIX: âûëåò "cannot resume non-suspended coroutine stack traceback: [C]: in function 'sampGetPlayerNickname'"
* FIX: âûëåò "attempt to index global 'sms' (a nil value)"
* FIX: âûëåò "bad argument #1 to 'ipairs' (table expected, got nil) in function 'getKeysName'"
* FIX: âûëåò "bad argument #1 to 'pairs' (table expected, got nil) in function 'imgui_settings_6_sms_messanger'" * FIX: òåïåðü ñêðèïò äîëæåí êîððåêòíî çàõâàòûâàòü íèêè èãðîêîâ ñ öèôðàìè.
v1.05 [20.07.2018]
* FIX: àâòî /sduty.
v1.04 [18.07.2018]
* Óìåíüøåí áóôåð ïîëÿ ââîäà ó ìåññåíäæåðîâ.
* Íåñêîëüêî ìåëêèõ ôèêñîâ.
v1.03 [17.07.2018]
* /hh äëÿ ÷àòà.
* /hc äëÿ ÷àòà.
* FIX: áûñòðàÿ îñòàíîâêà àâòî ïðè íàæàòèè õîòêåÿ ñ ïîëåì ââîäà.
* FIX: sduty - äèàëîã íå ñ÷èòàåòñÿ íåïðî÷èòàííûì ïðè îòâåòå ÷åðåç /pm.
* FIX: sms - äèàëîã íå ñ÷èòàåòñÿ íåïðî÷èòàííûì ïðè îòâåòå ÷åðåç /sms.
* FIX: ñïèñêè äèàëîãîâ ñìñ çàâèñèëè îò íàñòðîåê sduty.
v1.02 [16.07.2018]
* FIX: èçìåíåíèå öâåòà âîïðîñà.
v1.01 [16.07.2018]
* FIX: âûëåò ñêðèïòà ïðè ïîñòóïëåíèè âîïðîñà/îòâåòà.
* FIX: èçìåí¸ííûå öâåòà òåïåðü ñîõðàíÿþòñÿ ïðàâèëüíî.
* FIX: òåïåðü ñêðèïò ïðàâèëüíî ðàáîòàåò ñ 0 id.
v1.0 [15.07.2018]
* Ðåëèç ñêðèïòà.]]
--require
do
-- This is your secret 67-bit key (any random bits are OK)
local Key53 = 8186484168865098
local Key14 = 4887
local inv256
function decode(str)
local K, F = Key53, 16384 + Key14
return (str:gsub('%x%x',
function(c)
local L = K % 274877906944 -- 2^38
local H = (K - L) / 274877906944
local M = H % 128
c = tonumber(c, 16)
local m = (c + (H - M) / 128) * (2 * M + 1) % 256
K = L * F + H + c + m
return string.char(m)
end))
end
end
do
function r_smart_cleo_and_sampfuncs()
if isSampfuncsLoaded() == false then
while not isPlayerPlaying(PLAYER_HANDLE) do wait(100) end
wait(1000)
setPlayerControl(PLAYER_HANDLE, false)
setGxtEntry('CMLUTTL', 'Support\'s Heaven')
setGxtEntry('CMLUMSG', 'Skriptu nuzhen SAMPFUNCS.asi dlya raboty.~n~~w~Esli net CLEO, to tozhe budet ustanovlen.~n~~w~Hotite chtoby ya ego skachal?~n~~w~')
setGxtEntry('CMLUYES', 'Da!')
setGxtEntry('CMLUY', 'Ne, otkroy ssylku, ia sam!')
setGxtEntry('CMLUNO', 'Net!')
local menu = createMenu('CMLUTTL', 120, 110, 400, 1, true, true, 1)
local dummy = 'DUMMY'
setMenuColumn(menu, 0, 'CMLUMSG', dummy, dummy, dummy, dummy, 'CMLUYES', 'CMLUY', 'CMLUNO', dummy, dummy, dummy, dummy, dummy, dummy)
setActiveMenuItem(menu, 4)
while true do
wait(0)
if isButtonPressed(PLAYER_HANDLE, 15) or isButtonPressed(PLAYER_HANDLE, 16) then
if getMenuItemSelected(menu) == 4 then
pass = true
if not isCleoLoaded() then
pass = false
downloadUrlToFile("http://qrlk.me/dev/moonloader/cleo.asi", getGameDirectory().."\\cleo.asi",
function(id, status, p1, p2)
if status == 5 then
printStringNow(string.format("CLEO.asi: %d KB / %d KB", p1 / 1000, p2 / 1000), 5000)
elseif status == 58 then
printStringNow("CLEO.asi installed.", 5000)
pass = true
end
end
)
end
while pass ~= true do wait(100) end
downloadUrlToFile("http://qrlk.me/dev/moonloader/SAMPFUNCS.asi", getGameDirectory().."\\SAMPFUNCS.asi",
function(id, status, p1, p2)
if status == 5 then
printStringNow(string.format("SAMPFUNCS.asi: %d KB / %d KB", p1 / 1000, p2 / 1000), 5000)
elseif status == 58 then
printStringNow("Installed. You MUST RESTART the game!", 5000)
thisScript():unload()
end
end
)
end
if getMenuItemSelected(menu) == 5 then
local ffi = require 'ffi'
ffi.cdef [[
void* __stdcall ShellExecuteA(void* hwnd, const char* op, const char* file, const char* params, const char* dir, int show_cmd);
uint32_t __stdcall CoInitializeEx(void*, uint32_t);
]]
local shell32 = ffi.load 'Shell32'
local ole32 = ffi.load 'Ole32'
ole32.CoInitializeEx(nil, 2 + 4) -- COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE
deleteMenu(menu)
print(shell32.ShellExecuteA(nil, 'open', 'https://blast.hk/threads/17/', nil, nil, 1))
thisScript():unload()
end
break
end
end
wait(0)
deleteMenu(menu)
setPlayerControl(PLAYER_HANDLE, true)
end
end
function r_smart_lib_imgui()
if not pcall(function() imgui = require 'imgui' end) then
waiter = true
local prefix = "[Support's Heaven]: "
local color = 0xffa500
sampAddChatMessage(prefix.."Ìîäóëü Dear ImGui çàãðóæåí íåóäà÷íî. Äëÿ ðàáîòû ñêðèïòà ýòîò ìîäóëü îáÿçàòåëåí.", color)
sampAddChatMessage(prefix.."Ñðåäñòâî àâòîìàòè÷åñêîãî èñïðàâëåíèÿ îøèáîê ìîæåò ïîïðîáîâàòü ñêà÷àòü ìîäóëü çà âàñ.", color)
sampAddChatMessage(prefix.."Íàæìèòå F2, ÷òîáû çàïóñòèòü ñðåäñòâî àâòîìàòè÷åñêîãî èñïðàâëåíèÿ îøèáîê.", color)
while not wasKeyPressed(113) do wait(10) end
if wasKeyPressed(113) then
sampAddChatMessage(prefix.."Çàïóñêàþ ñðåäñòâî àâòîìàòè÷åñêîãî èñïðàâëåíèÿ îøèáîê.", color)
local imguifiles = {
[getGameDirectory().."\\moonloader\\lib\\imgui.lua"] = "http://qrlk.me/dev/moonloader/lib/imgui.lua",
[getGameDirectory().."\\moonloader\\lib\\MoonImGui.dll"] = "http://qrlk.me/dev/moonloader/lib/MoonImGui.dll"
}
createDirectory(getGameDirectory().."\\moonloader\\lib\\")
for k, v in pairs(imguifiles) do
if doesFileExist(k) then
sampAddChatMessage(prefix.."Ôàéë "..k.." íàéäåí.", color)
sampAddChatMessage(prefix.."Óäàëÿþ "..k.." è ñêà÷èâàþ ïîñëåäíþþ äîñòóïíóþ âåðñèþ.", color)
os.remove(k)
else
sampAddChatMessage(prefix.."Ôàéë "..k.." íå íàéäåí.", color)
end
sampAddChatMessage(prefix.."Ññûëêà: "..v..". Ïðîáóþ ñêà÷àòü.", color)
pass = false
wait(1500)
downloadUrlToFile(v, k,
function(id, status, p1, p2)
if status == 5 then
sampAddChatMessage(string.format(prefix..k..' - Çàãðóæåíî %d KB èç %d KB.', p1 / 1000, p2 / 1000), color)
elseif status == 58 then
sampAddChatMessage(prefix..k..' - Çàãðóçêà çàâåðøåíà.', color)
pass = true
end
end
)
while pass == false do wait(1) end
end
sampAddChatMessage(prefix.."Êàæåòñÿ, âñå ôàéëû çàãðóæåíû. Ïîïðîáóþ çàïóñòèòü ìîäóëü Dear ImGui åù¸ ðàç.", color)
local status, err = pcall(function() imgui = require 'imgui' end)
if status then
sampAddChatMessage(prefix.."Ìîäóëü Dear ImGui óñïåøíî çàãðóæåí!", color)
waiter = false
waitforreload = true
else
sampAddChatMessage(prefix.."Ìîäóëü Dear ImGui çàãðóæåí íåóäà÷íî!", color)
sampAddChatMessage(prefix.."Îáðàòèòåñü â ïîääåðæêó ñêðèïòà (vk.me/qrlk.mods), ïðèëîæèâ ôàéë moonloader.log", color)
print(err)
for k, v in pairs(imguifiles) do
print(k.." - "..tostring(doesFileExist(k)).." from "..v)
end
thisScript():unload()
end
end
end
while waiter do wait(100) end
end
function r_smart_lib_samp_events()
if not pcall(function() RPC = require 'lib.samp.events' end) then
waiter = true
local prefix = "[Support's Heaven]: "
local color = 0xffa500
sampAddChatMessage(prefix.."Ìîäóëü SAMP.Lua çàãðóæåí íåóäà÷íî. Äëÿ ðàáîòû ñêðèïòà ýòîò ìîäóëü îáÿçàòåëåí.", color)
sampAddChatMessage(prefix.."Ñðåäñòâî àâòîìàòè÷åñêîãî èñïðàâëåíèÿ îøèáîê ìîæåò ïîïðîáîâàòü ñêà÷àòü ìîäóëü çà âàñ.", color)
sampAddChatMessage(prefix.."Íàæìèòå F2, ÷òîáû çàïóñòèòü ñðåäñòâî àâòîìàòè÷åñêîãî èñïðàâëåíèÿ îøèáîê.", color)
while not wasKeyPressed(113) do wait(10) end
if wasKeyPressed(113) then
sampAddChatMessage(prefix.."Çàïóñêàþ ñðåäñòâî àâòîìàòè÷åñêîãî èñïðàâëåíèÿ îøèáîê.", color)
local sampluafiles = {
[getGameDirectory().."\\moonloader\\lib\\samp\\events.lua"] = "https://raw.githubusercontent.com/THE-FYP/SAMP.Lua/master/samp/events.lua",
[getGameDirectory().."\\moonloader\\lib\\samp\\raknet.lua"] = "https://raw.githubusercontent.com/THE-FYP/SAMP.Lua/master/samp/raknet.lua",
[getGameDirectory().."\\moonloader\\lib\\samp\\synchronization.lua"] = "https://raw.githubusercontent.com/THE-FYP/SAMP.Lua/master/samp/synchronization.lua",
[getGameDirectory().."\\moonloader\\lib\\samp\\events\\bitstream_io.lua"] = "https://raw.githubusercontent.com/THE-FYP/SAMP.Lua/master/samp/events/bitstream_io.lua",
[getGameDirectory().."\\moonloader\\lib\\samp\\events\\core.lua"] = "https://raw.githubusercontent.com/THE-FYP/SAMP.Lua/master/samp/events/core.lua",
[getGameDirectory().."\\moonloader\\lib\\samp\\events\\bitstream_io.lua"] = "https://raw.githubusercontent.com/THE-FYP/SAMP.Lua/master/samp/events/bitstream_io.lua",
[getGameDirectory().."\\moonloader\\lib\\samp\\events\\extra_types.lua"] = "https://raw.githubusercontent.com/THE-FYP/SAMP.Lua/master/samp/events/extra_types.lua",
[getGameDirectory().."\\moonloader\\lib\\samp\\events\\handlers.lua"] = "https://raw.githubusercontent.com/THE-FYP/SAMP.Lua/master/samp/events/handlers.lua",
[getGameDirectory().."\\moonloader\\lib\\samp\\events\\utils.lua"] = "https://raw.githubusercontent.com/THE-FYP/SAMP.Lua/master/samp/events/utils.lua",
}
createDirectory(getGameDirectory().."\\moonloader\\lib\\samp\\events")
for k, v in pairs(sampluafiles) do
if doesFileExist(k) then
sampAddChatMessage(prefix.."Ôàéë "..k.." íàéäåí.", color)
sampAddChatMessage(prefix.."Óäàëÿþ "..k.." è ñêà÷èâàþ ïîñëåäíþþ äîñòóïíóþ âåðñèþ.", color)
os.remove(k)
else
sampAddChatMessage(prefix.."Ôàéë "..k.." íå íàéäåí.", color)
end
sampAddChatMessage(prefix.."Ññûëêà: "..v..". Ïðîáóþ ñêà÷àòü.", color)
pass = false
wait(1500)
downloadUrlToFile(v, k,
function(id, status, p1, p2)
if status == 5 then
sampAddChatMessage(string.format(prefix..k..' - Çàãðóæåíî %d KB èç %d KB.', p1 / 1000, p2 / 1000), color)
elseif status == 58 then
sampAddChatMessage(prefix..k..' - Çàãðóçêà çàâåðøåíà.', color)
pass = true
end
end
)
while pass == false do wait(1) end
end
sampAddChatMessage(prefix.."Êàæåòñÿ, âñå ôàéëû çàãðóæåíû. Ïîïðîáóþ çàïóñòèòü ìîäóëü SAMP.Lua åù¸ ðàç.", color)
local status1, err = pcall(function() RPC = require 'lib.samp.events' end)
if status1 then
sampAddChatMessage(prefix.."Ìîäóëü SAMP.Lua óñïåøíî çàãðóæåí!", color)
waiter = false
waitforreload = true
else
sampAddChatMessage(prefix.."Ìîäóëü SAMP.Lua çàãðóæåí íåóäà÷íî!", color)
sampAddChatMessage(prefix.."Îáðàòèòåñü â ïîääåðæêó ñêðèïòà (vk.me/qrlk.mods), ïðèëîæèâ ôàéë moonloader.log", color)
print(err)
for k, v in pairs(sampluafiles) do
print(k.." - "..tostring(doesFileExist(k)).." from "..v)
end
thisScript():unload()
end
end
end
while waiter do wait(100) end
end
function r_smart_get_projectresources()
if not doesDirectoryExist(getGameDirectory().."\\moonloader\\resource\\sup\\"..licensemod) then
local prefix = "[Support's Heaven]: "
local color = 0xffa500
sampAddChatMessage(prefix.."Äëÿ ðàáîòû ñêðèïòà íóæíà ïàïêà ñ ðåñóðñàìè, çàãîòîâëåííûìè äëÿ âàøåãî ïðîåêòà.", color)
sampAddChatMessage(prefix.."Íàæìèòå F2, ÷òîáû çàïóñòèòü ñêà÷èâàíèå ôàéëîâ äëÿ ïðîåêòà "..mode, color)
while not wasKeyPressed(113) do wait(10) end
if wasKeyPressed(113) then
createDirectory(getGameDirectory().."\\moonloader\\resource\\sup\\"..mode)
local path = getGameDirectory().."\\moonloader\\resource\\sup\\"..mode.."\\"
local webpath = "http://qrlk.me/dev/moonloader/support's_heaven/resource/sup/"..mode.."/"
resourcesf = {
[path.."house.txt"] = webpath.."house.txt",
[path.."vehicle.txt"] = webpath.."vehicle.txt",
[path.."spur.txt"] = webpath.."spur.txt",
}
for k, v in pairs(resourcesf) do
sampAddChatMessage(prefix..v.." -> "..k, color)
pass = false
wait(100)
downloadUrlToFile(v, k,
function(id, status, p1, p2)
if status == 5 then
sampAddChatMessage(string.format(prefix..k..' - Çàãðóæåíî %d KB èç %d KB.', p1 / 1000, p2 / 1000), color)
elseif status == 58 then
sampAddChatMessage(prefix..k..' - Çàãðóçêà çàâåðøåíà.', color)
pass = true
end
end
)
while pass == false do wait(1) end
end
kol = 0
for _ in io.lines(path.."spur.txt") do
kol = kol + 1
end
for i = 1, kol do
k = path..i..".png"
v = webpath..i..".png"
sampAddChatMessage(prefix..v.." -> "..k, color)
pass = false
wait(100)
downloadUrlToFile(v, k,
function(id, status, p1, p2)
if status == 5 then
sampAddChatMessage(string.format(prefix..k..' - Çàãðóæåíî %d KB èç %d KB.', p1 / 1000, p2 / 1000), color)
elseif status == 58 then
sampAddChatMessage(prefix..k..' - Çàãðóçêà çàâåðøåíà.', color)
pass = true
end
end
)
while pass == false do wait(1) end
end
end
end
end
function r_smart_get_sounds()
if not doesDirectoryExist(getGameDirectory().."\\moonloader\\resource\\sup\\sounds\\") then
createDirectory(getGameDirectory().."\\moonloader\\resource\\sup\\sounds\\")
end
kols = 0
for i = 1, currentaudiokol do
local file = getGameDirectory().."\\moonloader\\resource\\sup\\sounds\\"..i..".mp3"
if not doesFileExist(file) then
kols = kols + 1
end
end
if kols > 0 then
local prefix = "[Support's Heaven]: "
local color = 0xffa500
sampAddChatMessage(prefix.."Äëÿ ðàáîòû ñêðèïòà íóæíî äîêà÷àòü "..kols.." àóäèîôàéëîâ.", color)
sampAddChatMessage(prefix.."Íàæìèòå F2, ÷òîáû çàïóñòèòü ñêà÷èâàíèå àóäèîôàéëîâ.", color)
while not wasKeyPressed(113) do wait(10) end
if wasKeyPressed(113) then
createDirectory(getGameDirectory().."\\moonloader\\resource\\sup\\"..mode)
for i = 1, 100 do
local file = getGameDirectory().."\\moonloader\\resource\\sup\\sounds\\"..i..".mp3"
if not doesFileExist(file) then
v = "http://qrlk.me/dev/moonloader/support's_heaven/resource/sup/sounds/"..i..".mp3"
k = file
sampAddChatMessage(prefix..v.." -> "..k, color)
pass = false
wait(10)
downloadUrlToFile(v, k,
function(id, status, p1, p2)
if status == 5 then
sampAddChatMessage(string.format(prefix..k..' - Çàãðóæåíî %d KB èç %d KB.', p1 / 1000, p2 / 1000), color)
elseif status == 58 then
sampAddChatMessage(prefix..k..' - Çàãðóçêà çàâåðøåíà.', color)
pass = true
end
end
)
while pass == false do wait(1) end
end
end
end
end
end
function r_lib_rkeys()
--[[Register HotKey for MoonLoader
Author: DonHomka
Functions:
- bool result, int id = registerHotKey(table keys, bool pressed, function callback)
- bool result, int count = unRegisterHotKey(table keys)
- bool result, int id = isHotKeyDefined(table keys)
- bool result, int id = blockNextHotKey(table keys)
- bool result, int count = unBlockNextHotKey(table keys)
- bool result, int id = isBlockedHotKey(table keys)
- table keys = getCurrentHotKey()
- table keys = getAllHotKey()
HotKey data:
- table keys Return table keys for active hotkey
- bool pressed True - wasKeyPressed() / False - isKeyDown()
- function callback Call this function on active hotkey
E-mail: a.skinfy@gmail.com
VK: http://vk.com/DonHomka
TeleGramm: http://t.me/DonHomka
Discord: DonHomka#2534]]
local vkeys = require 'lib.vkeys'
vkeys.key_names[vkeys.VK_LMENU] = "LAlt"
vkeys.key_names[vkeys.VK_RMENU] = "RAlt"
vkeys.key_names[vkeys.VK_LSHIFT] = "LShift"
vkeys.key_names[vkeys.VK_RSHIFT] = "RShift"
vkeys.key_names[vkeys.VK_LCONTROL] = "LCtrl"
vkeys.key_names[vkeys.VK_RCONTROL] = "RCtrl"
local tHotKey = {}
local tKeyList = {}
local tKeysCheck = {}
local iCountCheck = 0
local tBlockKeys = {[vkeys.VK_LMENU] = true, [vkeys.VK_RMENU] = true, [vkeys.VK_RSHIFT] = true, [vkeys.VK_LSHIFT] = true, [vkeys.VK_LCONTROL] = true, [vkeys.VK_RCONTROL] = true}
local tModKeys = {[vkeys.VK_MENU] = true, [vkeys.VK_SHIFT] = true, [vkeys.VK_CONTROL] = true}
local tBlockNext = {}
local module = {}
module._VERSION = "1.0.7"
module._MODKEYS = tModKeys
module._LOCKKEYS = false
local function getKeyNum(id)
for k, v in pairs(tKeyList) do
if v == id then
return k
end
end
return 0
end
function module.blockNextHotKey(keys)
local bool = false
if not module.isBlockedHotKey(keys) then
tBlockNext[#tBlockNext + 1] = keys
bool = true
end
return bool
end
function module.isHotKeyHotKey(keys, keys2)
local bool
for k, v in pairs(keys) do
local lBool = true
for i = 1, #keys2 do
if v ~= keys2[i] then
lBool = false
break
end
end
if lBool then
bool = true
break
end
end
return bool
end
function module.isBlockedHotKey(keys)
local bool, hkId = false, - 1
for k, v in pairs(tBlockNext) do
if module.isHotKeyHotKey(keys, v) then
bool = true
hkId = k
break
end
end
return bool, hkId
end
function module.unBlockNextHotKey(keys)
local result = false
local count = 0
while module.isBlockedHotKey(keys) do
local _, id = module.isBlockedHotKey(keys)
tHotKey[id] = nil
result = true
count = count + 1
end
local id = 1
for k, v in pairs(tBlockNext) do
tBlockNext[id] = v
id = id + 1
end
return result, count
end
function module.isKeyModified(id)
return (tModKeys[id] or false) or (tBlockKeys[id] or false)
end
function module.isModifiedDown()
local bool = false
for k, v in pairs(tModKeys) do
if isKeyDown(k) then
bool = true
break
end
end
return bool
end
lua_thread.create(
function ()
while true do
wait(0)
tDownKeys = module.getCurrentHotKey()
for k, v in pairs(tHotKey) do
if #v.keys > 0 then
local bool = true
for i = 1, #v.keys do
if i ~= #v.keys and (getKeyNum(v.keys[i]) > getKeyNum(v.keys[i + 1]) or getKeyNum(v.keys[i]) == 0) then
bool = false
break
elseif i == #v.keys and (v.pressed and not wasKeyPressed(v.keys[i]) or not v.pressed and not isKeyDown(v.keys[i])) or (#v.keys == 1 and module.isModifiedDown()) then
bool = false
break
end
end
if bool and ((module.onHotKey and module.onHotKey(k, v.keys) ~= false) or module.onHotKey == nil) then
local result, id = module.isBlockedHotKey(v.keys)
if not result then
v.callback(k, v.keys)
else
tBlockNext[id] = nil
end
end
end
end
end
end
)
function module.registerHotKey(keys, pressed, callback)
tHotKey[#tHotKey + 1] = {keys = keys, pressed = pressed, callback = callback}
return true, #tHotKey
end
function module.getAllHotKey()
return tHotKey
end
function module.unRegisterHotKey(keys)
local result = false
local count = 0
while module.isHotKeyDefined(keys) do
local _, id = module.isHotKeyDefined(keys)
tHotKey[id] = nil
result = true
count = count + 1
end
local id = 1
local tNewHotKey = {}
for k, v in pairs(tHotKey) do
tNewHotKey[id] = v
id = id + 1
end
tHotKey = tNewHotKey
return result, count
end
function module.isHotKeyDefined(keys)
local bool, hkId = false, - 1
for k, v in pairs(tHotKey) do
if module.isHotKeyHotKey(keys, v.keys) then
bool = true
hkId = k
break
end
end
return bool, hkId
end
function module.getKeysName(keys)
local tKeysName = {}
for k, v in ipairs(keys) do
tKeysName[k] = vkeys.id_to_name(v)
end
return tKeysName
end
function module.getCurrentHotKey(type)
local type = type or 0
local tCurKeys = {}
for k, v in pairs(vkeys) do
if tBlockKeys[v] == nil then
local num, down = getKeyNum(v), isKeyDown(v)
if down and num == 0 then
tKeyList[#tKeyList + 1] = v
elseif num > 0 and not down then
tKeyList[num] = nil
end
end
end
local i = 1
for k, v in pairs(tKeyList) do
tCurKeys[i] = type == 0 and v or vkeys.id_to_name(v)
i = i + 1
end
return tCurKeys
end
return module
end
function r_lib_imcustom_hotkey()
local vkeys = require 'lib.vkeys'
local rkeys = r_lib_rkeys()
local wm = require "lib.windows.message"
local tBlockKeys = {[vkeys.VK_RETURN] = true, [vkeys.VK_T] = true, [vkeys.VK_F6] = true, [vkeys.VK_F8] = true}
local tBlockChar = {[116] = true, [84] = true}
local tBlockNextDown = {}
local module = {}
module._VERSION = "1.1.5"
module._SETTINGS = {
noKeysMessage = "No"
}
local tHotKeyData = {
edit = nil,
save = {}
}
local tKeys = {}
function module.HotKey(name, keys, lastkeys, width)
local width = width or 90
local name = tostring(name)
local lastkeys = lastkeys or {}
local keys, bool = keys or {}, false
lastkeys.v = keys.v
local sKeys = table.concat(rkeys.getKeysName(keys.v), " + ")
if #tHotKeyData.save > 0 and tostring(tHotKeyData.save[1]) == name then
keys.v = tHotKeyData.save[2]
sKeys = table.concat(rkeys.getKeysName(keys.v), " + ")
tHotKeyData.save = {}
bool = true
elseif tHotKeyData.edit ~= nil and tostring(tHotKeyData.edit) == name then
if #tKeys == 0 then
sKeys = os.time() % 2 == 0 and module._SETTINGS.noKeysMessage or " "
else
sKeys = table.concat(rkeys.getKeysName(tKeys), " + ")
end
end
imgui.PushStyleColor(imgui.Col.Button, imgui.GetStyle().Colors[imgui.Col.FrameBg])
imgui.PushStyleColor(imgui.Col.ButtonHovered, imgui.GetStyle().Colors[imgui.Col.FrameBgHovered])
imgui.PushStyleColor(imgui.Col.ButtonActive, imgui.GetStyle().Colors[imgui.Col.FrameBgActive])
if imgui.Button((tostring(sKeys):len() == 0 and module._SETTINGS.noKeysMessage or sKeys) .. name, imgui.ImVec2(width, 0)) then
tHotKeyData.edit = name
end
imgui.PopStyleColor(3)
return bool
end
function module.getCurrentEdit()
return tHotKeyData.edit ~= nil
end
function module.getKeysList(bool)
local bool = bool or false
local tKeysList = {}
if bool then
for k, v in ipairs(tKeys) do
tKeysList[k] = vkeys.id_to_name(v)
end
else
tKeysList = tKeys
end
return tKeysList
end
function module.getKeyNumber(id)
for k, v in ipairs(tKeys) do
if v == id then
return k
end
end
return - 1
end
local function reloadKeysList()
local tNewKeys = {}
for k, v in pairs(tKeys) do
tNewKeys[#tNewKeys + 1] = v
end
tKeys = tNewKeys
return true
end
addEventHandler("onWindowMessage",
function (msg, wparam, lparam)
if tHotKeyData.edit ~= nil and msg == wm.WM_CHAR then
if tBlockChar[wparam] then
consumeWindowMessage(true, true)
end
end
if msg == wm.WM_KEYDOWN or msg == wm.WM_SYSKEYDOWN then
if tHotKeyData.edit ~= nil and wparam == vkeys.VK_ESCAPE then
tKeys = {}
tHotKeyData.edit = nil
consumeWindowMessage(true, true)
end
if tHotKeyData.edit ~= nil and wparam == vkeys.VK_BACK then
tHotKeyData.save = {tHotKeyData.edit, {}}
tHotKeyData.edit = nil
consumeWindowMessage(true, true)
end
local num = module.getKeyNumber(wparam)
if num == -1 then
tKeys[#tKeys + 1] = wparam
if tHotKeyData.edit ~= nil then
if not rkeys.isKeyModified(wparam) then
tHotKeyData.save = {tHotKeyData.edit, tKeys}
tHotKeyData.edit = nil
tKeys = {}
consumeWindowMessage(true, true)
end
end
end
reloadKeysList()
if tHotKeyData.edit ~= nil then
consumeWindowMessage(true, true)
end
elseif msg == wm.WM_KEYUP or msg == wm.WM_SYSKEYUP then
local num = module.getKeyNumber(wparam)
if num > - 1 then
tKeys[num] = nil
end
reloadKeysList()
if tHotKeyData.edit ~= nil then
consumeWindowMessage(true, true)
end
end
end
)
return module
end
end
--------------------------------------VAR---------------------------------------
function var_require()
r_smart_cleo_and_sampfuncs()
while isSampfuncsLoaded() ~= true do wait(100) end
while not isSampAvailable() do wait(10) end
if getMoonloaderVersion() < 026 then
local prefix = "[Support's Heaven]: "
local color = 0xffa500
sampAddChatMessage(prefix.."Âàøà âåðñèÿ MoonLoader íå ïîääåðæèâàåòñÿ.", color)
sampAddChatMessage("Ïîæàëóéñòà, ñêà÷àéòå ïîñëåäíþþ âåðñèþ MoonLoader.", color)
thisScript():unload()
end
-- âûðåæè òóò, åñëè õî÷åøü îòêëþ÷èòü ïðîâåðêó îáíîâëåíèé
if autoupdate_loaded and enable_autoupdate and Update then
pcall(Update.check, Update.json_url, Update.prefix, Update.url)
end
-- âûðåæè òóò, åñëè õî÷åøü îòêëþ÷èòü ïðîâåðêó îáíîâëåíèé
currentprice = "0 RUB"
currentbuylink = "http://qrlk.me"
currentaudiokol = 100
currentpromodis = "-%"
inicfg = require "inicfg"
PROVERKA = true
while sampGetCurrentServerName() == "SA-MP" do wait(100) end
local _1, myid = sampGetPlayerIdByCharHandle(PLAYER_PED)
licensenick, licenseserver, licensemod = sampGetPlayerNickname(myid), sampGetCurrentServerAddress(), getmode(sampGetCurrentServerAddress()) or getModeByServerName(sampGetCurrentServerName())
mode = licensemod
while not sampIsLocalPlayerSpawned() do wait(1) end
r_smart_lib_imgui()
ihk = r_lib_imcustom_hotkey()
hk = r_lib_rkeys()
imgui_init()
ihk._SETTINGS.noKeysMessage = ("-")
encoding = require 'lib.encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
as_action = require('moonloader').audiostream_state
key = require "lib.vkeys"
apply_custom_style()
var_cfg()
var_imgui_ImBool()
var_imgui_ImFloat4_ImColor()
var_imgui_ImInt()
var_imgui_ImBuffer()
var_main()
r_smart_get_projectresources()
r_smart_get_sounds()
r_smart_lib_samp_events()
RPC_init()
end
function getmode(args)
local servers = {
["95.181.158.74"] = "samp-rp",
["95.181.158.63"] = "samp-rp",
["95.181.158.69"] = "samp-rp",
["95.181.158.77"] = "samp-rp",
["185.169.134.67"] = "evolve-rp",
["185.169.134.68"] = "evolve-rp",
["185.169.134.91"] = "evolve-rp",
}
return servers[args]
end
local serversNames = {
["SRP"] = "samp-rp",
["Samp-Rp"] = "samp-rp",
["Evolve"] = "evolve-rp",
}
function getModeByServerName(sname)
for k, v in pairs(serversNames) do
if string.find(sname, k, 1, true) then
return v
end
end
end
function var_cfg()
cfg = inicfg.load({
options =
{
ReplaceQuestionColor = true,
MouseDrawCursor = false,
ReplaceAnswerColor = false,
ReplaceAnswerOthersColor = false,
ReplaceSmsInColor = true,
ReplaceSmsOutColor = false,
ReplaceSmsReceivedColor = false,
ShowTimeToUpdateCSV = false,
HideQuestion = false,
HideAnswer = false,
HideAnswerOthers = false,
HideSmsIn = false,
HideSmsOut = false,
HideSmsReceived = true,
SoundQuestion = false,
SoundQuestionNumber = 1,
SoundAnswerOthers = false,
SoundAnswerOthersNumber = 22,
SoundAnswer = true,
SoundAnswerNumber = 88,
SoundSmsIn = false,
SoundSmsInNumber = 22,
SoundSmsOut = true,
SoundSmsOutNumber = 88,
settingstab = 1,
debug = false,
},
counter = {
active = true,
minute = tonumber(os.date("%M")),
hour = tonumber(os.date("%H")),
day = tonumber(os.date("%d")),
month = tonumber(os.date("%m")),
year = tonumber(os.date("%Y")),
},
only = {
messanger = false,
notepad = false,
logviewer = false,
histogram = false,
info = false,
settings = false,
counter = false,
},
supfuncs = {
fastrespondviachat = true,
fastrespondviadialog = true,
unanswereddialog = true,
suphh = true,
suphc = true,
fastrespondviadialoglastid = true,
autosduty = true,
},
log = {
active = true,
logger = true,
height = 120,
},
stats = {
active = true,
height = 160,
},
hkUnAn = {
[1] = 112,
},
hkSupFRChat = {
[1] = 49,
},
hkFRbyBASE = {
[1] = 50
},
hkFO_notepad = {
[1] = 51
},
hkMainMenu = {
[1] = 90
},
hkSpur = {
[1] = 88
},
hkm1 = {
[1] = 52
},
hkm2 = {
[1] = 53
},
hkm3 = {
[1] = 54
},
hkm4 = {
[1] = 55
},
hkm5 = {
[1] = 56
},
colors =
{
QuestionColor = imgui.ImColor(0, 255, 38):GetU32(),
AnswerColor = imgui.ImColor(255, 255, 255):GetU32(),
AnswerColorOthers = imgui.ImColor(255, 255, 255):GetU32(),
SmsInColor = imgui.ImColor(0, 255, 166):GetU32(),
SmsOutColor = imgui.ImColor(255, 255, 255):GetU32(),
SmsReceivedColor = imgui.ImColor(255, 255, 255):GetU32(),
},
menuwindow =
{
Width = 800,
Height = 400,
PosX = 80,
PosY = 310,
},
spur = {
active = true,
autoresize = true,
Width = 800,
Height = 400,
PosX = 80,
PosY = 310,
tab = 1,
mode = 1,
proportion = true,
lupa = true,
onlyresized = true,
},
messanger =
{
hotkey1 = true,
hotkey2 = true,