· 9 years ago · Jul 02, 2017, 12:32 AM
1; COMPILER: v1.1.23.05>
2; BOTZ.CC | ryano
3#IfWinActive, GTA:SA:MP
4#SingleInstance, force
5#Persistent
6#NoEnv
7global ERROR_OK := 0
8global ERROR_PROCESS_NOT_FOUND := 1
9global ERROR_OPEN_PROCESS := 2
10global ERROR_INVALID_HANDLE := 3
11global ERROR_MODULE_NOT_FOUND := 4
12global ERROR_ENUM_PROCESS_MODULES := 5
13global ERROR_ZONE_NOT_FOUND := 6
14global ERROR_CITY_NOT_FOUND := 7
15global ERROR_READ_MEMORY := 8
16global ERROR_WRITE_MEMORY := 9
17global ERROR_ALLOC_MEMORY := 10
18global ERROR_FREE_MEMORY := 11
19global ERROR_WAIT_FOR_OBJECT := 12
20global ERROR_CREATE_THREAD := 13
21global ADDR_ZONECODE := 0xA49AD4
22global ADDR_POSITION_X := 0xB6F2E4
23global ADDR_POSITION_Y := 0xB6F2E8
24global ADDR_POSITION_Z := 0xB6F2EC
25global ADDR_CPED_PTR := 0xB6F5F0
26global ADDR_CPED_HPOFF := 0x540
27global ADDR_CPED_ARMOROFF := 0x548
28global ADDR_CPED_MONEY := 0x0B7CE54
29global ADDR_CPED_INTID := 0xA4ACE8
30global ADDR_CPED_SKINIDOFF := 0x22
31global ADDR_VEHICLE_PTR := 0xBA18FC
32global ADDR_VEHICLE_HPOFF := 0x4C0
33global ADDR_VEHICLE_DOORSTATE := 0x4F8
34global ADDR_VEHICLE_ENGINESTATE := 0x428
35global ADDR_VEHICLE_LIGHTSTATE := 0x584
36global ADDR_VEHICLE_MODEL := 0x22
37global ADDR_VEHICLE_TYPE := 0x590
38global ADDR_VEHICLE_DRIVER := 0x460
39global ADDR_VEHICLE_X := 0x44
40global ADDR_VEHICLE_Y := 0x48
41global ADDR_VEHICLE_Z := 0x4C
42global oAirplaneModels := [417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593]
43global oBikeModels := [481,509,510]
44global ovehicleNames := ["Landstalker","Bravura","Buffalo","Linerunner","Perrenial","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Whoopee","BFInjection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RCBandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley'sRCVan","Skimmer","PCJ-600","Faggio","Freeway","RCBaron","RCRaider","Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR-350","Walton","Regina","Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","NewsChopper","Rancher","FBIRancher","Virgo","Greenwood","Jetmax","Hotring","Sandking","BlistaCompact","PoliceMaverick","Boxvillde","Benson","Mesa","RCGoblin","HotringRacerA","HotringRacerB","BloodringBanger","Rancher","SuperGT","Elegant","Journey","Bike","MountainBike","Beagle","Cropduster","Stunt","Tanker","Roadtrain","Nebula","Majestic","Buccaneer","Shamal","hydra","FCR-900","NRG-500","HPV1000","CementTruck","TowTruck","Fortune","Cadrona","FBITruck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster","Monster","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RCTiger","Flash","Tahoma","Savanna","Bandito","FreightFlat","StreakCarriage","Kart","Mower","Dune","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","NewsVan","Tug","Trailer","Emperor","Wayfarer","Euros","Hotdog","Club","FreightBox","Trailer","Andromada","Dodo","RCCam","Launch","PoliceCar","PoliceCar","PoliceCar","PoliceRanger","Picador","S.W.A.T","Alpha","Phoenix","GlendaleShit","SadlerShit","Luggage","Luggage","Stairs","Boxville","Tiller","UtilityTrailer"]
45global oweaponNames := ["Fist","Brass Knuckles","Golf Club","Nightstick","Knife","Baseball Bat","Shovel","Pool Cue","Katana","Chainsaw","Purple Dildo","Dildo","Vibrator","Silver Vibrator","Flowers","Cane","Grenade","Tear Gas","Molotov Cocktail", "", "", "", "9mm","Silenced 9mm","Desert Eagle","Shotgun","Sawnoff Shotgun","Combat Shotgun","Micro SMG/Uzi","MP5","AK-47","M4","Tec-9","Country Rifle","Sniper Rifle","RPG","HS Rocket","Flamethrower","Minigun","Satchel Charge","Detonator","Spraycan","Fire Extinguisher","Camera","Night Vis Goggles","Thermal Goggles","Parachute"]
46global oradiostationNames := ["Playback FM", "K Rose", "K-DST", "Bounce FM", "SF-UR", "Radio Los Santos", "Radio X", "CSR 103.9", "K-JAH West", "Master Sounds 98.3", "WCTR Talk Radio", "User Track Player", "Radio Off"]
47global oweatherNames := ["EXTRASUNNY_LA", "SUNNY_LA", "EXTRASUNNY_SMOG_LA", "SUNNY_SMOG_LA", "CLOUDY_LA", "SUNNY_SF", "EXTRASUNNY_SF", "CLOUDY_SF", "RAINY_SF", "FOGGY_SF", "SUNNY_VEGAS", "EXTRASUNNY_VEGAS", "CLOUDY_VEGAS", "EXTRASUNNY_COUNTRYSIDE", "SUNNY_COUNTRYSIDE", "CLOUDY_COUNTRYSIDE", "RAINY_COUNTRYSIDE", "EXTRASUNNY_DESERT", "SUNNY_DESERT", "SANDSTORM_DESERT", "UNDERWATER", "EXTRACOLOURS_1", "EXTRACOLOURS_2"]
48global ADDR_SAMP_INCHAT_PTR := 0x21a10c
49global ADDR_SAMP_INCHAT_PTR_OFF := 0x55
50global ADDR_SAMP_USERNAME := 0x219A6F
51global FUNC_SAMP_SENDCMD := 0x65c60
52global FUNC_SAMP_SENDSAY := 0x57f0
53global FUNC_SAMP_ADDTOCHATWND := 0x64520
54global ADDR_SAMP_CHATMSG_PTR := 0x21a0e4
55global FUNC_SAMP_SHOWGAMETEXT := 0x9c2c0
56global FUNC_SAMP_PLAYAUDIOSTR := 0x62da0
57global FUNC_SAMP_STOPAUDIOSTR := 0x629a0
58global DIALOG_STYLE_MSGBOX := 0
59global DIALOG_STYLE_INPUT := 1
60global DIALOG_STYLE_LIST := 2
61global DIALOG_STYLE_PASSWORD := 3
62global DIALOG_STYLE_TABLIST := 4
63global DIALOG_STYLE_TABLIST_HEADERS := 5
64global SAMP_DIALOG_STRUCT_PTR := 0x21A0B8
65global SAMP_DIALOG_PTR1_OFFSET := 0x1C
66global SAMP_DIALOG_LINES_OFFSET := 0x44C
67global SAMP_DIALOG_INDEX_OFFSET := 0x443
68global SAMP_DIALOG_BUTTON_HOVERING_OFFSET := 0x465
69global SAMP_DIALOG_BUTTON_CLICKED_OFFSET := 0x466
70global SAMP_DIALOG_PTR2_OFFSET := 0x20
71global SAMP_DIALOG_LINECOUNT_OFFSET := 0x150
72global SAMP_DIALOG_OPEN_OFFSET := 0x28
73global SAMP_DIALOG_STYLE_OFFSET := 0x2C
74global SAMP_DIALOG_ID_OFFSET := 0x30
75global SAMP_DIALOG_TEXT_PTR_OFFSET := 0x34
76global SAMP_DIALOG_CAPTION_OFFSET := 0x40
77global FUNC_SAMP_SHOWDIALOG := 0x6B9C0
78global FUNC_SAMP_CLOSEDIALOG := 0x6C040
79global FUNC_UPDATESCOREBOARD := 0x8A10
80global SAMP_INFO_OFFSET := 0x21A0F8
81global ADDR_SAMP_CRASHREPORT := 0x5CF2C
82global SAMP_PPOOLS_OFFSET := 0x3CD
83global SAMP_PPOOL_PLAYER_OFFSET := 0x18
84global SAMP_SLOCALPLAYERID_OFFSET := 0x4
85global SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET := 0x1A
86global SAMP_SZLOCALPLAYERNAME_OFFSET := 0xA
87global SAMP_PSZLOCALPLAYERNAME_OFFSET := 0xA
88global SAMP_PREMOTEPLAYER_OFFSET := 0x2E
89global SAMP_ISTRLENNAME___OFFSET := 0x1C
90global SAMP_SZPLAYERNAME_OFFSET := 0xC
91global SAMP_PSZPLAYERNAME_OFFSET := 0xC
92global SAMP_ILOCALPLAYERPING_OFFSET := 0x26
93global SAMP_ILOCALPLAYERSCORE_OFFSET := 0x2A
94global SAMP_IPING_OFFSET := 0x28
95global SAMP_ISCORE_OFFSET := 0x24
96global SAMP_ISNPC_OFFSET := 0x4
97global SAMP_PLAYER_MAX := 1004
98global CheckpointCheck := 0xC7DEEA
99global rmaddrs := [0xC7DEC8, 0xC7DECC, 0xC7DED0]
100global SIZE_SAMP_CHATMSG := 0xFC
101global hGTA := 0x0
102global dwGTAPID := 0x0
103global dwSAMP := 0x0
104global pMemory := 0x0
105global pParam1 := 0x0
106global pParam2 := 0x0
107global pParam3 := 0x0
108global pParam4 := 0x0
109global pParam5 := 0x0
110global pInjectFunc := 0x0
111global nZone := 1
112global nCity := 1
113global bInitZaC := 0
114global iRefreshScoreboard := 0
115global oScoreboardData := ""
116global iRefreshHandles := 0
117global iUpdateTick := 2500
118IsSAMPAvailable() {
119if(!checkHandles())
120return false
121dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
122if(dwChatInfo == 0 || dwChatInfo == "ERROR")
123{
124return false
125}
126else
127{
128return true
129}
130}
131isInChat() {
132if(!checkHandles())
133return -1
134dwPtr := dwSAMP + ADDR_SAMP_INCHAT_PTR
135dwAddress := readDWORD(hGTA, dwPtr) + ADDR_SAMP_INCHAT_PTR_OFF
136if(ErrorLevel) {
137ErrorLevel := ERROR_READ_MEMORY
138return -1
139}
140dwInChat := readDWORD(hGTA, dwAddress)
141if(ErrorLevel) {
142ErrorLevel := ERROR_READ_MEMORY
143return -1
144}
145ErrorLevel := ERROR_OK
146if(dwInChat > 0) {
147return true
148} else {
149return false
150}
151}
152getUsername() {
153if(!checkHandles())
154return ""
155dwAddress := dwSAMP + ADDR_SAMP_USERNAME
156sUsername := readString(hGTA, dwAddress, 25)
157if(ErrorLevel) {
158ErrorLevel := ERROR_READ_MEMORY
159return ""
160}
161ErrorLevel := ERROR_OK
162return sUsername
163}
164getId() {
165s:=getUsername()
166return getPlayerIdByName(s)
167}
168SendChat(wText) {
169wText := "" wText
170if(!checkHandles())
171return false
172dwFunc:=0
173if(SubStr(wText, 1, 1) == "/") {
174dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
175} else {
176dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
177}
178callWithParams(hGTA, dwFunc, [["s", wText]], false)
179ErrorLevel := ERROR_OK
180return true
181}
182addChatMessage(wText) {
183wText := "" wText
184if(!checkHandles())
185return false
186dwFunc := dwSAMP + FUNC_SAMP_ADDTOCHATWND
187dwChatInfo := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
188if(ErrorLevel) {
189ErrorLevel := ERROR_READ_MEMORY
190return false
191}
192callWithParams(hGTA, dwFunc, [["p", dwChatInfo], ["s", wText]], true)
193ErrorLevel := ERROR_OK
194return true
195}
196showGameText(wText, dwTime, dwSize) {
197wText := "" wText
198dwTime += 0
199dwTime := Floor(dwTime)
200dwSize += 0
201dwSize := Floor(dwSize)
202if(!checkHandles())
203return false
204dwFunc := dwSAMP + FUNC_SAMP_SHOWGAMETEXT
205callWithParams(hGTA, dwFunc, [["s", wText], ["i", dwTime], ["i", dwSize]], false)
206ErrorLevel := ERROR_OK
207return true
208}
209playAudioStream(wUrl) {
210wUrl := "" wUrl
211if(!checkHandles())
212return false
213dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
214patchRadio()
215callWithParams(hGTA, dwFunc, [["s", wUrl], ["i", 0], ["i", 0], ["i", 0], ["i", 0], ["i", 0]], false)
216unPatchRadio()
217ErrorLevel := ERROR_OK
218return true
219}
220stopAudioStream() {
221if(!checkHandles())
222return false
223dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
224patchRadio()
225callWithParams(hGTA, dwFunc, [["i", 1]], false)
226unPatchRadio()
227ErrorLevel := ERROR_OK
228return true
229}
230patchRadio()
231{
232if(!checkHandles())
233return false
234VarSetCapacity(nop, 4, 0)
235NumPut(0x90909090,nop,0,"UInt")
236dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
237writeRaw(hGTA, dwFunc, &nop, 4)
238writeRaw(hGTA, dwFunc+4, &nop, 1)
239dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
240writeRaw(hGTA, dwFunc, &nop, 4)
241writeRaw(hGTA, dwFunc+4, &nop, 1)
242return true
243}
244unPatchRadio()
245{
246if(!checkHandles())
247return false
248VarSetCapacity(old, 4, 0)
249dwFunc := dwSAMP + FUNC_SAMP_PLAYAUDIOSTR
250NumPut(0x74003980,old,0,"UInt")
251writeRaw(hGTA, dwFunc, &old, 4)
252NumPut(0x39,old,0,"UChar")
253writeRaw(hGTA, dwFunc+4, &old, 1)
254dwFunc := dwSAMP + FUNC_SAMP_STOPAUDIOSTR
255NumPut(0x74003980,old,0,"UInt")
256writeRaw(hGTA, dwFunc, &old, 4)
257NumPut(0x09,old,0,"UChar")
258writeRaw(hGTA, dwFunc+4, &old, 1)
259return true
260}
261blockChatInput() {
262if(!checkHandles())
263return false
264VarSetCapacity(nop, 2, 0)
265dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
266NumPut(0x04C2,nop,0,"Short")
267writeRaw(hGTA, dwFunc, &nop, 2)
268dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
269writeRaw(hGTA, dwFunc, &nop, 2)
270return true
271}
272unBlockChatInput() {
273if(!checkHandles())
274return false
275VarSetCapacity(nop, 2, 0)
276dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
277NumPut(0xA164,nop,0,"Short")
278writeRaw(hGTA, dwFunc, &nop, 2)
279dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
280writeRaw(hGTA, dwFunc, &nop, 2)
281return true
282}
283getServerName() {
284if(!checkHandles())
285return -1
286dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int")
287if(ErrorLevel) {
288ErrorLevel := ERROR_READ_MEMORY
289return -1
290}
291if(!dwAdress)
292return -1
293ServerName := readString(hGTA, dwAdress + 0x121, 200)
294if(ErrorLevel) {
295ErrorLevel := ERROR_READ_MEMORY
296return -1
297}
298ErrorLevel := ERROR_OK
299return ServerName
300}
301getServerIP() {
302if(!checkHandles())
303return -1
304dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int")
305if(ErrorLevel) {
306ErrorLevel := ERROR_READ_MEMORY
307return -1
308}
309if(!dwAdress)
310return -1
311ServerIP := readString(hGTA, dwAdress + 0x20, 100)
312if(ErrorLevel) {
313ErrorLevel := ERROR_READ_MEMORY
314return -1
315}
316ErrorLevel := ERROR_OK
317return ServerIP
318}
319getServerPort() {
320if(!checkHandles())
321return -1
322dwAdress := readMem(hGTA, dwSAMP + 0x21A0F8, 4, "int")
323if(ErrorLevel) {
324ErrorLevel := ERROR_READ_MEMORY
325return -1
326}
327if(!dwAdress)
328return -1
329ServerPort := readMem(hGTA, dwAdress + 0x225, 4, "int")
330if(ErrorLevel) {
331ErrorLevel := ERROR_READ_MEMORY
332return -1
333}
334ErrorLevel := ERROR_OK
335return ServerPort
336}
337getWeatherID() {
338if(!checkHandles())
339return -1
340dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
341WeatherID := readMem(hGTA, dwGTA + 0xC81320, 2, "byte")
342if(ErrorLevel) {
343ErrorLevel := ERROR_READ_MEMORY
344return -1
345}
346ErrorLevel := ERROR_OK
347return WeatherID
348}
349getWeatherName() {
350if(isPlayerInAnyVehicle() == 0)
351return -1
352if(id >= 0 && id < 23)
353{
354return oweatherNames[id-1]
355}
356return ""
357}
358getTargetPed() {
359if(!checkHandles())
360return 0
361dwAddress := readDWORD(hGTA, 0xB6F3B8)
362if(ErrorLevel) {
363ErrorLevel := ERROR_READ_MEMORY
364return 0
365}
366if(!dwAddress)
367return 0
368dwAddress := readDWORD(hGTA, dwAddress+0x79C)
369if(ErrorLevel) {
370ErrorLevel := ERROR_READ_MEMORY
371return 0
372}
373ErrorLevel := ERROR_OK
374return dwAddress
375}
376calcScreenCoors(fX,fY,fZ)
377{
378if(!checkHandles())
379return false
380dwM := 0xB6FA2C
381m_11 := readFloat(hGTA, dwM + 0*4)
382if(ErrorLevel) {
383ErrorLevel := ERROR_READ_MEMORY
384return false
385}
386m_12 := readFloat(hGTA, dwM + 1*4)
387m_13 := readFloat(hGTA, dwM + 2*4)
388m_21 := readFloat(hGTA, dwM + 4*4)
389m_22 := readFloat(hGTA, dwM + 5*4)
390m_23 := readFloat(hGTA, dwM + 6*4)
391m_31 := readFloat(hGTA, dwM + 8*4)
392m_32 := readFloat(hGTA, dwM + 9*4)
393m_33 := readFloat(hGTA, dwM + 10*4)
394m_41 := readFloat(hGTA, dwM + 12*4)
395m_42 := readFloat(hGTA, dwM + 13*4)
396m_43 := readFloat(hGTA, dwM + 14*4)
397dwLenX := readDWORD(hGTA, 0xC17044)
398if(ErrorLevel) {
399ErrorLevel := ERROR_READ_MEMORY
400return false
401}
402dwLenY := readDWORD(hGTA, 0xC17048)
403frX := fZ * m_31 + fY * m_21 + fX * m_11 + m_41
404frY := fZ * m_32 + fY * m_22 + fX * m_12 + m_42
405frZ := fZ * m_33 + fY * m_23 + fX * m_13 + m_43
406fRecip := 1.0/frZ
407frX *= fRecip * dwLenX
408frY *= fRecip * dwLenY
409if(frX<=dwLenX && frY<=dwLenY && frZ>1)
410return [frX,frY,frZ]
411}
412getPedById(dwId) {
413dwId += 0
414dwId := Floor(dwId)
415if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
416return 0
417if(iRefreshScoreboard+iUpdateTick > A_TickCount)
418{
419if(oScoreboardData[dwId])
420{
421if(oScoreboardData[dwId].HasKey("PED"))
422return oScoreboardData[dwId].PED
423}
424return 0
425}
426if(!updateOScoreboardData())
427return 0
428if(oScoreboardData[dwId])
429{
430if(oScoreboardData[dwId].HasKey("PED"))
431return oScoreboardData[dwId].PED
432}
433return 0
434}
435getIdByPed(dwPed) {
436dwPed += 0
437dwPed := Floor(dwPed)
438if(!dwPed)
439return -1
440if(iRefreshScoreboard+iUpdateTick > A_TickCount)
441{
442For i, o in oScoreboardData
443{
444if(o.HasKey("PED"))
445{
446if(o.PED==dwPed)
447return i
448}
449}
450return -1
451}
452if(!updateOScoreboardData())
453return -1
454For i, o in oScoreboardData
455{
456if(o.HasKey("PED"))
457{
458if(o.PED==dwPed)
459return i
460}
461}
462return -1
463}
464getStreamedInPlayersInfo() {
465r:=[]
466if(iRefreshScoreboard+iUpdateTick > A_TickCount)
467{
468For i, o in oScoreboardData
469{
470if(o.HasKey("PED"))
471{
472p := getPedCoordinates(o.PED)
473if(p)
474{
475o.POS := p
476r[i] := o
477}
478}
479}
480return r
481}
482if(!updateOScoreboardData())
483return ""
484For i, o in oScoreboardData
485{
486if(o.HasKey("PED"))
487{
488p := getPedCoordinates(o.PED)
489if(p)
490{
491o.POS := p
492r[i] := o
493}
494}
495}
496return r
497}
498callFuncForAllStreamedInPlayers(cfunc,dist=0x7fffffff) {
499cfunc := "" cfunc
500dist += 0
501if(!IsFunc(cfunc))
502return false
503p := getStreamedInPlayersInfo()
504if(!p)
505return false
506if(dist<0x7fffffff)
507{
508lpos := getCoordinates()
509if(!lpos)
510return false
511For i, o in p
512{
513if(dist>getDist(lpos,o.POS))
514%cfunc%(o)
515}
516}
517else
518{
519For i, o in p
520%cfunc%(o)
521}
522return true
523}
524getDist(pos1,pos2) {
525if(!pos1 || !pos2)
526return 0
527return Sqrt((pos1[1]-pos2[1])*(pos1[1]-pos2[1])+(pos1[2]-pos2[2])*(pos1[2]-pos2[2])+(pos1[3]-pos2[3])*(pos1[3]-pos2[3]))
528}
529getClosestPlayerPed() {
530dist := 0x7fffffff
531p := getStreamedInPlayersInfo()
532if(!p)
533return -1
534lpos := getCoordinates()
535if(!lpos)
536return -1
537id := -1
538For i, o in p
539{
540t:=getDist(lpos,o.POS)
541if(t<dist)
542{
543dist := t
544id := i
545}
546}
547PED := getPedById(id)
548return PED
549}
550getClosestPlayerId() {
551dist := 0x7fffffff
552p := getStreamedInPlayersInfo()
553if(!p)
554return -1
555lpos := getCoordinates()
556if(!lpos)
557return -1
558id := -1
559For i, o in p
560{
561t:=getDist(lpos,o.POS)
562if(t<dist)
563{
564dist := t
565id := i
566}
567}
568return id
569}
570CountOnlinePlayers() {
571if(!checkHandles())
572return -1
573dwOnline := readDWORD(hGTA, dwSAMP + 0x21A0B4)
574if(ErrorLevel) {
575ErrorLevel := ERROR_READ_MEMORY
576return -1
577}
578dwAddr := dwOnline + 0x4
579OnlinePlayers := readDWORD(hGTA, dwAddr)
580if(ErrorLevel) {
581ErrorLevel := ERROR_READ_MEMORY
582return -1
583}
584ErrorLevel := ERROR_OK
585return OnlinePlayers
586}
587getPedCoordinates(dwPED) {
588dwPED += 0
589dwPED := Floor(dwPED)
590if(!dwPED)
591return ""
592if(!checkHandles())
593return ""
594dwAddress := readDWORD(hGTA, dwPED + 0x14)
595if(ErrorLevel || dwAddress==0) {
596ErrorLevel := ERROR_READ_MEMORY
597return ""
598}
599fX := readFloat(hGTA, dwAddress + 0x30)
600if(ErrorLevel) {
601ErrorLevel := ERROR_READ_MEMORY
602return ""
603}
604fY := readFloat(hGTA, dwAddress + 0x34)
605if(ErrorLevel) {
606ErrorLevel := ERROR_READ_MEMORY
607return ""
608}
609fZ := readFloat(hGTA, dwAddress + 0x38)
610if(ErrorLevel) {
611ErrorLevel := ERROR_READ_MEMORY
612return ""
613}
614ErrorLevel := ERROR_OK
615return [fX, fY, fZ]
616}
617getTargetPos(dwId) {
618dwId += 0
619dwId := Floor(dwId)
620if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
621return ""
622if(iRefreshScoreboard+iUpdateTick > A_TickCount)
623{
624if(oScoreboardData[dwId])
625{
626if(oScoreboardData[dwId].HasKey("PED"))
627return getPedCoordinates(oScoreboardData[dwId].PED)
628if(oScoreboardData[dwId].HasKey("MPOS"))
629return oScoreboardData[dwId].MPOS
630}
631return ""
632}
633if(!updateOScoreboardData())
634return ""
635if(oScoreboardData[dwId])
636{
637if(oScoreboardData[dwId].HasKey("PED"))
638return getPedCoordinates(oScoreboardData[dwId].PED)
639if(oScoreboardData[dwId].HasKey("MPOS"))
640return oScoreboardData[dwId].MPOS
641}
642return ""
643}
644getTargetPlayerSkinIdByPed(dwPED) {
645if(!checkHandles())
646return -1
647dwAddr := dwPED + ADDR_CPED_SKINIDOFF
648SkinID := readMem(hGTA, dwAddr, 2, "byte")
649if(ErrorLevel) {
650ErrorLevel := ERROR_READ_MEMORY
651return -1
652}
653ErrorLevel := ERROR_OK
654return SkinID
655}
656getTargetPlayerSkinIdById(dwId) {
657if(!checkHandles())
658return -1
659dwPED := getPedById(dwId)
660dwAddr := dwPED + ADDR_CPED_SKINIDOFF
661SkinID := readMem(hGTA, dwAddr, 2, "byte")
662if(ErrorLevel) {
663ErrorLevel := ERROR_READ_MEMORY
664return -1
665}
666ErrorLevel := ERROR_OK
667return SkinID
668}
669getVehiclePointerByPed(dwPED) {
670dwPED += 0
671dwPED := Floor(dwPED)
672if(!dwPED)
673return 0
674if(!checkHandles())
675return 0
676dwAddress := readDWORD(hGTA, dwPED + 0x58C)
677if(ErrorLevel) {
678ErrorLevel := ERROR_READ_MEMORY
679return 0
680}
681ErrorLevel := ERROR_OK
682return dwAddress
683}
684getVehiclePointerById(dwId) {
685if(!dwId)
686return 0
687if(!checkHandles())
688return 0
689dwPed_By_Id := getPedById(dwId)
690dwAddress := readDWORD(hGTA, dwPed_By_Id + 0x58C)
691if(ErrorLevel) {
692ErrorLevel := ERROR_READ_MEMORY
693return 0
694}
695ErrorLevel := ERROR_OK
696return dwAddress
697}
698isTargetInAnyVehicleByPed(dwPED)
699{
700if(!checkHandles())
701return -1
702dwVehiclePointer := getVehiclePointerByPed(dwPedPointer)
703if(dwVehiclePointer > 0)
704{
705return 1
706}
707else if(dwVehiclePointer <= 0)
708{
709return 0
710}
711else
712{
713return -1
714}
715}
716isTargetInAnyVehiclebyId(dwId)
717{
718if(!checkHandles())
719return -1
720dwPedPointer := getPedById(dwId)
721dwVehiclePointer := getVehiclePointerByPed(dwPedPointer)
722if(dwVehiclePointer > 0)
723{
724return 1
725}
726else if(dwVehiclePointer <= 0)
727{
728return 0
729}
730else
731{
732return -1
733}
734}
735getTargetVehicleHealthByPed(dwPed) {
736if(!checkHandles())
737return -1
738dwVehPtr := getVehiclePointerByPed(dwPed)
739dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
740fHealth := readFloat(hGTA, dwAddr)
741if(ErrorLevel) {
742ErrorLevel := ERROR_READ_MEMORY
743return -1
744}
745ErrorLevel := ERROR_OK
746return Round(fHealth)
747}
748getTargetVehicleHealthById(dwId) {
749if(!checkHandles())
750return -1
751dwVehPtr := getVehiclePointerById(dwId)
752dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
753fHealth := readFloat(hGTA, dwAddr)
754if(ErrorLevel) {
755ErrorLevel := ERROR_READ_MEMORY
756return -1
757}
758ErrorLevel := ERROR_OK
759return Round(fHealth)
760}
761getTargetVehicleTypeByPed(dwPED) {
762if(!checkHandles())
763return 0
764dwAddr := getVehiclePointerByPed(dwPED)
765if(!dwAddr)
766return 0
767cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
768if(ErrorLevel) {
769ErrorLevel := ERROR_READ_MEMORY
770return 0
771}
772ErrorLevel := ERROR_OK
773if(!cVal)
774{
775mid := getVehicleModelId()
776Loop % oAirplaneModels.MaxIndex()
777{
778if(oAirplaneModels[A_Index]==mid)
779return 5
780}
781return 1
782}
783else if(cVal==5)
784return 2
785else if(cVal==6)
786return 3
787else if(cVal==9)
788{
789mid := getVehicleModelId()
790Loop % oBikeModels.MaxIndex()
791{
792if(oBikeModels[A_Index]==mid)
793return 6
794}
795return 4
796}
797return 0
798}
799getTargetVehicleTypeById(dwId) {
800if(!checkHandles())
801return 0
802dwAddr := getVehiclePointerById(dwId)
803if(!dwAddr)
804return 0
805cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
806if(ErrorLevel) {
807ErrorLevel := ERROR_READ_MEMORY
808return 0
809}
810ErrorLevel := ERROR_OK
811if(!cVal)
812{
813mid := getVehicleModelId()
814Loop % oAirplaneModels.MaxIndex()
815{
816if(oAirplaneModels[A_Index]==mid)
817return 5
818}
819return 1
820}
821else if(cVal==5)
822return 2
823else if(cVal==6)
824return 3
825else if(cVal==9)
826{
827mid := getVehicleModelId()
828Loop % oBikeModels.MaxIndex()
829{
830if(oBikeModels[A_Index]==mid)
831return 6
832}
833return 4
834}
835return 0
836}
837getTargetVehicleModelIdByPed(dwPED) {
838if(!checkHandles())
839return 0
840dwAddr := getVehiclePointerByPed(dwPED)
841if(!dwAddr)
842return 0
843sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
844if(ErrorLevel) {
845ErrorLevel := ERROR_READ_MEMORY
846return 0
847}
848ErrorLevel := ERROR_OK
849return sVal
850}
851getTargetVehicleModelIdById(dwId) {
852if(!checkHandles())
853return 0
854dwAddr := getVehiclePointerById(dwId)
855if(!dwAddr)
856return 0
857sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
858if(ErrorLevel) {
859ErrorLevel := ERROR_READ_MEMORY
860return 0
861}
862ErrorLevel := ERROR_OK
863return sVal
864}
865getTargetVehicleModelNameByPed(dwPED) {
866id := getTargetVehicleModelIdByPed(dwPED)
867if(id > 400 && id < 611)
868{
869return ovehicleNames[id-399]
870}
871return ""
872}
873getTargetVehicleModelNameById(dwId) {
874id := getTargetVehicleModelIdById(dwId)
875if(id > 400 && id < 611)
876{
877return ovehicleNames[id-399]
878}
879return ""
880}
881getTargetVehicleLightStateByPed(dwPED) {
882if(!checkHandles())
883return -1
884dwAddr := getVehiclePointerByPed(dwPED)
885if(!dwAddr)
886return -1
887dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
888if(ErrorLevel) {
889ErrorLevel := ERROR_READ_MEMORY
890return -1
891}
892ErrorLevel := ERROR_OK
893return (dwVal>0)
894}
895getTargetVehicleLightStateById(dwId) {
896if(!checkHandles())
897return -1
898dwAddr := getVehiclePointerById(dwId)
899if(!dwAddr)
900return -1
901dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
902if(ErrorLevel) {
903ErrorLevel := ERROR_READ_MEMORY
904return -1
905}
906ErrorLevel := ERROR_OK
907return (dwVal>0)
908}
909getTargetVehicleLockStateByPed(dwPED) {
910if(!checkHandles())
911return -1
912dwAddr := getVehiclePointerByPed(dwPED)
913if(!dwAddr)
914return -1
915dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
916if(ErrorLevel) {
917ErrorLevel := ERROR_READ_MEMORY
918return -1
919}
920ErrorLevel := ERROR_OK
921return (dwVal==2)
922}
923getTargetVehicleLockStateById(dwId) {
924if(!checkHandles())
925return -1
926dwAddr := getVehiclePointerById(dwId)
927if(!dwAddr)
928return -1
929dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
930if(ErrorLevel) {
931ErrorLevel := ERROR_READ_MEMORY
932return -1
933}
934ErrorLevel := ERROR_OK
935return (dwVal==2)
936}
937getTargetVehicleColor1byPed(dwPED) {
938if(!checkHandles())
939return 0
940dwAddr := getVehiclePointerByPed(dwPED)
941if(!dwAddr)
942return 0
943sVal := readMem(hGTA, dwAddr + 1076, 1, "byte")
944if(ErrorLevel) {
945ErrorLevel := ERROR_READ_MEMORY
946return 0
947}
948ErrorLevel := ERROR_OK
949return sVal
950}
951getTargetVehicleColor1byId(dwId) {
952if(!checkHandles())
953return 0
954dwAddr := getVehiclePointerById(dwId)
955if(!dwAddr)
956return 0
957sVal := readMem(hGTA, dwAddr + 1076, 1, "byte")
958if(ErrorLevel) {
959ErrorLevel := ERROR_READ_MEMORY
960return 0
961}
962ErrorLevel := ERROR_OK
963return sVal
964}
965getTargetVehicleColor2byPed(dwPED) {
966if(!checkHandles())
967return 0
968dwAddr := getVehiclePointerByPed(dwPED)
969if(!dwAddr)
970return 0
971sVal := readMem(hGTA, dwAddr + 1077, 1, "byte")
972if(ErrorLevel) {
973ErrorLevel := ERROR_READ_MEMORY
974return 0
975}
976ErrorLevel := ERROR_OK
977return sVal
978}
979getTargetVehicleColor2byId(dwId) {
980if(!checkHandles())
981return 0
982dwAddr := getVehiclePointerById(dwId)
983if(!dwAddr)
984return 0
985sVal := readMem(hGTA, dwAddr + 1077, 1, "byte")
986if(ErrorLevel) {
987ErrorLevel := ERROR_READ_MEMORY
988return 0
989}
990ErrorLevel := ERROR_OK
991return sVal
992}
993getTargetVehicleSpeedByPed(dwPED) {
994if(!checkHandles())
995return -1
996dwAddr := getVehiclePointerByPed(dwPED)
997fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
998fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
999fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float")
1000fVehicleSpeed := sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ))
1001fVehicleSpeed := (fVehicleSpeed * 100) * 1.43
1002return fVehicleSpeed
1003}
1004getTargetVehicleSpeedById(dwId) {
1005if(!checkHandles())
1006return -1
1007dwAddr := getVehiclePointerById(dwId)
1008fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
1009fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
1010fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float")
1011fVehicleSpeed := sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ))
1012fVehicleSpeed := (fVehicleSpeed * 100) * 1.43
1013return fVehicleSpeed
1014}
1015getPlayerNameById(dwId) {
1016dwId += 0
1017dwId := Floor(dwId)
1018if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
1019return ""
1020if(iRefreshScoreboard+iUpdateTick > A_TickCount)
1021{
1022if(oScoreboardData[dwId])
1023return oScoreboardData[dwId].NAME
1024return ""
1025}
1026if(!updateOScoreboardData())
1027return ""
1028if(oScoreboardData[dwId])
1029return oScoreboardData[dwId].NAME
1030return ""
1031}
1032getPlayerIdByName(wName, exact := false) {
1033wName := "" wName
1034if(StrLen(wName) < 1 || StrLen(wName) > 24)
1035return -1
1036if(iRefreshScoreboard+iUpdateTick > A_TickCount)
1037{
1038For i, o in oScoreboardData
1039{
1040if (o.NAME = wName)
1041return i
1042}
1043For i, o in oScoreboardData
1044{
1045if (!exact && InStr(o.NAME,wName)==1)
1046return i
1047else if (exact && o.NAME = wName)
1048return i
1049}
1050return -1
1051}
1052if(!updateOScoreboardData())
1053return -2
1054For i, o in oScoreboardData
1055{
1056if (o.NAME = wName)
1057return i
1058}
1059For i, o in oScoreboardData
1060{
1061if (!exact && InStr(o.NAME,wName)==1)
1062return i
1063else if (exact && o.NAME = wName)
1064return i
1065}
1066return -1
1067}
1068getPlayerScoreById(dwId) {
1069dwId += 0
1070dwId := Floor(dwId)
1071if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
1072return ""
1073if(iRefreshScoreboard+iUpdateTick > A_TickCount)
1074{
1075if(oScoreboardData[dwId])
1076return oScoreboardData[dwId].SCORE
1077return ""
1078}
1079if(!updateOScoreboardData())
1080return ""
1081if(oScoreboardData[dwId])
1082return oScoreboardData[dwId].SCORE
1083return ""
1084}
1085getPlayerPingById(dwId) {
1086dwId += 0
1087dwId := Floor(dwId)
1088if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
1089return -1
1090if(iRefreshScoreboard+iUpdateTick > A_TickCount)
1091{
1092if(oScoreboardData[dwId])
1093return oScoreboardData[dwId].PING
1094return -1
1095}
1096if(!updateOScoreboardData())
1097return -1
1098if(oScoreboardData[dwId])
1099return oScoreboardData[dwId].PING
1100return -1
1101}
1102isNPCById(dwId) {
1103dwId += 0
1104dwId := Floor(dwId)
1105if(dwId < 0 || dwId >= SAMP_PLAYER_MAX)
1106return -1
1107if(iRefreshScoreboard+iUpdateTick > A_TickCount)
1108{
1109if(oScoreboardData[dwId])
1110return oScoreboardData[dwId].ISNPC
1111return -1
1112}
1113if(!updateOScoreboardData())
1114return -1
1115if(oScoreboardData[dwId])
1116return oScoreboardData[dwId].ISNPC
1117return -1
1118}
1119updateScoreboardDataEx() {
1120if(!checkHandles())
1121return false
1122dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
1123if(ErrorLevel || dwAddress==0) {
1124ErrorLevel := ERROR_READ_MEMORY
1125return false
1126}
1127dwFunc := dwSAMP + FUNC_UPDATESCOREBOARD
1128VarSetCapacity(injectData, 11, 0)
1129NumPut(0xB9, injectData, 0, "UChar")
1130NumPut(dwAddress, injectData, 1, "UInt")
1131NumPut(0xE8, injectData, 5, "UChar")
1132offset := dwFunc - (pInjectFunc + 10)
1133NumPut(offset, injectData, 6, "Int")
1134NumPut(0xC3, injectData, 10, "UChar")
1135writeRaw(hGTA, pInjectFunc, &injectData, 11)
1136if(ErrorLevel)
1137return false
1138hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
1139if(ErrorLevel)
1140return false
1141waitForSingleObject(hThread, 0xFFFFFFFF)
1142closeProcess(hThread)
1143return true
1144}
1145updateOScoreboardData() {
1146if(!checkHandles())
1147return 0
1148oScoreboardData := []
1149if(!updateScoreboardDataEx())
1150return 0
1151iRefreshScoreboard := A_TickCount
1152dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
1153if(ErrorLevel || dwAddress==0) {
1154ErrorLevel := ERROR_READ_MEMORY
1155return 0
1156}
1157dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
1158if(ErrorLevel || dwAddress==0) {
1159ErrorLevel := ERROR_READ_MEMORY
1160return 0
1161}
1162dwPlayers := readDWORD(hGTA, dwAddress + SAMP_PPOOL_PLAYER_OFFSET)
1163if(ErrorLevel || dwPlayers==0) {
1164ErrorLevel := ERROR_READ_MEMORY
1165return 0
1166}
1167wID := readMem(hGTA, dwPlayers + SAMP_SLOCALPLAYERID_OFFSET, 2, "Short")
1168if(ErrorLevel) {
1169ErrorLevel := ERROR_READ_MEMORY
1170return 0
1171}
1172dwPing := readMem(hGTA, dwPlayers + SAMP_ILOCALPLAYERPING_OFFSET, 4, "Int")
1173if(ErrorLevel) {
1174ErrorLevel := ERROR_READ_MEMORY
1175return 0
1176}
1177dwScore := readMem(hGTA, dwPlayers + SAMP_ILOCALPLAYERSCORE_OFFSET, 4, "Int")
1178if(ErrorLevel) {
1179ErrorLevel := ERROR_READ_MEMORY
1180return 0
1181}
1182dwTemp := readMem(hGTA, dwPlayers + SAMP_ISTRLEN_LOCALPLAYERNAME_OFFSET, 4, "Int")
1183if(ErrorLevel) {
1184ErrorLevel := ERROR_READ_MEMORY
1185return 0
1186}
1187sUsername := ""
1188if(dwTemp <= 0xf) {
1189sUsername := readString(hGTA, dwPlayers + SAMP_SZLOCALPLAYERNAME_OFFSET, 16)
1190if(ErrorLevel) {
1191ErrorLevel := ERROR_READ_MEMORY
1192return 0
1193}
1194}
1195else {
1196dwAddress := readDWORD(hGTA, dwPlayers + SAMP_PSZLOCALPLAYERNAME_OFFSET)
1197if(ErrorLevel) {
1198ErrorLevel := ERROR_READ_MEMORY
1199return 0
1200}
1201sUsername := readString(hGTA, dwAddress, 25)
1202if(ErrorLevel) {
1203ErrorLevel := ERROR_READ_MEMORY
1204return 0
1205}
1206}
1207oScoreboardData[wID] := Object("NAME", sUsername, "ID", wID, "PING", dwPing, "SCORE", dwScore, "ISNPC", 0)
1208Loop, % SAMP_PLAYER_MAX
1209{
1210i := A_Index-1
1211dwRemoteplayer := readDWORD(hGTA, dwPlayers+SAMP_PREMOTEPLAYER_OFFSET+i*4)
1212if(ErrorLevel) {
1213ErrorLevel := ERROR_READ_MEMORY
1214return 0
1215}
1216if(dwRemoteplayer==0)
1217continue
1218dwPing := readMem(hGTA, dwRemoteplayer + SAMP_IPING_OFFSET, 4, "Int")
1219if(ErrorLevel) {
1220ErrorLevel := ERROR_READ_MEMORY
1221return 0
1222}
1223dwScore := readMem(hGTA, dwRemoteplayer + SAMP_ISCORE_OFFSET, 4, "Int")
1224if(ErrorLevel) {
1225ErrorLevel := ERROR_READ_MEMORY
1226return 0
1227}
1228dwIsNPC := readMem(hGTA, dwRemoteplayer + SAMP_ISNPC_OFFSET, 4, "Int")
1229if(ErrorLevel) {
1230ErrorLevel := ERROR_READ_MEMORY
1231return 0
1232}
1233dwTemp := readMem(hGTA, dwRemoteplayer + SAMP_ISTRLENNAME___OFFSET, 4, "Int")
1234if(ErrorLevel) {
1235ErrorLevel := ERROR_READ_MEMORY
1236return 0
1237}
1238sUsername := ""
1239if(dwTemp <= 0xf)
1240{
1241sUsername := readString(hGTA, dwRemoteplayer+SAMP_SZPLAYERNAME_OFFSET, 16)
1242if(ErrorLevel) {
1243ErrorLevel := ERROR_READ_MEMORY
1244return 0
1245}
1246}
1247else {
1248dwAddress := readDWORD(hGTA, dwRemoteplayer + SAMP_PSZPLAYERNAME_OFFSET)
1249if(ErrorLevel || dwAddress==0) {
1250ErrorLevel := ERROR_READ_MEMORY
1251return 0
1252}
1253sUsername := readString(hGTA, dwAddress, 25)
1254if(ErrorLevel) {
1255ErrorLevel := ERROR_READ_MEMORY
1256return 0
1257}
1258}
1259o := Object("NAME", sUsername, "ID", i, "PING", dwPing, "SCORE", dwScore, "ISNPC", dwIsNPC)
1260oScoreboardData[i] := o
1261dwRemoteplayerData := readDWORD(hGTA, dwRemoteplayer + 0x0)
1262if(ErrorLevel) {
1263ErrorLevel := ERROR_READ_MEMORY
1264return 0
1265}
1266if(dwRemoteplayerData==0)
1267continue
1268dwAddress := readDWORD(hGTA, dwRemoteplayerData + 489)
1269if(ErrorLevel) {
1270ErrorLevel := ERROR_READ_MEMORY
1271return 0
1272}
1273if(dwAddress)
1274{
1275ix := readMem(hGTA, dwRemoteplayerData + 493, 4, "Int")
1276if(ErrorLevel) {
1277ErrorLevel := ERROR_READ_MEMORY
1278return 0
1279}
1280iy := readMem(hGTA, dwRemoteplayerData + 497, 4, "Int")
1281if(ErrorLevel) {
1282ErrorLevel := ERROR_READ_MEMORY
1283return 0
1284}
1285iz := readMem(hGTA, dwRemoteplayerData + 501, 4, "Int")
1286if(ErrorLevel) {
1287ErrorLevel := ERROR_READ_MEMORY
1288return 0
1289}
1290o.MPOS := [ix, iy, iz]
1291}
1292dwpSAMP_Actor := readDWORD(hGTA, dwRemoteplayerData + 0x0)
1293if(ErrorLevel) {
1294ErrorLevel := ERROR_READ_MEMORY
1295return 0
1296}
1297if(dwpSAMP_Actor==0)
1298continue
1299dwPed := readDWORD(hGTA, dwpSAMP_Actor + 676)
1300if(ErrorLevel) {
1301ErrorLevel := ERROR_READ_MEMORY
1302return 0
1303}
1304if(dwPed==0)
1305continue
1306o.PED := dwPed
1307fHP := readFloat(hGTA, dwRemoteplayerData + 444)
1308if(ErrorLevel) {
1309ErrorLevel := ERROR_READ_MEMORY
1310return 0
1311}
1312fARMOR := readFloat(hGTA, dwRemoteplayerData + 440)
1313if(ErrorLevel) {
1314ErrorLevel := ERROR_READ_MEMORY
1315return 0
1316}
1317o.HP := fHP
1318o.ARMOR := fARMOR
1319}
1320ErrorLevel := ERROR_OK
1321return 1
1322}
1323GetChatLine(Line, ByRef Output, timestamp=0, color=0){
1324chatindex := 0
1325FileRead, file, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
1326loop, Parse, file, `n, `r
1327{
1328if(A_LoopField)
1329chatindex := A_Index
1330}
1331loop, Parse, file, `n, `r
1332{
1333if(A_Index = chatindex - line){
1334output := A_LoopField
1335break
1336}
1337}
1338file := ""
1339if(!timestamp)
1340output := RegExReplace(output, "U)^\[\d{2}:\d{2}:\d{2}\]")
1341if(!color)
1342output := RegExReplace(output, "Ui)\{[a-f0-9]{6}\}")
1343return
1344}
1345getPlayerHealth() {
1346if(!checkHandles())
1347return -1
1348dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
1349if(ErrorLevel) {
1350ErrorLevel := ERROR_READ_MEMORY
1351return -1
1352}
1353dwAddr := dwCPedPtr + ADDR_CPED_HPOFF
1354fHealth := readFloat(hGTA, dwAddr)
1355if(ErrorLevel) {
1356ErrorLevel := ERROR_READ_MEMORY
1357return -1
1358}
1359ErrorLevel := ERROR_OK
1360return Round(fHealth)
1361}
1362getPlayerArmor() {
1363if(!checkHandles())
1364return -1
1365dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
1366if(ErrorLevel) {
1367ErrorLevel := ERROR_READ_MEMORY
1368return -1
1369}
1370dwAddr := dwCPedPtr + ADDR_CPED_ARMOROFF
1371fHealth := readFloat(hGTA, dwAddr)
1372if(ErrorLevel) {
1373ErrorLevel := ERROR_READ_MEMORY
1374return -1
1375}
1376ErrorLevel := ERROR_OK
1377return Round(fHealth)
1378}
1379getPlayerInteriorId() {
1380if(!checkHandles())
1381return -1
1382iid := readMem(hGTA, ADDR_CPED_INTID, 4, "Int")
1383if(ErrorLevel) {
1384ErrorLevel := ERROR_READ_MEMORY
1385return -1
1386}
1387ErrorLevel := ERROR_OK
1388return iid
1389}
1390getPlayerSkinID() {
1391if(!checkHandles())
1392return -1
1393dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
1394if(ErrorLevel) {
1395ErrorLevel := ERROR_READ_MEMORY
1396return -1
1397}
1398dwAddr := dwCPedPtr + ADDR_CPED_SKINIDOFF
1399SkinID := readMem(hGTA, dwAddr, 2, "byte")
1400if(ErrorLevel) {
1401ErrorLevel := ERROR_READ_MEMORY
1402return -1
1403}
1404ErrorLevel := ERROR_OK
1405return SkinID
1406}
1407getPlayerMoney() {
1408if(!checkHandles())
1409return ""
1410money := readMem(hGTA, ADDR_CPED_MONEY, 4, "Int")
1411if(ErrorLevel) {
1412ErrorLevel := ERROR_READ_MEMORY
1413return ""
1414}
1415ErrorLevel := ERROR_OK
1416return money
1417}
1418getPlayerWanteds() {
1419if(!checkHandles())
1420return -1
1421dwPtr := 0xB7CD9C
1422dwPtr := readDWORD(hGTA, dwPtr)
1423if(ErrorLevel) {
1424ErrorLevel := ERROR_READ_MEMORY
1425return -1
1426}
1427Wanteds := readDWORD(hGTA, dwPtr)
1428if(ErrorLevel) {
1429ErrorLevel := ERROR_READ_MEMORY
1430return -1
1431}
1432ErrorLevel := ERROR_OK
1433return Wanteds
1434}
1435getPlayerWeaponId() {
1436if(!checkHandles())
1437return 0
1438WaffenId := readMem(hGTA, 0xBAA410, 4, "byte")
1439if(ErrorLevel) {
1440ErrorLevel := ERROR_READ_MEMORY
1441return -1
1442}
1443return WaffenId
1444}
1445getPlayerWeaponName() {
1446id := getPlayerWeaponId()
1447if(id >= 0 && id < 44)
1448{
1449return oweaponNames[id+1]
1450}
1451return ""
1452}
1453getPlayerState() {
1454if(!checkHandles())
1455return -1
1456dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
1457if(ErrorLevel) {
1458ErrorLevel := ERROR_READ_MEMORY
1459return -1
1460}
1461State := readDWORD(hGTA, dwCPedPtr + 0x530)
1462if(ErrorLevel) {
1463ErrorLevel := ERROR_READ_MEMORY
1464return -1
1465}
1466ErrorLevel := ERROR_OK
1467return State
1468}
1469IsPlayerInMenu() {
1470if(!checkHandles())
1471return -1
1472IsInMenu := readMem(hGTA, 0xBA67A4, 4, "byte")
1473if(ErrorLevel) {
1474ErrorLevel := ERROR_READ_MEMORY
1475return -1
1476}
1477ErrorLevel := ERROR_OK
1478return IsInMenu
1479}
1480getPlayerMapPosX() {
1481if(!checkHandles())
1482return -1
1483MapPosX := readFloat(hGTA, 0xBA67B8)
1484if(ErrorLevel) {
1485ErrorLevel := ERROR_READ_MEMORY
1486return -1
1487}
1488ErrorLevel := ERROR_OK
1489return MapPosX
1490}
1491getPlayerMapPosY() {
1492if(!checkHandles())
1493return -1
1494MapPosY := readFloat(hGTA, 0xBA67BC)
1495if(ErrorLevel) {
1496ErrorLevel := ERROR_READ_MEMORY
1497return -1
1498}
1499ErrorLevel := ERROR_OK
1500return MapPosY
1501}
1502getPlayerMapZoom() {
1503if(!checkHandles())
1504return -1
1505MapZoom := readFloat(hGTA, 0xBA67AC)
1506if(ErrorLevel) {
1507ErrorLevel := ERROR_READ_MEMORY
1508return -1
1509}
1510ErrorLevel := ERROR_OK
1511return MapZoom
1512}
1513IsPlayerFreezed() {
1514if(!checkHandles())
1515return -1
1516dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
1517IPF := readMem(hGTA, dwGTA + 0x690495, 2, "byte")
1518if(ErrorLevel) {
1519ErrorLevel := ERROR_READ_MEMORY
1520return -1
1521}
1522ErrorLevel := ERROR_OK
1523return IPF
1524}
1525isPlayerInAnyVehicle()
1526{
1527if(!checkHandles())
1528return -1
1529dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
1530if(ErrorLevel) {
1531ErrorLevel := ERROR_READ_MEMORY
1532return -1
1533}
1534return (dwVehPtr > 0)
1535}
1536isPlayerDriver() {
1537if(!checkHandles())
1538return -1
1539dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
1540if(ErrorLevel) {
1541ErrorLevel := ERROR_READ_MEMORY
1542return -1
1543}
1544if(!dwAddr)
1545return -1
1546dwCPedPtr := readDWORD(hGTA, ADDR_CPED_PTR)
1547if(ErrorLevel) {
1548ErrorLevel := ERROR_READ_MEMORY
1549return -1
1550}
1551dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DRIVER)
1552if(ErrorLevel) {
1553ErrorLevel := ERROR_READ_MEMORY
1554return -1
1555}
1556ErrorLevel := ERROR_OK
1557return (dwVal==dwCPedPtr)
1558}
1559getVehicleHealth() {
1560if(!checkHandles())
1561return -1
1562dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
1563if(ErrorLevel) {
1564ErrorLevel := ERROR_READ_MEMORY
1565return -1
1566}
1567dwAddr := dwVehPtr + ADDR_VEHICLE_HPOFF
1568fHealth := readFloat(hGTA, dwAddr)
1569if(ErrorLevel) {
1570ErrorLevel := ERROR_READ_MEMORY
1571return -1
1572}
1573ErrorLevel := ERROR_OK
1574return Round(fHealth)
1575}
1576getVehicleType() {
1577if(!checkHandles())
1578return 0
1579dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
1580if(ErrorLevel) {
1581ErrorLevel := ERROR_READ_MEMORY
1582return 0
1583}
1584if(!dwAddr)
1585return 0
1586cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_TYPE, 1, "Char")
1587if(ErrorLevel) {
1588ErrorLevel := ERROR_READ_MEMORY
1589return 0
1590}
1591ErrorLevel := ERROR_OK
1592if(!cVal)
1593{
1594mid := getVehicleModelId()
1595Loop % oAirplaneModels.MaxIndex()
1596{
1597if(oAirplaneModels[A_Index]==mid)
1598return 5
1599}
1600return 1
1601}
1602else if(cVal==5)
1603return 2
1604else if(cVal==6)
1605return 3
1606else if(cVal==9)
1607{
1608mid := getVehicleModelId()
1609Loop % oBikeModels.MaxIndex()
1610{
1611if(oBikeModels[A_Index]==mid)
1612return 6
1613}
1614return 4
1615}
1616return 0
1617}
1618getVehicleModelId() {
1619if(!checkHandles())
1620return 0
1621dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
1622if(ErrorLevel) {
1623ErrorLevel := ERROR_READ_MEMORY
1624return 0
1625}
1626if(!dwAddr)
1627return 0
1628sVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_MODEL, 2, "Short")
1629if(ErrorLevel) {
1630ErrorLevel := ERROR_READ_MEMORY
1631return 0
1632}
1633ErrorLevel := ERROR_OK
1634return sVal
1635}
1636getVehicleModelName() {
1637id:=getVehicleModelId()
1638if(id > 400 && id < 611)
1639{
1640return ovehicleNames[id-399]
1641}
1642return ""
1643}
1644getVehicleLightState() {
1645if(!checkHandles())
1646return -1
1647dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
1648if(ErrorLevel) {
1649ErrorLevel := ERROR_READ_MEMORY
1650return -1
1651}
1652if(!dwAddr)
1653return -1
1654dwVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_LIGHTSTATE, 4, "Int")
1655if(ErrorLevel) {
1656ErrorLevel := ERROR_READ_MEMORY
1657return -1
1658}
1659ErrorLevel := ERROR_OK
1660return (dwVal>0)
1661}
1662getVehicleEngineState() {
1663if(!checkHandles())
1664return -1
1665dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
1666if(ErrorLevel) {
1667ErrorLevel := ERROR_READ_MEMORY
1668return -1
1669}
1670if(!dwAddr)
1671return -1
1672cVal := readMem(hGTA, dwAddr + ADDR_VEHICLE_ENGINESTATE, 1, "Char")
1673if(ErrorLevel) {
1674ErrorLevel := ERROR_READ_MEMORY
1675return -1
1676}
1677ErrorLevel := ERROR_OK
1678return (cVal==24 || cVal==56 || cVal==88 || cVal==120)
1679}
1680getVehicleLockState() {
1681if(!checkHandles())
1682return -1
1683dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
1684if(ErrorLevel) {
1685ErrorLevel := ERROR_READ_MEMORY
1686return -1
1687}
1688if(!dwAddr)
1689return -1
1690dwVal := readDWORD(hGTA, dwAddr + ADDR_VEHICLE_DOORSTATE)
1691if(ErrorLevel) {
1692ErrorLevel := ERROR_READ_MEMORY
1693return -1
1694}
1695ErrorLevel := ERROR_OK
1696return (dwVal==2)
1697}
1698getVehicleColor1() {
1699if(!checkHandles())
1700return 0
1701dwAddr := readDWORD(hGTA, 0xBA18FC)
1702if(ErrorLevel) {
1703ErrorLevel := ERROR_READ_MEMORY
1704return 0
1705}
1706if(!dwAddr)
1707return 0
1708sVal := readMem(hGTA, dwAddr + 1076, 1, "byte")
1709if(ErrorLevel) {
1710ErrorLevel := ERROR_READ_MEMORY
1711return 0
1712}
1713ErrorLevel := ERROR_OK
1714return sVal
1715}
1716getVehicleColor2() {
1717if(!checkHandles())
1718return 0
1719dwAddr := readDWORD(hGTA, 0xBA18FC)
1720if(ErrorLevel) {
1721ErrorLevel := ERROR_READ_MEMORY
1722return 0
1723}
1724if(!dwAddr)
1725return 0
1726sVal := readMem(hGTA, dwAddr + 1077, 1, "byte")
1727if(ErrorLevel) {
1728ErrorLevel := ERROR_READ_MEMORY
1729return 0
1730}
1731ErrorLevel := ERROR_OK
1732return sVal
1733}
1734getVehicleSpeed() {
1735if(!checkHandles())
1736return -1
1737dwAddr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
1738if(ErrorLevel) {
1739ErrorLevel := ERROR_READ_MEMORY
1740return ""
1741}
1742fSpeedX := readMem(hGTA, dwAddr + ADDR_VEHICLE_X, 4, "float")
1743fSpeedY := readMem(hGTA, dwAddr + ADDR_VEHICLE_Y, 4, "float")
1744fSpeedZ := readMem(hGTA, dwAddr + ADDR_VEHICLE_Z, 4, "float")
1745fVehicleSpeed := sqrt((fSpeedX * fSpeedX) + (fSpeedY * fSpeedY) + (fSpeedZ * fSpeedZ))
1746fVehicleSpeed := (fVehicleSpeed * 100) * 1.43
1747return fVehicleSpeed
1748}
1749getPlayerRadiostationID() {
1750if(!checkHandles())
1751return -1
1752if(isPlayerInAnyVehicle() == 0)
1753return -1
1754dwGTA := getModuleBaseAddress("gta_sa.exe", hGTA)
1755RadioStationID := readMem(hGTA, dwGTA + 0x4CB7E1, 1, "byte")
1756if(ErrorLevel) {
1757ErrorLevel := ERROR_READ_MEMORY
1758return -1
1759}
1760return RadioStationID
1761}
1762getPlayerRadiostationName() {
1763if(isPlayerInAnyVehicle() == 0)
1764return -1
1765id := getPlayerRadiostationID()
1766if(id == 0)
1767return -1
1768if(id >= 0 && id < 14)
1769{
1770return oradiostationNames[id]
1771}
1772return ""
1773}
1774setCheckpoint(fX, fY, fZ, fSize := 7) {
1775if(!checkHandles())
1776return false
1777dwFunc := dwSAMP + 0x9D340
1778dwAddress := readDWORD(hGTA, dwSAMP + ADDR_SAMP_INCHAT_PTR)
1779if(ErrorLevel || dwAddress==0) {
1780ErrorLevel := ERROR_READ_MEMORY
1781return false
1782}
1783VarSetCapacity(buf, 16, 0)
1784NumPut(fX, buf, 0, "Float")
1785NumPut(fY, buf, 4, "Float")
1786NumPut(fZ, buf, 8, "Float")
1787NumPut(fSize, buf, 12, "Float")
1788writeRaw(hGTA, pParam1, &buf, 16)
1789dwLen := 31
1790VarSetCapacity(injectData, dwLen, 0)
1791NumPut(0xB9, injectData, 0, "UChar")
1792NumPut(dwAddress, injectData, 1, "UInt")
1793NumPut(0x68, injectData, 5, "UChar")
1794NumPut(pParam1+12, injectData, 6, "UInt")
1795NumPut(0x68, injectData, 10, "UChar")
1796NumPut(pParam1, injectData, 11, "UInt")
1797NumPut(0xE8, injectData, 15, "UChar")
1798offset := dwFunc - (pInjectFunc + 20)
1799NumPut(offset, injectData, 16, "Int")
1800NumPut(0x05C7, injectData, 20, "UShort")
1801NumPut(dwAddress+0x24, injectData, 22, "UInt")
1802NumPut(1, injectData, 26, "UInt")
1803NumPut(0xC3, injectData, 30, "UChar")
1804writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
1805if(ErrorLevel)
1806return false
1807hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
1808if(ErrorLevel)
1809return false
1810waitForSingleObject(hThread, 0xFFFFFFFF)
1811closeProcess(hThread)
1812dwAddress := readDWORD(hGTA, dwSAMP + ADDR_SAMP_INCHAT_PTR)
1813writeMemory(hGTA, dwAddress + 0xC, fX, 4, "Float")
1814writeMemory(hGTA, dwAddress + 0x10, fY, 4, "Float")
1815writeMemory(hGTA, dwAddress + 0x14, fZ, 4, "Float")
1816writeMemory(hGTA, dwAddress + 0x18, fSize, 4, "Float")
1817ErrorLevel := ERROR_OK
1818return true
1819}
1820disableCheckpoint()
1821{
1822if(!checkHandles())
1823return false
1824dwAddress := readDWORD(hGTA, dwSAMP + ADDR_SAMP_INCHAT_PTR)
1825if(ErrorLevel || dwAddress==0) {
1826ErrorLevel := ERROR_READ_MEMORY
1827return false
1828}
1829VarSetCapacity(enablecp, 4, 0)
1830NumPut(0,enablecp,0,"Int")
1831writeRaw(hGTA, dwAddress+0x24, &enablecp, 4)
1832ErrorLevel := ERROR_OK
1833return true
1834}
1835IsMarkerCreated(){
1836If(!checkHandles())
1837return false
1838active := readMem(hGTA, CheckpointCheck, 1, "byte")
1839If(!active)
1840return 0
1841else return 1
1842}
1843CoordsFromRedmarker(){
1844if(!checkhandles())
1845return false
1846for i, v in rmaddrs
1847f%i% := readFloat(hGTA, v)
1848return [f1, f2, f3]
1849}
1850getCoordinates() {
1851if(!checkHandles())
1852return ""
1853fX := readFloat(hGTA, ADDR_POSITION_X)
1854if(ErrorLevel) {
1855ErrorLevel := ERROR_READ_MEMORY
1856return ""
1857}
1858fY := readFloat(hGTA, ADDR_POSITION_Y)
1859if(ErrorLevel) {
1860ErrorLevel := ERROR_READ_MEMORY
1861return ""
1862}
1863fZ := readFloat(hGTA, ADDR_POSITION_Z)
1864if(ErrorLevel) {
1865ErrorLevel := ERROR_READ_MEMORY
1866return ""
1867}
1868ErrorLevel := ERROR_OK
1869return [fX, fY, fZ]
1870}
1871GetPlayerPos(ByRef fX,ByRef fY,ByRef fZ) {
1872if(!checkHandles())
1873return 0
1874fX := readFloat(hGTA, ADDR_POSITION_X)
1875if(ErrorLevel) {
1876ErrorLevel := ERROR_READ_MEMORY
1877return 0
1878}
1879fY := readFloat(hGTA, ADDR_POSITION_Y)
1880if(ErrorLevel) {
1881ErrorLevel := ERROR_READ_MEMORY
1882return 0
1883}
1884fZ := readFloat(hGTA, ADDR_POSITION_Z)
1885if(ErrorLevel) {
1886ErrorLevel := ERROR_READ_MEMORY
1887return 0
1888}
1889ErrorLevel := ERROR_OK
1890}
1891getDialogStructPtr() {
1892if (!checkHandles()) {
1893ErrorLevel := ERROR_INVALID_HANDLE
1894return false
1895}
1896dwPointer := readDWORD(hGTA, dwSAMP + SAMP_DIALOG_STRUCT_PTR)
1897if (ErrorLevel) {
1898ErrorLevel := ERROR_READ_MEMORY
1899return false
1900}
1901ErrorLevel := ERROR_OK
1902return dwPointer
1903}
1904isDialogOpen() {
1905dwPointer := getDialogStructPtr()
1906if (ErrorLevel || !dwPointer)
1907return false
1908dwIsOpen := readMem(hGTA, dwPointer + SAMP_DIALOG_OPEN_OFFSET, 4, "UInt")
1909if (ErrorLevel) {
1910ErrorLevel := ERROR_READ_MEMORY
1911return false
1912}
1913ErrorLevel := ERROR_OK
1914return dwIsOpen ? true : false
1915}
1916getDialogStyle() {
1917dwPointer := getDialogStructPtr()
1918if (ErrorLevel || !dwPointer)
1919return -1
1920style := readMem(hGTA, dwPointer + SAMP_DIALOG_STYLE_OFFSET, 4, "UInt")
1921if (ErrorLevel) {
1922ErrorLevel := ERROR_READ_MEMORY
1923return -1
1924}
1925ErrorLevel := ERROR_OK
1926return style
1927}
1928getDialogID() {
1929dwPointer := getDialogStructPtr()
1930if (ErrorLevel || !dwPointer)
1931return -1
1932id := readMem(hGTA, dwPointer + SAMP_DIALOG_ID_OFFSET, 4, "UInt")
1933if (ErrorLevel) {
1934ErrorLevel := ERROR_READ_MEMORY
1935return -1
1936}
1937ErrorLevel := ERROR_OK
1938return id
1939}
1940setDialogID(id) {
1941dwPointer := getDialogStructPtr()
1942if (ErrorLevel || !dwPointer)
1943return false
1944writeMemory(hGTA, dwPointer + SAMP_DIALOG_ID_OFFSET, id, "UInt", 4)
1945if (ErrorLevel) {
1946ErrorLevel := ERROR_WRITE_MEMORY
1947return false
1948}
1949ErrorLevel := ERROR_OK
1950return true
1951}
1952getDialogIndex() {
1953dwPointer := getDialogStructPtr()
1954if (ErrorLevel || !dwPointer)
1955return 0
1956dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
1957if (ErrorLevel) {
1958ErrorLevel := ERROR_READ_MEMORY
1959return 0
1960}
1961index := readMem(hGTA, dwPointer + SAMP_DIALOG_INDEX_OFFSET, 1, "Byte")
1962if (ErrorLevel) {
1963ErrorLevel := ERROR_READ_MEMORY
1964return 0
1965}
1966ErrorLevel := ERROR_OK
1967return index + 1
1968}
1969getDialogCaption() {
1970dwPointer := getDialogStructPtr()
1971if (ErrorLevel || !dwPointer)
1972return ""
1973text := readString(hGTA, dwPointer + SAMP_DIALOG_CAPTION_OFFSET, 64)
1974if (ErrorLevel) {
1975ErrorLevel := ERROR_READ_MEMORY
1976return ""
1977}
1978ErrorLevel := ERROR_OK
1979return text
1980}
1981getDialogTextSize(dwAddress) {
1982i := 0
1983Loop, 4096 {
1984i := A_Index - 1
1985byte := Memory_ReadByte(hGTA, dwAddress + i)
1986if (!byte)
1987break
1988}
1989return i
1990}
1991getDialogText() {
1992dwPointer := getDialogStructPtr()
1993if (ErrorLevel || !dwPointer)
1994return ""
1995dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_TEXT_PTR_OFFSET)
1996if (ErrorLevel) {
1997ErrorLevel := ERROR_READ_MEMORY
1998return ""
1999}
2000text := readString(hGTA, dwPointer, 4096)
2001if (ErrorLevel) {
2002text := readString(hGTA, dwPointer, getDialogTextSize(dwPointer))
2003if (ErrorLevel) {
2004ErrorLevel := ERROR_READ_MEMORY
2005return ""
2006}
2007}
2008ErrorLevel := ERROR_OK
2009return text
2010}
2011getDialogLineCount() {
2012dwPointer := getDialogStructPtr()
2013if (ErrorLevel || !dwPointer)
2014return 0
2015dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR2_OFFSET)
2016if (ErrorLevel) {
2017ErrorLevel := ERROR_READ_MEMORY
2018return 0
2019}
2020count := readMem(hGTA, dwPointer + SAMP_DIALOG_LINECOUNT_OFFSET, 4, "UInt")
2021if (ErrorLevel) {
2022ErrorLevel := ERROR_READ_MEMORY
2023return 0
2024}
2025ErrorLevel := ERROR_OK
2026return count
2027}
2028getDialogLine__(index) {
2029if (getDialogLineCount > index)
2030return ""
2031dwPointer := getDialogStructPtr()
2032if (ErrorLevel || !dwPointer)
2033return ""
2034dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
2035if (ErrorLevel) {
2036ErrorLevel := ERROR_READ_MEMORY
2037return ""
2038}
2039dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_LINES_OFFSET)
2040if (ErrorLevel) {
2041ErrorLevel := ERROR_READ_MEMORY
2042return ""
2043}
2044dwLineAddress := readDWORD(hGTA, dwPointer + (index - 1) * 0x4)
2045line := readString(hGTA, dwLineAddress, 128)
2046ErrorLevel := ERROR_OK
2047return line
2048}
2049getDialogLine(index) {
2050lines := getDialogLines()
2051if (index > lines.Length())
2052return ""
2053if (getDialogStyle() == DIALOG_STYLE_TABLIST_HEADERS)
2054index++
2055return lines[index]
2056}
2057getDialogLines() {
2058text := getDialogText()
2059if (text == "")
2060return -1
2061lines := StrSplit(text, "`n")
2062return lines
2063}
2064isDialogButton1Selected() {
2065dwPointer := getDialogStructPtr()
2066if (ErrorLevel || !dwPointer)
2067return false
2068dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
2069if (ErrorLevel) {
2070ErrorLevel := ERROR_READ_MEMORY
2071return false
2072}
2073selected := readMem(hGTA, dwPointer + SAMP_DIALOG_BUTTON_HOVERING_OFFSET, 1, "Byte")
2074if (ErrorLevel) {
2075ErrorLevel := ERROR_READ_MEMORY
2076return false
2077}
2078ErrorLevel := ERROR_OK
2079return selected
2080}
2081getDialogLines__() {
2082count := getDialogLineCount()
2083dwPointer := getDialogStructPtr()
2084if (ErrorLevel || !dwPointer)
2085return -1
2086dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_PTR1_OFFSET)
2087if (ErrorLevel) {
2088ErrorLevel := ERROR_READ_MEMORY
2089return -1
2090}
2091dwPointer := readDWORD(hGTA, dwPointer + SAMP_DIALOG_LINES_OFFSET)
2092if (ErrorLevel) {
2093ErrorLevel := ERROR_READ_MEMORY
2094return -1
2095}
2096lines := []
2097Loop %count% {
2098dwLineAddress := readDWORD(hGTA, dwPointer + (A_Index - 1) * 0x4)
2099lines[A_Index] := readString(hGTA, dwLineAddress, 128)
2100}
2101ErrorLevel := ERROR_OK
2102return lines
2103}
2104showDialog(style, caption, text, button1, button2 := "", id := 1) {
2105style += 0
2106style := Floor(style)
2107id += 0
2108id := Floor(id)
2109caption := "" caption
2110text := "" text
2111button1 := "" button1
2112button2 := "" button2
2113if (id < 0 || id > 32767 || style < 0 || style > 5 || StrLen(caption) > 64 || StrLen(text) > 4096 || StrLen(button1) > 10 || StrLen(button2) > 10)
2114return false
2115if (!checkHandles())
2116return false
2117dwFunc := dwSAMP + FUNC_SAMP_SHOWDIALOG
2118dwAddress := readDWORD(hGTA, dwSAMP + SAMP_DIALOG_STRUCT_PTR)
2119if (ErrorLevel || !dwAddress) {
2120ErrorLevel := ERROR_READ_MEMORY
2121return false
2122}
2123writeString(hGTA, pParam5, caption)
2124if (ErrorLevel)
2125return false
2126writeString(hGTA, pParam1, text)
2127if (ErrorLevel)
2128return false
2129writeString(hGTA, pParam5 + 512, button1)
2130if (ErrorLevel)
2131return false
2132writeString(hGTA, pParam5+StrLen(caption) + 1, button2)
2133if (ErrorLevel)
2134return false
2135dwLen := 5 + 7 * 5 + 5 + 1
2136VarSetCapacity(injectData, dwLen, 0)
2137NumPut(0xB9, injectData, 0, "UChar")
2138NumPut(dwAddress, injectData, 1, "UInt")
2139NumPut(0x68, injectData, 5, "UChar")
2140NumPut(1, injectData, 6, "UInt")
2141NumPut(0x68, injectData, 10, "UChar")
2142NumPut(pParam5 + StrLen(caption) + 1, injectData, 11, "UInt")
2143NumPut(0x68, injectData, 15, "UChar")
2144NumPut(pParam5 + 512, injectData, 16, "UInt")
2145NumPut(0x68, injectData, 20, "UChar")
2146NumPut(pParam1, injectData, 21, "UInt")
2147NumPut(0x68, injectData, 25, "UChar")
2148NumPut(pParam5, injectData, 26, "UInt")
2149NumPut(0x68, injectData, 30, "UChar")
2150NumPut(style, injectData, 31, "UInt")
2151NumPut(0x68, injectData, 35, "UChar")
2152NumPut(id, injectData, 36, "UInt")
2153NumPut(0xE8, injectData, 40, "UChar")
2154offset := dwFunc - (pInjectFunc + 45)
2155NumPut(offset, injectData, 41, "Int")
2156NumPut(0xC3, injectData, 45, "UChar")
2157writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
2158if (ErrorLevel)
2159return false
2160hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
2161if (ErrorLevel)
2162return false
2163waitForSingleObject(hThread, 0xFFFFFFFF)
2164closeProcess(hThread)
2165return true
2166}
2167initZonesAndCities() {
2168AddCity("Las Venturas", 685.0, 476.093, -500.0, 3000.0, 3000.0, 500.0)
2169AddCity("San Fierro", -3000.0, -742.306, -500.0, -1270.53, 1530.24, 500.0)
2170AddCity("San Fierro", -1270.53, -402.481, -500.0, -1038.45, 832.495, 500.0)
2171AddCity("San Fierro", -1038.45, -145.539, -500.0, -897.546, 376.632, 500.0)
2172AddCity("Los Santos", 480.0, -3000.0, -500.0, 3000.0, -850.0, 500.0)
2173AddCity("Los Santos", 80.0, -2101.61, -500.0, 1075.0, -1239.61, 500.0)
2174AddCity("Tierra Robada", -1213.91, 596.349, -242.99, -480.539, 1659.68, 900.0)
2175AddCity("Red County", -1213.91, -768.027, -242.99, 2997.06, 596.349, 900.0)
2176AddCity("Flint County", -1213.91, -2892.97, -242.99, 44.6147, -768.027, 900.0)
2177AddCity("Whetstone", -2997.47, -2892.97, -242.99, -1213.91, -1115.58, 900.0)
2178AddZone("Avispa Country Club", -2667.810, -302.135, -28.831, -2646.400, -262.320, 71.169)
2179AddZone("Easter Bay Airport", -1315.420, -405.388, 15.406, -1264.400, -209.543, 25.406)
2180AddZone("Avispa Country Club", -2550.040, -355.493, 0.000, -2470.040, -318.493, 39.700)
2181AddZone("Easter Bay Airport", -1490.330, -209.543, 15.406, -1264.400, -148.388, 25.406)
2182AddZone("Garcia", -2395.140, -222.589, -5.3, -2354.090, -204.792, 200.000)
2183AddZone("Shady Cabin", -1632.830, -2263.440, -3.0, -1601.330, -2231.790, 200.000)
2184AddZone("East Los Santos", 2381.680, -1494.030, -89.084, 2421.030, -1454.350, 110.916)
2185AddZone("LVA Freight Depot", 1236.630, 1163.410, -89.084, 1277.050, 1203.280, 110.916)
2186AddZone("Blackfield Intersection", 1277.050, 1044.690, -89.084, 1315.350, 1087.630, 110.916)
2187AddZone("Avispa Country Club", -2470.040, -355.493, 0.000, -2270.040, -318.493, 46.100)
2188AddZone("Temple", 1252.330, -926.999, -89.084, 1357.000, -910.170, 110.916)
2189AddZone("Unity Station", 1692.620, -1971.800, -20.492, 1812.620, -1932.800, 79.508)
2190AddZone("LVA Freight Depot", 1315.350, 1044.690, -89.084, 1375.600, 1087.630, 110.916)
2191AddZone("Los Flores", 2581.730, -1454.350, -89.084, 2632.830, -1393.420, 110.916)
2192AddZone("Starfish Casino", 2437.390, 1858.100, -39.084, 2495.090, 1970.850, 60.916)
2193AddZone("Easter Bay Chemicals", -1132.820, -787.391, 0.000, -956.476, -768.027, 200.000)
2194AddZone("Downtown Los Santos", 1370.850, -1170.870, -89.084, 1463.900, -1130.850, 110.916)
2195AddZone("Esplanade East", -1620.300, 1176.520, -4.5, -1580.010, 1274.260, 200.000)
2196AddZone("Market Station", 787.461, -1410.930, -34.126, 866.009, -1310.210, 65.874)
2197AddZone("Linden Station", 2811.250, 1229.590, -39.594, 2861.250, 1407.590, 60.406)
2198AddZone("Montgomery Intersection", 1582.440, 347.457, 0.000, 1664.620, 401.750, 200.000)
2199AddZone("Frederick Bridge", 2759.250, 296.501, 0.000, 2774.250, 594.757, 200.000)
2200AddZone("Yellow Bell Station", 1377.480, 2600.430, -21.926, 1492.450, 2687.360, 78.074)
2201AddZone("Downtown Los Santos", 1507.510, -1385.210, 110.916, 1582.550, -1325.310, 335.916)
2202AddZone("Jefferson", 2185.330, -1210.740, -89.084, 2281.450, -1154.590, 110.916)
2203AddZone("Mulholland", 1318.130, -910.170, -89.084, 1357.000, -768.027, 110.916)
2204AddZone("Avispa Country Club", -2361.510, -417.199, 0.000, -2270.040, -355.493, 200.000)
2205AddZone("Jefferson", 1996.910, -1449.670, -89.084, 2056.860, -1350.720, 110.916)
2206AddZone("Julius Thruway West", 1236.630, 2142.860, -89.084, 1297.470, 2243.230, 110.916)
2207AddZone("Jefferson", 2124.660, -1494.030, -89.084, 2266.210, -1449.670, 110.916)
2208AddZone("Julius Thruway North", 1848.400, 2478.490, -89.084, 1938.800, 2553.490, 110.916)
2209AddZone("Rodeo", 422.680, -1570.200, -89.084, 466.223, -1406.050, 110.916)
2210AddZone("Cranberry Station", -2007.830, 56.306, 0.000, -1922.000, 224.782, 100.000)
2211AddZone("Downtown Los Santos", 1391.050, -1026.330, -89.084, 1463.900, -926.999, 110.916)
2212AddZone("Redsands West", 1704.590, 2243.230, -89.084, 1777.390, 2342.830, 110.916)
2213AddZone("Little Mexico", 1758.900, -1722.260, -89.084, 1812.620, -1577.590, 110.916)
2214AddZone("Blackfield Intersection", 1375.600, 823.228, -89.084, 1457.390, 919.447, 110.916)
2215AddZone("Los Santos International", 1974.630, -2394.330, -39.084, 2089.000, -2256.590, 60.916)
2216AddZone("Beacon Hill", -399.633, -1075.520, -1.489, -319.033, -977.516, 198.511)
2217AddZone("Rodeo", 334.503, -1501.950, -89.084, 422.680, -1406.050, 110.916)
2218AddZone("Richman", 225.165, -1369.620, -89.084, 334.503, -1292.070, 110.916)
2219AddZone("Downtown Los Santos", 1724.760, -1250.900, -89.084, 1812.620, -1150.870, 110.916)
2220AddZone("The Strip", 2027.400, 1703.230, -89.084, 2137.400, 1783.230, 110.916)
2221AddZone("Downtown Los Santos", 1378.330, -1130.850, -89.084, 1463.900, -1026.330, 110.916)
2222AddZone("Blackfield Intersection", 1197.390, 1044.690, -89.084, 1277.050, 1163.390, 110.916)
2223AddZone("Conference Center", 1073.220, -1842.270, -89.084, 1323.900, -1804.210, 110.916)
2224AddZone("Montgomery", 1451.400, 347.457, -6.1, 1582.440, 420.802, 200.000)
2225AddZone("Foster Valley", -2270.040, -430.276, -1.2, -2178.690, -324.114, 200.000)
2226AddZone("Blackfield Chapel", 1325.600, 596.349, -89.084, 1375.600, 795.010, 110.916)
2227AddZone("Los Santos International", 2051.630, -2597.260, -39.084, 2152.450, -2394.330, 60.916)
2228AddZone("Mulholland", 1096.470, -910.170, -89.084, 1169.130, -768.027, 110.916)
2229AddZone("Yellow Bell Gol Course", 1457.460, 2723.230, -89.084, 1534.560, 2863.230, 110.916)
2230AddZone("The Strip", 2027.400, 1783.230, -89.084, 2162.390, 1863.230, 110.916)
2231AddZone("Jefferson", 2056.860, -1210.740, -89.084, 2185.330, -1126.320, 110.916)
2232AddZone("Mulholland", 952.604, -937.184, -89.084, 1096.470, -860.619, 110.916)
2233AddZone("Aldea Malvada", -1372.140, 2498.520, 0.000, -1277.590, 2615.350, 200.000)
2234AddZone("Las Colinas", 2126.860, -1126.320, -89.084, 2185.330, -934.489, 110.916)
2235AddZone("Las Colinas", 1994.330, -1100.820, -89.084, 2056.860, -920.815, 110.916)
2236AddZone("Richman", 647.557, -954.662, -89.084, 768.694, -860.619, 110.916)
2237AddZone("LVA Freight Depot", 1277.050, 1087.630, -89.084, 1375.600, 1203.280, 110.916)
2238AddZone("Julius Thruway North", 1377.390, 2433.230, -89.084, 1534.560, 2507.230, 110.916)
2239AddZone("Willowfield", 2201.820, -2095.000, -89.084, 2324.000, -1989.900, 110.916)
2240AddZone("Julius Thruway North", 1704.590, 2342.830, -89.084, 1848.400, 2433.230, 110.916)
2241AddZone("Temple", 1252.330, -1130.850, -89.084, 1378.330, -1026.330, 110.916)
2242AddZone("Little Mexico", 1701.900, -1842.270, -89.084, 1812.620, -1722.260, 110.916)
2243AddZone("Queens", -2411.220, 373.539, 0.000, -2253.540, 458.411, 200.000)
2244AddZone("Las Venturas Airport", 1515.810, 1586.400, -12.500, 1729.950, 1714.560, 87.500)
2245AddZone("Richman", 225.165, -1292.070, -89.084, 466.223, -1235.070, 110.916)
2246AddZone("Temple", 1252.330, -1026.330, -89.084, 1391.050, -926.999, 110.916)
2247AddZone("East Los Santos", 2266.260, -1494.030, -89.084, 2381.680, -1372.040, 110.916)
2248AddZone("Julius Thruway East", 2623.180, 943.235, -89.084, 2749.900, 1055.960, 110.916)
2249AddZone("Willowfield", 2541.700, -1941.400, -89.084, 2703.580, -1852.870, 110.916)
2250AddZone("Las Colinas", 2056.860, -1126.320, -89.084, 2126.860, -920.815, 110.916)
2251AddZone("Julius Thruway East", 2625.160, 2202.760, -89.084, 2685.160, 2442.550, 110.916)
2252AddZone("Rodeo", 225.165, -1501.950, -89.084, 334.503, -1369.620, 110.916)
2253AddZone("Las Brujas", -365.167, 2123.010, -3.0, -208.570, 2217.680, 200.000)
2254AddZone("Julius Thruway East", 2536.430, 2442.550, -89.084, 2685.160, 2542.550, 110.916)
2255AddZone("Rodeo", 334.503, -1406.050, -89.084, 466.223, -1292.070, 110.916)
2256AddZone("Vinewood", 647.557, -1227.280, -89.084, 787.461, -1118.280, 110.916)
2257AddZone("Rodeo", 422.680, -1684.650, -89.084, 558.099, -1570.200, 110.916)
2258AddZone("Julius Thruway North", 2498.210, 2542.550, -89.084, 2685.160, 2626.550, 110.916)
2259AddZone("Downtown Los Santos", 1724.760, -1430.870, -89.084, 1812.620, -1250.900, 110.916)
2260AddZone("Rodeo", 225.165, -1684.650, -89.084, 312.803, -1501.950, 110.916)
2261AddZone("Jefferson", 2056.860, -1449.670, -89.084, 2266.210, -1372.040, 110.916)
2262AddZone("Hampton Barns", 603.035, 264.312, 0.000, 761.994, 366.572, 200.000)
2263AddZone("Temple", 1096.470, -1130.840, -89.084, 1252.330, -1026.330, 110.916)
2264AddZone("Kincaid Bridge", -1087.930, 855.370, -89.084, -961.950, 986.281, 110.916)
2265AddZone("Verona Beach", 1046.150, -1722.260, -89.084, 1161.520, -1577.590, 110.916)
2266AddZone("Commerce", 1323.900, -1722.260, -89.084, 1440.900, -1577.590, 110.916)
2267AddZone("Mulholland", 1357.000, -926.999, -89.084, 1463.900, -768.027, 110.916)
2268AddZone("Rodeo", 466.223, -1570.200, -89.084, 558.099, -1385.070, 110.916)
2269AddZone("Mulholland", 911.802, -860.619, -89.084, 1096.470, -768.027, 110.916)
2270AddZone("Mulholland", 768.694, -954.662, -89.084, 952.604, -860.619, 110.916)
2271AddZone("Julius Thruway South", 2377.390, 788.894, -89.084, 2537.390, 897.901, 110.916)
2272AddZone("Idlewood", 1812.620, -1852.870, -89.084, 1971.660, -1742.310, 110.916)
2273AddZone("Ocean Docks", 2089.000, -2394.330, -89.084, 2201.820, -2235.840, 110.916)
2274AddZone("Commerce", 1370.850, -1577.590, -89.084, 1463.900, -1384.950, 110.916)
2275AddZone("Julius Thruway North", 2121.400, 2508.230, -89.084, 2237.400, 2663.170, 110.916)
2276AddZone("Temple", 1096.470, -1026.330, -89.084, 1252.330, -910.170, 110.916)
2277AddZone("Glen Park", 1812.620, -1449.670, -89.084, 1996.910, -1350.720, 110.916)
2278AddZone("Easter Bay Airport", -1242.980, -50.096, 0.000, -1213.910, 578.396, 200.000)
2279AddZone("Martin Bridge", -222.179, 293.324, 0.000, -122.126, 476.465, 200.000)
2280AddZone("The Strip", 2106.700, 1863.230, -89.084, 2162.390, 2202.760, 110.916)
2281AddZone("Willowfield", 2541.700, -2059.230, -89.084, 2703.580, -1941.400, 110.916)
2282AddZone("Marina", 807.922, -1577.590, -89.084, 926.922, -1416.250, 110.916)
2283AddZone("Las Venturas Airport", 1457.370, 1143.210, -89.084, 1777.400, 1203.280, 110.916)
2284AddZone("Idlewood", 1812.620, -1742.310, -89.084, 1951.660, -1602.310, 110.916)
2285AddZone("Esplanade East", -1580.010, 1025.980, -6.1, -1499.890, 1274.260, 200.000)
2286AddZone("Downtown Los Santos", 1370.850, -1384.950, -89.084, 1463.900, -1170.870, 110.916)
2287AddZone("The Mako Span", 1664.620, 401.750, 0.000, 1785.140, 567.203, 200.000)
2288AddZone("Rodeo", 312.803, -1684.650, -89.084, 422.680, -1501.950, 110.916)
2289AddZone("Pershing Square", 1440.900, -1722.260, -89.084, 1583.500, -1577.590, 110.916)
2290AddZone("Mulholland", 687.802, -860.619, -89.084, 911.802, -768.027, 110.916)
2291AddZone("Gant Bridge", -2741.070, 1490.470, -6.1, -2616.400, 1659.680, 200.000)
2292AddZone("Las Colinas", 2185.330, -1154.590, -89.084, 2281.450, -934.489, 110.916)
2293AddZone("Mulholland", 1169.130, -910.170, -89.084, 1318.130, -768.027, 110.916)
2294AddZone("Julius Thruway North", 1938.800, 2508.230, -89.084, 2121.400, 2624.230, 110.916)
2295AddZone("Commerce", 1667.960, -1577.590, -89.084, 1812.620, -1430.870, 110.916)
2296AddZone("Rodeo", 72.648, -1544.170, -89.084, 225.165, -1404.970, 110.916)
2297AddZone("Roca Escalante", 2536.430, 2202.760, -89.084, 2625.160, 2442.550, 110.916)
2298AddZone("Rodeo", 72.648, -1684.650, -89.084, 225.165, -1544.170, 110.916)
2299AddZone("Market", 952.663, -1310.210, -89.084, 1072.660, -1130.850, 110.916)
2300AddZone("Las Colinas", 2632.740, -1135.040, -89.084, 2747.740, -945.035, 110.916)
2301AddZone("Mulholland", 861.085, -674.885, -89.084, 1156.550, -600.896, 110.916)
2302AddZone("King's", -2253.540, 373.539, -9.1, -1993.280, 458.411, 200.000)
2303AddZone("Redsands East", 1848.400, 2342.830, -89.084, 2011.940, 2478.490, 110.916)
2304AddZone("Downtown", -1580.010, 744.267, -6.1, -1499.890, 1025.980, 200.000)
2305AddZone("Conference Center", 1046.150, -1804.210, -89.084, 1323.900, -1722.260, 110.916)
2306AddZone("Richman", 647.557, -1118.280, -89.084, 787.461, -954.662, 110.916)
2307AddZone("Ocean Flats", -2994.490, 277.411, -9.1, -2867.850, 458.411, 200.000)
2308AddZone("Greenglass College", 964.391, 930.890, -89.084, 1166.530, 1044.690, 110.916)
2309AddZone("Glen Park", 1812.620, -1100.820, -89.084, 1994.330, -973.380, 110.916)
2310AddZone("LVA Freight Depot", 1375.600, 919.447, -89.084, 1457.370, 1203.280, 110.916)
2311AddZone("Regular Tom", -405.770, 1712.860, -3.0, -276.719, 1892.750, 200.000)
2312AddZone("Verona Beach", 1161.520, -1722.260, -89.084, 1323.900, -1577.590, 110.916)
2313AddZone("East Los Santos", 2281.450, -1372.040, -89.084, 2381.680, -1135.040, 110.916)
2314AddZone("Caligula's Palace", 2137.400, 1703.230, -89.084, 2437.390, 1783.230, 110.916)
2315AddZone("Idlewood", 1951.660, -1742.310, -89.084, 2124.660, -1602.310, 110.916)
2316AddZone("Pilgrim", 2624.400, 1383.230, -89.084, 2685.160, 1783.230, 110.916)
2317AddZone("Idlewood", 2124.660, -1742.310, -89.084, 2222.560, -1494.030, 110.916)
2318AddZone("Queens", -2533.040, 458.411, 0.000, -2329.310, 578.396, 200.000)
2319AddZone("Downtown", -1871.720, 1176.420, -4.5, -1620.300, 1274.260, 200.000)
2320AddZone("Commerce", 1583.500, -1722.260, -89.084, 1758.900, -1577.590, 110.916)
2321AddZone("East Los Santos", 2381.680, -1454.350, -89.084, 2462.130, -1135.040, 110.916)
2322AddZone("Marina", 647.712, -1577.590, -89.084, 807.922, -1416.250, 110.916)
2323AddZone("Richman", 72.648, -1404.970, -89.084, 225.165, -1235.070, 110.916)
2324AddZone("Vinewood", 647.712, -1416.250, -89.084, 787.461, -1227.280, 110.916)
2325AddZone("East Los Santos", 2222.560, -1628.530, -89.084, 2421.030, -1494.030, 110.916)
2326AddZone("Rodeo", 558.099, -1684.650, -89.084, 647.522, -1384.930, 110.916)
2327AddZone("Easter Tunnel", -1709.710, -833.034, -1.5, -1446.010, -730.118, 200.000)
2328AddZone("Rodeo", 466.223, -1385.070, -89.084, 647.522, -1235.070, 110.916)
2329AddZone("Redsands East", 1817.390, 2202.760, -89.084, 2011.940, 2342.830, 110.916)
2330AddZone("The Clown's Pocket", 2162.390, 1783.230, -89.084, 2437.390, 1883.230, 110.916)
2331AddZone("Idlewood", 1971.660, -1852.870, -89.084, 2222.560, -1742.310, 110.916)
2332AddZone("Montgomery Intersection", 1546.650, 208.164, 0.000, 1745.830, 347.457, 200.000)
2333AddZone("Willowfield", 2089.000, -2235.840, -89.084, 2201.820, -1989.900, 110.916)
2334AddZone("Temple", 952.663, -1130.840, -89.084, 1096.470, -937.184, 110.916)
2335AddZone("Prickle Pine", 1848.400, 2553.490, -89.084, 1938.800, 2863.230, 110.916)
2336AddZone("Los Santos International", 1400.970, -2669.260, -39.084, 2189.820, -2597.260, 60.916)
2337AddZone("Garver Bridge", -1213.910, 950.022, -89.084, -1087.930, 1178.930, 110.916)
2338AddZone("Garver Bridge", -1339.890, 828.129, -89.084, -1213.910, 1057.040, 110.916)
2339AddZone("Kincaid Bridge", -1339.890, 599.218, -89.084, -1213.910, 828.129, 110.916)
2340AddZone("Kincaid Bridge", -1213.910, 721.111, -89.084, -1087.930, 950.022, 110.916)
2341AddZone("Verona Beach", 930.221, -2006.780, -89.084, 1073.220, -1804.210, 110.916)
2342AddZone("Verdant Bluffs", 1073.220, -2006.780, -89.084, 1249.620, -1842.270, 110.916)
2343AddZone("Vinewood", 787.461, -1130.840, -89.084, 952.604, -954.662, 110.916)
2344AddZone("Vinewood", 787.461, -1310.210, -89.084, 952.663, -1130.840, 110.916)
2345AddZone("Commerce", 1463.900, -1577.590, -89.084, 1667.960, -1430.870, 110.916)
2346AddZone("Market", 787.461, -1416.250, -89.084, 1072.660, -1310.210, 110.916)
2347AddZone("Rockshore West", 2377.390, 596.349, -89.084, 2537.390, 788.894, 110.916)
2348AddZone("Julius Thruway North", 2237.400, 2542.550, -89.084, 2498.210, 2663.170, 110.916)
2349AddZone("East Beach", 2632.830, -1668.130, -89.084, 2747.740, -1393.420, 110.916)
2350AddZone("Fallow Bridge", 434.341, 366.572, 0.000, 603.035, 555.680, 200.000)
2351AddZone("Willowfield", 2089.000, -1989.900, -89.084, 2324.000, -1852.870, 110.916)
2352AddZone("Chinatown", -2274.170, 578.396, -7.6, -2078.670, 744.170, 200.000)
2353AddZone("El Castillo del Diablo", -208.570, 2337.180, 0.000, 8.430, 2487.180, 200.000)
2354AddZone("Ocean Docks", 2324.000, -2145.100, -89.084, 2703.580, -2059.230, 110.916)
2355AddZone("Easter Bay Chemicals", -1132.820, -768.027, 0.000, -956.476, -578.118, 200.000)
2356AddZone("The Visage", 1817.390, 1703.230, -89.084, 2027.400, 1863.230, 110.916)
2357AddZone("Ocean Flats", -2994.490, -430.276, -1.2, -2831.890, -222.589, 200.000)
2358AddZone("Richman", 321.356, -860.619, -89.084, 687.802, -768.027, 110.916)
2359AddZone("Green Palms", 176.581, 1305.450, -3.0, 338.658, 1520.720, 200.000)
2360AddZone("Richman", 321.356, -768.027, -89.084, 700.794, -674.885, 110.916)
2361AddZone("Starfish Casino", 2162.390, 1883.230, -89.084, 2437.390, 2012.180, 110.916)
2362AddZone("East Beach", 2747.740, -1668.130, -89.084, 2959.350, -1498.620, 110.916)
2363AddZone("Jefferson", 2056.860, -1372.040, -89.084, 2281.450, -1210.740, 110.916)
2364AddZone("Downtown Los Santos", 1463.900, -1290.870, -89.084, 1724.760, -1150.870, 110.916)
2365AddZone("Downtown Los Santos", 1463.900, -1430.870, -89.084, 1724.760, -1290.870, 110.916)
2366AddZone("Garver Bridge", -1499.890, 696.442, -179.615, -1339.890, 925.353, 20.385)
2367AddZone("Julius Thruway South", 1457.390, 823.228, -89.084, 2377.390, 863.229, 110.916)
2368AddZone("East Los Santos", 2421.030, -1628.530, -89.084, 2632.830, -1454.350, 110.916)
2369AddZone("Greenglass College", 964.391, 1044.690, -89.084, 1197.390, 1203.220, 110.916)
2370AddZone("Las Colinas", 2747.740, -1120.040, -89.084, 2959.350, -945.035, 110.916)
2371AddZone("Mulholland", 737.573, -768.027, -89.084, 1142.290, -674.885, 110.916)
2372AddZone("Ocean Docks", 2201.820, -2730.880, -89.084, 2324.000, -2418.330, 110.916)
2373AddZone("East Los Santos", 2462.130, -1454.350, -89.084, 2581.730, -1135.040, 110.916)
2374AddZone("Ganton", 2222.560, -1722.330, -89.084, 2632.830, -1628.530, 110.916)
2375AddZone("Avispa Country Club", -2831.890, -430.276, -6.1, -2646.400, -222.589, 200.000)
2376AddZone("Willowfield", 1970.620, -2179.250, -89.084, 2089.000, -1852.870, 110.916)
2377AddZone("Esplanade North", -1982.320, 1274.260, -4.5, -1524.240, 1358.900, 200.000)
2378AddZone("The High Roller", 1817.390, 1283.230, -89.084, 2027.390, 1469.230, 110.916)
2379AddZone("Ocean Docks", 2201.820, -2418.330, -89.084, 2324.000, -2095.000, 110.916)
2380AddZone("Last Dime Motel", 1823.080, 596.349, -89.084, 1997.220, 823.228, 110.916)
2381AddZone("Bayside Marina", -2353.170, 2275.790, 0.000, -2153.170, 2475.790, 200.000)
2382AddZone("King's", -2329.310, 458.411, -7.6, -1993.280, 578.396, 200.000)
2383AddZone("El Corona", 1692.620, -2179.250, -89.084, 1812.620, -1842.270, 110.916)
2384AddZone("Blackfield Chapel", 1375.600, 596.349, -89.084, 1558.090, 823.228, 110.916)
2385AddZone("The Pink Swan", 1817.390, 1083.230, -89.084, 2027.390, 1283.230, 110.916)
2386AddZone("Julius Thruway West", 1197.390, 1163.390, -89.084, 1236.630, 2243.230, 110.916)
2387AddZone("Los Flores", 2581.730, -1393.420, -89.084, 2747.740, -1135.040, 110.916)
2388AddZone("The Visage", 1817.390, 1863.230, -89.084, 2106.700, 2011.830, 110.916)
2389AddZone("Prickle Pine", 1938.800, 2624.230, -89.084, 2121.400, 2861.550, 110.916)
2390AddZone("Verona Beach", 851.449, -1804.210, -89.084, 1046.150, -1577.590, 110.916)
2391AddZone("Robada Intersection", -1119.010, 1178.930, -89.084, -862.025, 1351.450, 110.916)
2392AddZone("Linden Side", 2749.900, 943.235, -89.084, 2923.390, 1198.990, 110.916)
2393AddZone("Ocean Docks", 2703.580, -2302.330, -89.084, 2959.350, -2126.900, 110.916)
2394AddZone("Willowfield", 2324.000, -2059.230, -89.084, 2541.700, -1852.870, 110.916)
2395AddZone("King's", -2411.220, 265.243, -9.1, -1993.280, 373.539, 200.000)
2396AddZone("Commerce", 1323.900, -1842.270, -89.084, 1701.900, -1722.260, 110.916)
2397AddZone("Mulholland", 1269.130, -768.027, -89.084, 1414.070, -452.425, 110.916)
2398AddZone("Marina", 647.712, -1804.210, -89.084, 851.449, -1577.590, 110.916)
2399AddZone("Battery Point", -2741.070, 1268.410, -4.5, -2533.040, 1490.470, 200.000)
2400AddZone("The Four Dragons Casino", 1817.390, 863.232, -89.084, 2027.390, 1083.230, 110.916)
2401AddZone("Blackfield", 964.391, 1203.220, -89.084, 1197.390, 1403.220, 110.916)
2402AddZone("Julius Thruway North", 1534.560, 2433.230, -89.084, 1848.400, 2583.230, 110.916)
2403AddZone("Yellow Bell Gol Course", 1117.400, 2723.230, -89.084, 1457.460, 2863.230, 110.916)
2404AddZone("Idlewood", 1812.620, -1602.310, -89.084, 2124.660, -1449.670, 110.916)
2405AddZone("Redsands West", 1297.470, 2142.860, -89.084, 1777.390, 2243.230, 110.916)
2406AddZone("Doherty", -2270.040, -324.114, -1.2, -1794.920, -222.589, 200.000)
2407AddZone("Hilltop Farm", 967.383, -450.390, -3.0, 1176.780, -217.900, 200.000)
2408AddZone("Las Barrancas", -926.130, 1398.730, -3.0, -719.234, 1634.690, 200.000)
2409AddZone("Pirates in Men's Pants", 1817.390, 1469.230, -89.084, 2027.400, 1703.230, 110.916)
2410AddZone("City Hall", -2867.850, 277.411, -9.1, -2593.440, 458.411, 200.000)
2411AddZone("Avispa Country Club", -2646.400, -355.493, 0.000, -2270.040, -222.589, 200.000)
2412AddZone("The Strip", 2027.400, 863.229, -89.084, 2087.390, 1703.230, 110.916)
2413AddZone("Hashbury", -2593.440, -222.589, -1.0, -2411.220, 54.722, 200.000)
2414AddZone("Los Santos International", 1852.000, -2394.330, -89.084, 2089.000, -2179.250, 110.916)
2415AddZone("Whitewood Estates", 1098.310, 1726.220, -89.084, 1197.390, 2243.230, 110.916)
2416AddZone("Sherman Reservoir", -789.737, 1659.680, -89.084, -599.505, 1929.410, 110.916)
2417AddZone("El Corona", 1812.620, -2179.250, -89.084, 1970.620, -1852.870, 110.916)
2418AddZone("Downtown", -1700.010, 744.267, -6.1, -1580.010, 1176.520, 200.000)
2419AddZone("Foster Valley", -2178.690, -1250.970, 0.000, -1794.920, -1115.580, 200.000)
2420AddZone("Las Payasadas", -354.332, 2580.360, 2.0, -133.625, 2816.820, 200.000)
2421AddZone("Valle Ocultado", -936.668, 2611.440, 2.0, -715.961, 2847.900, 200.000)
2422AddZone("Blackfield Intersection", 1166.530, 795.010, -89.084, 1375.600, 1044.690, 110.916)
2423AddZone("Ganton", 2222.560, -1852.870, -89.084, 2632.830, -1722.330, 110.916)
2424AddZone("Easter Bay Airport", -1213.910, -730.118, 0.000, -1132.820, -50.096, 200.000)
2425AddZone("Redsands East", 1817.390, 2011.830, -89.084, 2106.700, 2202.760, 110.916)
2426AddZone("Esplanade East", -1499.890, 578.396, -79.615, -1339.890, 1274.260, 20.385)
2427AddZone("Caligula's Palace", 2087.390, 1543.230, -89.084, 2437.390, 1703.230, 110.916)
2428AddZone("Royal Casino", 2087.390, 1383.230, -89.084, 2437.390, 1543.230, 110.916)
2429AddZone("Richman", 72.648, -1235.070, -89.084, 321.356, -1008.150, 110.916)
2430AddZone("Starfish Casino", 2437.390, 1783.230, -89.084, 2685.160, 2012.180, 110.916)
2431AddZone("Mulholland", 1281.130, -452.425, -89.084, 1641.130, -290.913, 110.916)
2432AddZone("Downtown", -1982.320, 744.170, -6.1, -1871.720, 1274.260, 200.000)
2433AddZone("Hankypanky Point", 2576.920, 62.158, 0.000, 2759.250, 385.503, 200.000)
2434AddZone("K.A.C.C. Military Fuels", 2498.210, 2626.550, -89.084, 2749.900, 2861.550, 110.916)
2435AddZone("Harry Gold Parkway", 1777.390, 863.232, -89.084, 1817.390, 2342.830, 110.916)
2436AddZone("Bayside Tunnel", -2290.190, 2548.290, -89.084, -1950.190, 2723.290, 110.916)
2437AddZone("Ocean Docks", 2324.000, -2302.330, -89.084, 2703.580, -2145.100, 110.916)
2438AddZone("Richman", 321.356, -1044.070, -89.084, 647.557, -860.619, 110.916)
2439AddZone("Randolph Industrial Estate", 1558.090, 596.349, -89.084, 1823.080, 823.235, 110.916)
2440AddZone("East Beach", 2632.830, -1852.870, -89.084, 2959.350, -1668.130, 110.916)
2441AddZone("Flint Water", -314.426, -753.874, -89.084, -106.339, -463.073, 110.916)
2442AddZone("Blueberry", 19.607, -404.136, 3.8, 349.607, -220.137, 200.000)
2443AddZone("Linden Station", 2749.900, 1198.990, -89.084, 2923.390, 1548.990, 110.916)
2444AddZone("Glen Park", 1812.620, -1350.720, -89.084, 2056.860, -1100.820, 110.916)
2445AddZone("Downtown", -1993.280, 265.243, -9.1, -1794.920, 578.396, 200.000)
2446AddZone("Redsands West", 1377.390, 2243.230, -89.084, 1704.590, 2433.230, 110.916)
2447AddZone("Richman", 321.356, -1235.070, -89.084, 647.522, -1044.070, 110.916)
2448AddZone("Gant Bridge", -2741.450, 1659.680, -6.1, -2616.400, 2175.150, 200.000)
2449AddZone("Lil' Probe Inn", -90.218, 1286.850, -3.0, 153.859, 1554.120, 200.000)
2450AddZone("Flint Intersection", -187.700, -1596.760, -89.084, 17.063, -1276.600, 110.916)
2451AddZone("Las Colinas", 2281.450, -1135.040, -89.084, 2632.740, -945.035, 110.916)
2452AddZone("Sobell Rail Yards", 2749.900, 1548.990, -89.084, 2923.390, 1937.250, 110.916)
2453AddZone("The Emerald Isle", 2011.940, 2202.760, -89.084, 2237.400, 2508.230, 110.916)
2454AddZone("El Castillo del Diablo", -208.570, 2123.010, -7.6, 114.033, 2337.180, 200.000)
2455AddZone("Santa Flora", -2741.070, 458.411, -7.6, -2533.040, 793.411, 200.000)
2456AddZone("Playa del Seville", 2703.580, -2126.900, -89.084, 2959.350, -1852.870, 110.916)
2457AddZone("Market", 926.922, -1577.590, -89.084, 1370.850, -1416.250, 110.916)
2458AddZone("Queens", -2593.440, 54.722, 0.000, -2411.220, 458.411, 200.000)
2459AddZone("Pilson Intersection", 1098.390, 2243.230, -89.084, 1377.390, 2507.230, 110.916)
2460AddZone("Spinybed", 2121.400, 2663.170, -89.084, 2498.210, 2861.550, 110.916)
2461AddZone("Pilgrim", 2437.390, 1383.230, -89.084, 2624.400, 1783.230, 110.916)
2462AddZone("Blackfield", 964.391, 1403.220, -89.084, 1197.390, 1726.220, 110.916)
2463AddZone("'The Big Ear'", -410.020, 1403.340, -3.0, -137.969, 1681.230, 200.000)
2464AddZone("Dillimore", 580.794, -674.885, -9.5, 861.085, -404.790, 200.000)
2465AddZone("El Quebrados", -1645.230, 2498.520, 0.000, -1372.140, 2777.850, 200.000)
2466AddZone("Esplanade North", -2533.040, 1358.900, -4.5, -1996.660, 1501.210, 200.000)
2467AddZone("Easter Bay Airport", -1499.890, -50.096, -1.0, -1242.980, 249.904, 200.000)
2468AddZone("Fisher's Lagoon", 1916.990, -233.323, -100.000, 2131.720, 13.800, 200.000)
2469AddZone("Mulholland", 1414.070, -768.027, -89.084, 1667.610, -452.425, 110.916)
2470AddZone("East Beach", 2747.740, -1498.620, -89.084, 2959.350, -1120.040, 110.916)
2471AddZone("San Andreas Sound", 2450.390, 385.503, -100.000, 2759.250, 562.349, 200.000)
2472AddZone("Shady Creeks", -2030.120, -2174.890, -6.1, -1820.640, -1771.660, 200.000)
2473AddZone("Market", 1072.660, -1416.250, -89.084, 1370.850, -1130.850, 110.916)
2474AddZone("Rockshore West", 1997.220, 596.349, -89.084, 2377.390, 823.228, 110.916)
2475AddZone("Prickle Pine", 1534.560, 2583.230, -89.084, 1848.400, 2863.230, 110.916)
2476AddZone("Easter Basin", -1794.920, -50.096, -1.04, -1499.890, 249.904, 200.000)
2477AddZone("Leafy Hollow", -1166.970, -1856.030, 0.000, -815.624, -1602.070, 200.000)
2478AddZone("LVA Freight Depot", 1457.390, 863.229, -89.084, 1777.400, 1143.210, 110.916)
2479AddZone("Prickle Pine", 1117.400, 2507.230, -89.084, 1534.560, 2723.230, 110.916)
2480AddZone("Blueberry", 104.534, -220.137, 2.3, 349.607, 152.236, 200.000)
2481AddZone("El Castillo del Diablo", -464.515, 2217.680, 0.000, -208.570, 2580.360, 200.000)
2482AddZone("Downtown", -2078.670, 578.396, -7.6, -1499.890, 744.267, 200.000)
2483AddZone("Rockshore East", 2537.390, 676.549, -89.084, 2902.350, 943.235, 110.916)
2484AddZone("San Fierro Bay", -2616.400, 1501.210, -3.0, -1996.660, 1659.680, 200.000)
2485AddZone("Paradiso", -2741.070, 793.411, -6.1, -2533.040, 1268.410, 200.000)
2486AddZone("The Camel's Toe", 2087.390, 1203.230, -89.084, 2640.400, 1383.230, 110.916)
2487AddZone("Old Venturas Strip", 2162.390, 2012.180, -89.084, 2685.160, 2202.760, 110.916)
2488AddZone("Juniper Hill", -2533.040, 578.396, -7.6, -2274.170, 968.369, 200.000)
2489AddZone("Juniper Hollow", -2533.040, 968.369, -6.1, -2274.170, 1358.900, 200.000)
2490AddZone("Roca Escalante", 2237.400, 2202.760, -89.084, 2536.430, 2542.550, 110.916)
2491AddZone("Julius Thruway East", 2685.160, 1055.960, -89.084, 2749.900, 2626.550, 110.916)
2492AddZone("Verona Beach", 647.712, -2173.290, -89.084, 930.221, -1804.210, 110.916)
2493AddZone("Foster Valley", -2178.690, -599.884, -1.2, -1794.920, -324.114, 200.000)
2494AddZone("Arco del Oeste", -901.129, 2221.860, 0.000, -592.090, 2571.970, 200.000)
2495AddZone("Fallen Tree", -792.254, -698.555, -5.3, -452.404, -380.043, 200.000)
2496AddZone("The Farm", -1209.670, -1317.100, 114.981, -908.161, -787.391, 251.981)
2497AddZone("The Sherman Dam", -968.772, 1929.410, -3.0, -481.126, 2155.260, 200.000)
2498AddZone("Esplanade North", -1996.660, 1358.900, -4.5, -1524.240, 1592.510, 200.000)
2499AddZone("Financial", -1871.720, 744.170, -6.1, -1701.300, 1176.420, 300.000)
2500AddZone("Garcia", -2411.220, -222.589, -1.14, -2173.040, 265.243, 200.000)
2501AddZone("Montgomery", 1119.510, 119.526, -3.0, 1451.400, 493.323, 200.000)
2502AddZone("Creek", 2749.900, 1937.250, -89.084, 2921.620, 2669.790, 110.916)
2503AddZone("Los Santos International", 1249.620, -2394.330, -89.084, 1852.000, -2179.250, 110.916)
2504AddZone("Santa Maria Beach", 72.648, -2173.290, -89.084, 342.648, -1684.650, 110.916)
2505AddZone("Mulholland Intersection", 1463.900, -1150.870, -89.084, 1812.620, -768.027, 110.916)
2506AddZone("Angel Pine", -2324.940, -2584.290, -6.1, -1964.220, -2212.110, 200.000)
2507AddZone("Verdant Meadows", 37.032, 2337.180, -3.0, 435.988, 2677.900, 200.000)
2508AddZone("Octane Springs", 338.658, 1228.510, 0.000, 664.308, 1655.050, 200.000)
2509AddZone("Come-A-Lot", 2087.390, 943.235, -89.084, 2623.180, 1203.230, 110.916)
2510AddZone("Redsands West", 1236.630, 1883.110, -89.084, 1777.390, 2142.860, 110.916)
2511AddZone("Santa Maria Beach", 342.648, -2173.290, -89.084, 647.712, -1684.650, 110.916)
2512AddZone("Verdant Bluffs", 1249.620, -2179.250, -89.084, 1692.620, -1842.270, 110.916)
2513AddZone("Las Venturas Airport", 1236.630, 1203.280, -89.084, 1457.370, 1883.110, 110.916)
2514AddZone("Flint Range", -594.191, -1648.550, 0.000, -187.700, -1276.600, 200.000)
2515AddZone("Verdant Bluffs", 930.221, -2488.420, -89.084, 1249.620, -2006.780, 110.916)
2516AddZone("Palomino Creek", 2160.220, -149.004, 0.000, 2576.920, 228.322, 200.000)
2517AddZone("Ocean Docks", 2373.770, -2697.090, -89.084, 2809.220, -2330.460, 110.916)
2518AddZone("Easter Bay Airport", -1213.910, -50.096, -4.5, -947.980, 578.396, 200.000)
2519AddZone("Whitewood Estates", 883.308, 1726.220, -89.084, 1098.310, 2507.230, 110.916)
2520AddZone("Calton Heights", -2274.170, 744.170, -6.1, -1982.320, 1358.900, 200.000)
2521AddZone("Easter Basin", -1794.920, 249.904, -9.1, -1242.980, 578.396, 200.000)
2522AddZone("Los Santos Inlet", -321.744, -2224.430, -89.084, 44.615, -1724.430, 110.916)
2523AddZone("Doherty", -2173.040, -222.589, -1.0, -1794.920, 265.243, 200.000)
2524AddZone("Mount Chiliad", -2178.690, -2189.910, -47.917, -2030.120, -1771.660, 576.083)
2525AddZone("Fort Carson", -376.233, 826.326, -3.0, 123.717, 1220.440, 200.000)
2526AddZone("Foster Valley", -2178.690, -1115.580, 0.000, -1794.920, -599.884, 200.000)
2527AddZone("Ocean Flats", -2994.490, -222.589, -1.0, -2593.440, 277.411, 200.000)
2528AddZone("Fern Ridge", 508.189, -139.259, 0.000, 1306.660, 119.526, 200.000)
2529AddZone("Bayside", -2741.070, 2175.150, 0.000, -2353.170, 2722.790, 200.000)
2530AddZone("Las Venturas Airport", 1457.370, 1203.280, -89.084, 1777.390, 1883.110, 110.916)
2531AddZone("Blueberry Acres", -319.676, -220.137, 0.000, 104.534, 293.324, 200.000)
2532AddZone("Palisades", -2994.490, 458.411, -6.1, -2741.070, 1339.610, 200.000)
2533AddZone("North Rock", 2285.370, -768.027, 0.000, 2770.590, -269.740, 200.000)
2534AddZone("Hunter Quarry", 337.244, 710.840, -115.239, 860.554, 1031.710, 203.761)
2535AddZone("Los Santos International", 1382.730, -2730.880, -89.084, 2201.820, -2394.330, 110.916)
2536AddZone("Missionary Hill", -2994.490, -811.276, 0.000, -2178.690, -430.276, 200.000)
2537AddZone("San Fierro Bay", -2616.400, 1659.680, -3.0, -1996.660, 2175.150, 200.000)
2538AddZone("Restricted Area", -91.586, 1655.050, -50.000, 421.234, 2123.010, 250.000)
2539AddZone("Mount Chiliad", -2997.470, -1115.580, -47.917, -2178.690, -971.913, 576.083)
2540AddZone("Mount Chiliad", -2178.690, -1771.660, -47.917, -1936.120, -1250.970, 576.083)
2541AddZone("Easter Bay Airport", -1794.920, -730.118, -3.0, -1213.910, -50.096, 200.000)
2542AddZone("The Panopticon", -947.980, -304.320, -1.1, -319.676, 327.071, 200.000)
2543AddZone("Shady Creeks", -1820.640, -2643.680, -8.0, -1226.780, -1771.660, 200.000)
2544AddZone("Back o Beyond", -1166.970, -2641.190, 0.000, -321.744, -1856.030, 200.000)
2545AddZone("Mount Chiliad", -2994.490, -2189.910, -47.917, -2178.690, -1115.580, 576.083)
2546AddZone("Tierra Robada", -1213.910, 596.349, -242.990, -480.539, 1659.680, 900.000)
2547AddZone("Flint County", -1213.910, -2892.970, -242.990, 44.615, -768.027, 900.000)
2548AddZone("Whetstone", -2997.470, -2892.970, -242.990, -1213.910, -1115.580, 900.000)
2549AddZone("Bone County", -480.539, 596.349, -242.990, 869.461, 2993.870, 900.000)
2550AddZone("Tierra Robada", -2997.470, 1659.680, -242.990, -480.539, 2993.870, 900.000)
2551AddZone("San Fierro", -2997.470, -1115.580, -242.990, -1213.910, 1659.680, 900.000)
2552AddZone("Las Venturas", 869.461, 596.349, -242.990, 2997.060, 2993.870, 900.000)
2553AddZone("Red County", -1213.910, -768.027, -242.990, 2997.060, 596.349, 900.000)
2554AddZone("Los Santos", 44.615, -2892.970, -242.990, 2997.060, -768.027, 900.000)
2555}
2556calculateZone(posX, posY, posZ) {
2557if ( bInitZaC == 0 )
2558{
2559initZonesAndCities()
2560bInitZaC := 1
2561}
2562Loop % nZone-1
2563{
2564if (posX >= zone%A_Index%_x1) && (posY >= zone%A_Index%_y1) && (posZ >= zone%A_Index%_z1) && (posX <= zone%A_Index%_x2) && (posY <= zone%A_Index%_y2) && (posZ <= zone%A_Index%_z2)
2565{
2566ErrorLevel := ERROR_OK
2567return zone%A_Index%_name
2568}
2569}
2570ErrorLevel := ERROR_ZONE_NOT_FOUND
2571return "Unbekannt"
2572}
2573calculateCity(posX, posY, posZ) {
2574if ( bInitZaC == 0 )
2575{
2576initZonesAndCities()
2577bInitZaC := 1
2578}
2579smallestCity := "Unbekannt"
2580currentCitySize := 0
2581smallestCitySize := 0
2582Loop % nCity-1
2583{
2584if (posX >= city%A_Index%_x1) && (posY >= city%A_Index%_y1) && (posZ >= city%A_Index%_z1) && (posX <= city%A_Index%_x2) && (posY <= city%A_Index%_y2) && (posZ <= city%A_Index%_z2)
2585{
2586currentCitySize := ((city%A_Index%_x2 - city%A_Index%_x1) * (city%A_Index%_y2 - city%A_Index%_y1) * (city%A_Index%_z2 - city%A_Index%_z1))
2587if (smallestCity == "Unbekannt") || (currentCitySize < smallestCitySize)
2588{
2589smallestCity := city%A_Index%_name
2590smallestCitySize := currentCitySize
2591}
2592}
2593}
2594if(smallestCity == "Unbekannt") {
2595ErrorLevel := ERROR_CITY_NOT_FOUND
2596} else {
2597ErrorLevel := ERROR_OK
2598}
2599return smallestCity
2600}
2601AddZone(sName, x1, y1, z1, x2, y2, z2) {
2602global
2603zone%nZone%_name := sName
2604zone%nZone%_x1 := x1
2605zone%nZone%_y1 := y1
2606zone%nZone%_z1 := z1
2607zone%nZone%_x2 := x2
2608zone%nZone%_y2 := y2
2609zone%nZone%_z2 := z2
2610nZone := nZone + 1
2611}
2612AddCity(sName, x1, y1, z1, x2, y2, z2) {
2613global
2614city%nCity%_name := sName
2615city%nCity%_x1 := x1
2616city%nCity%_y1 := y1
2617city%nCity%_z1 := z1
2618city%nCity%_x2 := x2
2619city%nCity%_y2 := y2
2620city%nCity%_z2 := z2
2621nCity := nCity + 1
2622}
2623IsPlayerInRangeOfPoint(_posX, _posY, _posZ, _posRadius)
2624{
2625GetPlayerPos(posX, posY, posZ)
2626X := posX -_posX
2627Y := posY -_posY
2628Z := posZ -_posZ
2629if(((X < _posRadius) && (X > -_posRadius)) && ((Y < _posRadius) && (Y > -_posRadius)) && ((Z < _posRadius) && (Z > -_posRadius)))
2630return TRUE
2631return FALSE
2632}
2633IsPlayerInRangeOfPoint2D(_posX, _posY, _posRadius)
2634{
2635GetPlayerPos(posX, posY, posZ)
2636X := posX - _posX
2637Y := posY - _posY
2638if(((X < _posRadius) && (X > -_posRadius)) && ((Y < _posRadius) && (Y > -_posRadius)))
2639return TRUE
2640return FALSE
2641}
2642getPlayerZone()
2643{
2644aktPos := getCoordinates()
2645return calculateZone(aktPos[1], aktPos[2], aktPos[3])
2646}
2647getPlayerCity()
2648{
2649aktPos := getCoordinates()
2650return calculateCity(aktPos[1], aktPos[2], aktPos[3])
2651}
2652AntiCrash(){
2653If(!checkHandles())
2654return false
2655cReport := ADDR_SAMP_CRASHREPORT
2656writeMemory(hGTA, dwSAMP + cReport, 0x90909090, 4)
2657cReport += 0x4
2658writeMemory(hGTA, dwSAMP + cReport, 0x90, 1)
2659cReport += 0x9
2660writeMemory(hGTA, dwSAMP + cReport, 0x90909090, 4)
2661cReport += 0x4
2662writeMemory(hGTA, dwSAMP + cReport, 0x90, 1)
2663}
2664writeMemory(hProcess,address,writevalue,length=4, datatype="int") {
2665if(!hProcess) {
2666ErrorLevel := ERROR_INVALID_HANDLE
2667return false
2668}
2669VarSetCapacity(finalvalue,length, 0)
2670NumPut(writevalue,finalvalue,0,datatype)
2671dwRet := DllCall( "WriteProcessMemory"
2672,"Uint",hProcess
2673,"Uint",address
2674,"Uint",&finalvalue
2675,"Uint",length
2676,"Uint",0)
2677if(dwRet == 0) {
2678ErrorLevel := ERROR_WRITE_MEMORY
2679return false
2680}
2681ErrorLevel := ERROR_OK
2682return true
2683}
2684checkHandles() {
2685if(iRefreshHandles+500>A_TickCount)
2686return true
2687iRefreshHandles:=A_TickCount
2688if(!refreshGTA() || !refreshSAMP() || !refreshMemory()) {
2689return false
2690} else {
2691return true
2692}
2693return true
2694}
2695refreshGTA() {
2696newPID := getPID("GTA:SA:MP")
2697if(!newPID) {
2698if(hGTA) {
2699virtualFreeEx(hGTA, pMemory, 0, 0x8000)
2700closeProcess(hGTA)
2701hGTA := 0x0
2702}
2703dwGTAPID := 0
2704hGTA := 0x0
2705dwSAMP := 0x0
2706pMemory := 0x0
2707return false
2708}
2709if(!hGTA || (dwGTAPID != newPID)) {
2710hGTA := openProcess(newPID)
2711if(ErrorLevel) {
2712dwGTAPID := 0
2713hGTA := 0x0
2714dwSAMP := 0x0
2715pMemory := 0x0
2716return false
2717}
2718dwGTAPID := newPID
2719dwSAMP := 0x0
2720pMemory := 0x0
2721return true
2722}
2723return true
2724}
2725refreshSAMP() {
2726if(dwSAMP)
2727return true
2728dwSAMP := getModuleBaseAddress("samp.dll", hGTA)
2729if(!dwSAMP)
2730return false
2731return true
2732}
2733refreshMemory() {
2734if(!pMemory) {
2735pMemory := virtualAllocEx(hGTA, 6144, 0x1000 | 0x2000, 0x40)
2736if(ErrorLevel) {
2737pMemory := 0x0
2738return false
2739}
2740pParam1 := pMemory
2741pParam2 := pMemory + 1024
2742pParam3 := pMemory + 2048
2743pParam4 := pMemory + 3072
2744pParam5 := pMemory + 4096
2745pInjectFunc := pMemory + 5120
2746}
2747return true
2748}
2749getPID(szWindow) {
2750local dwPID := 0
2751WinGet, dwPID, PID, %szWindow%
2752return dwPID
2753}
2754openProcess(dwPID, dwRights = 0x1F0FFF) {
2755hProcess := DllCall("OpenProcess"
2756, "UInt", dwRights
2757, "int", 0
2758, "UInt", dwPID
2759, "Uint")
2760if(hProcess == 0) {
2761ErrorLevel := ERROR_OPEN_PROCESS
2762return 0
2763}
2764ErrorLevel := ERROR_OK
2765return hProcess
2766}
2767closeProcess(hProcess) {
2768if(hProcess == 0) {
2769ErrorLevel := ERROR_INVALID_HANDLE
2770return 0
2771}
2772dwRet := DllCall( "CloseHandle"
2773, "Uint", hProcess
2774, "UInt")
2775ErrorLevel := ERROR_OK
2776}
2777getModuleBaseAddress(sModule, hProcess) {
2778if(!sModule) {
2779ErrorLevel := ERROR_MODULE_NOT_FOUND
2780return 0
2781}
2782if(!hProcess) {
2783ErrorLevel := ERROR_INVALID_HANDLE
2784return 0
2785}
2786dwSize = 1024*4
2787VarSetCapacity(hMods, dwSize)
2788VarSetCapacity(cbNeeded, 4)
2789dwRet := DllCall( "Psapi.dll\EnumProcessModules"
2790, "UInt", hProcess
2791, "UInt", &hMods
2792, "UInt", dwSize
2793, "UInt*", cbNeeded
2794, "UInt")
2795if(dwRet == 0) {
2796ErrorLevel := ERROR_ENUM_PROCESS_MODULES
2797return 0
2798}
2799dwMods := cbNeeded / 4
2800i := 0
2801VarSetCapacity(hModule, 4)
2802VarSetCapacity(sCurModule, 260)
2803while(i < dwMods) {
2804hModule := NumGet(hMods, i*4)
2805DllCall("Psapi.dll\GetModuleFileNameEx"
2806, "UInt", hProcess
2807, "UInt", hModule
2808, "Str", sCurModule
2809, "UInt", 260)
2810SplitPath, sCurModule, sFilename
2811if(sModule == sFilename) {
2812ErrorLevel := ERROR_OK
2813return hModule
2814}
2815i := i + 1
2816}
2817ErrorLevel := ERROR_MODULE_NOT_FOUND
2818return 0
2819}
2820readString(hProcess, dwAddress, dwLen) {
2821if(!hProcess) {
2822ErrorLevel := ERROR_INVALID_HANDLE
2823return 0
2824}
2825VarSetCapacity(sRead, dwLen)
2826dwRet := DllCall( "ReadProcessMemory"
2827, "UInt", hProcess
2828, "UInt", dwAddress
2829, "Str", sRead
2830, "UInt", dwLen
2831, "UInt*", 0
2832, "UInt")
2833if(dwRet == 0) {
2834ErrorLevel := ERROR_READ_MEMORY
2835return 0
2836}
2837ErrorLevel := ERROR_OK
2838if A_IsUnicode
2839return __ansiToUnicode(sRead)
2840return sRead
2841}
2842readFloat(hProcess, dwAddress) {
2843if(!hProcess) {
2844ErrorLevel := ERROR_INVALID_HANDLE
2845return 0
2846}
2847VarSetCapacity(dwRead, 4)
2848dwRet := DllCall( "ReadProcessMemory"
2849, "UInt", hProcess
2850, "UInt", dwAddress
2851, "Str", dwRead
2852, "UInt", 4
2853, "UInt*", 0
2854, "UInt")
2855if(dwRet == 0) {
2856ErrorLevel := ERROR_READ_MEMORY
2857return 0
2858}
2859ErrorLevel := ERROR_OK
2860return NumGet(dwRead, 0, "Float")
2861}
2862readDWORD(hProcess, dwAddress) {
2863if(!hProcess) {
2864ErrorLevel := ERROR_INVALID_HANDLE
2865return 0
2866}
2867VarSetCapacity(dwRead, 4)
2868dwRet := DllCall( "ReadProcessMemory"
2869, "UInt", hProcess
2870, "UInt", dwAddress
2871, "Str", dwRead
2872, "UInt", 4
2873, "UInt*", 0)
2874if(dwRet == 0) {
2875ErrorLevel := ERROR_READ_MEMORY
2876return 0
2877}
2878ErrorLevel := ERROR_OK
2879return NumGet(dwRead, 0, "UInt")
2880}
2881readMem(hProcess, dwAddress, dwLen=4, type="UInt") {
2882if(!hProcess) {
2883ErrorLevel := ERROR_INVALID_HANDLE
2884return 0
2885}
2886VarSetCapacity(dwRead, dwLen)
2887dwRet := DllCall( "ReadProcessMemory"
2888, "UInt", hProcess
2889, "UInt", dwAddress
2890, "Str", dwRead
2891, "UInt", dwLen
2892, "UInt*", 0)
2893if(dwRet == 0) {
2894ErrorLevel := ERROR_READ_MEMORY
2895return 0
2896}
2897ErrorLevel := ERROR_OK
2898return NumGet(dwRead, 0, type)
2899}
2900writeString(hProcess, dwAddress, wString) {
2901if(!hProcess) {
2902ErrorLevel := ERROR_INVALID_HANDLE
2903return false
2904}
2905sString := wString
2906if A_IsUnicode
2907sString := __unicodeToAnsi(wString)
2908dwRet := DllCall( "WriteProcessMemory"
2909, "UInt", hProcess
2910, "UInt", dwAddress
2911, "Str", sString
2912, "UInt", StrLen(wString) + 1
2913, "UInt", 0
2914, "UInt")
2915if(dwRet == 0) {
2916ErrorLEvel := ERROR_WRITE_MEMORY
2917return false
2918}
2919ErrorLevel := ERROR_OK
2920return true
2921}
2922writeRaw(hProcess, dwAddress, pBuffer, dwLen) {
2923if(!hProcess) {
2924ErrorLevel := ERROR_INVALID_HANDLE
2925return false
2926}
2927dwRet := DllCall( "WriteProcessMemory"
2928, "UInt", hProcess
2929, "UInt", dwAddress
2930, "UInt", pBuffer
2931, "UInt", dwLen
2932, "UInt", 0
2933, "UInt")
2934if(dwRet == 0) {
2935ErrorLEvel := ERROR_WRITE_MEMORY
2936return false
2937}
2938ErrorLevel := ERROR_OK
2939return true
2940}
2941Memory_ReadByte(process_handle, address) {
2942VarSetCapacity(value, 1, 0)
2943DllCall("ReadProcessMemory", "UInt", process_handle, "UInt", address, "Str", value, "UInt", 1, "UInt *", 0)
2944return, NumGet(value, 0, "Byte")
2945}
2946callWithParams(hProcess, dwFunc, aParams, bCleanupStack = true) {
2947if(!hProcess) {
2948ErrorLevel := ERROR_INVALID_HANDLE
2949return false
2950}
2951validParams := 0
2952i := aParams.MaxIndex()
2953dwLen := i * 5 + 5 + 1
2954if(bCleanupStack)
2955dwLen += 3
2956VarSetCapacity(injectData, i * 5 + 5 + 3 + 1, 0)
2957i_ := 1
2958while(i > 0) {
2959if(aParams[i][1] != "") {
2960dwMemAddress := 0x0
2961if(aParams[i][1] == "p") {
2962dwMemAddress := aParams[i][2]
2963} else if(aParams[i][1] == "s") {
2964if(i_>3)
2965return false
2966dwMemAddress := pParam%i_%
2967writeString(hProcess, dwMemAddress, aParams[i][2])
2968if(ErrorLevel)
2969return false
2970i_ += 1
2971} else if(aParams[i][1] == "i") {
2972dwMemAddress := aParams[i][2]
2973} else {
2974return false
2975}
2976NumPut(0x68, injectData, validParams * 5, "UChar")
2977NumPut(dwMemAddress, injectData, validParams * 5 + 1, "UInt")
2978validParams += 1
2979}
2980i -= 1
2981}
2982offset := dwFunc - ( pInjectFunc + validParams * 5 + 5 )
2983NumPut(0xE8, injectData, validParams * 5, "UChar")
2984NumPut(offset, injectData, validParams * 5 + 1, "Int")
2985if(bCleanupStack) {
2986NumPut(0xC483, injectData, validParams * 5 + 5, "UShort")
2987NumPut(validParams*4, injectData, validParams * 5 + 7, "UChar")
2988NumPut(0xC3, injectData, validParams * 5 + 8, "UChar")
2989} else {
2990NumPut(0xC3, injectData, validParams * 5 + 5, "UChar")
2991}
2992writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
2993if(ErrorLevel)
2994return false
2995hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
2996if(ErrorLevel)
2997return false
2998waitForSingleObject(hThread, 0xFFFFFFFF)
2999closeProcess(hThread)
3000return true
3001}
3002virtualAllocEx(hProcess, dwSize, flAllocationType, flProtect) {
3003if(!hProcess) {
3004ErrorLevel := ERROR_INVALID_HANDLE
3005return 0
3006}
3007dwRet := DllCall( "VirtualAllocEx"
3008, "UInt", hProcess
3009, "UInt", 0
3010, "UInt", dwSize
3011, "UInt", flAllocationType
3012, "UInt", flProtect
3013, "UInt")
3014if(dwRet == 0) {
3015ErrorLEvel := ERROR_ALLOC_MEMORY
3016return 0
3017}
3018ErrorLevel := ERROR_OK
3019return dwRet
3020}
3021virtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType) {
3022if(!hProcess) {
3023ErrorLevel := ERROR_INVALID_HANDLE
3024return 0
3025}
3026dwRet := DllCall( "VirtualFreeEx"
3027, "UInt", hProcess
3028, "UInt", lpAddress
3029, "UInt", dwSize
3030, "UInt", dwFreeType
3031, "UInt")
3032if(dwRet == 0) {
3033ErrorLEvel := ERROR_FREE_MEMORY
3034return 0
3035}
3036ErrorLevel := ERROR_OK
3037return dwRet
3038}
3039createRemoteThread(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags, lpThreadId) {
3040if(!hProcess) {
3041ErrorLevel := ERROR_INVALID_HANDLE
3042return 0
3043}
3044dwRet := DllCall( "CreateRemoteThread"
3045, "UInt", hProcess
3046, "UInt", lpThreadAttributes
3047, "UInt", dwStackSize
3048, "UInt", lpStartAddress
3049, "UInt", lpParameter
3050, "UInt", dwCreationFlags
3051, "UInt", lpThreadId
3052, "UInt")
3053if(dwRet == 0) {
3054ErrorLEvel := ERROR_ALLOC_MEMORY
3055return 0
3056}
3057ErrorLevel := ERROR_OK
3058return dwRet
3059}
3060waitForSingleObject(hThread, dwMilliseconds) {
3061if(!hThread) {
3062ErrorLevel := ERROR_INVALID_HANDLE
3063return 0
3064}
3065dwRet := DllCall( "WaitForSingleObject"
3066, "UInt", hThread
3067, "UInt", dwMilliseconds
3068, "UInt")
3069if(dwRet == 0xFFFFFFFF) {
3070ErrorLEvel := ERROR_WAIT_FOR_OBJECT
3071return 0
3072}
3073ErrorLevel := ERROR_OK
3074return dwRet
3075}
3076__ansiToUnicode(sString, nLen = 0) {
3077If !nLen
3078{
3079nLen := DllCall("MultiByteToWideChar"
3080, "Uint", 0
3081, "Uint", 0
3082, "Uint", &sString
3083, "int", -1
3084, "Uint", 0
3085, "int", 0)
3086}
3087VarSetCapacity(wString, nLen * 2)
3088DllCall("MultiByteToWideChar"
3089, "Uint", 0
3090, "Uint", 0
3091, "Uint", &sString
3092, "int", -1
3093, "Uint", &wString
3094, "int", nLen)
3095return wString
3096}
3097__unicodeToAnsi(wString, nLen = 0) {
3098pString := wString + 1 > 65536 ? wString : &wString
3099If !nLen
3100{
3101nLen := DllCall("WideCharToMultiByte"
3102, "Uint", 0
3103, "Uint", 0
3104, "Uint", pString
3105, "int", -1
3106, "Uint", 0
3107, "int", 0
3108, "Uint", 0
3109, "Uint", 0)
3110}
3111VarSetCapacity(sString, nLen)
3112DllCall("WideCharToMultiByte"
3113, "Uint", 0
3114, "Uint", 0
3115, "Uint", pString
3116, "int", -1
3117, "str", sString
3118, "int", nLen
3119, "Uint", 0
3120, "Uint", 0)
3121return sString
3122}
3123global SAMP_MAX_VEHICLES := 2000
3124global SAMP_PPOOL_VEHICLE_OFFSET := 0x1C
3125global VEHPOOL_iVehicleCount := 0x0
3126global VEHPOOL_iIsListed := 0x3074
3127global VEHPOOL_pGTA_Vehicle := 0x4FB4
3128global iRefreshVeh := 0
3129global oVehiclePoolData := []
3130global iUpdateTickVeh := 1000
3131getVehicleID() {
3132if (!checkHandles())
3133return -1
3134vID := readMem(hGTA, readDWORD(hGTA, dwSAMP + 0x13C848) + 0x14, 2, "Short")
3135if (ErrorLevel || !vID || vID > 2000)
3136return -1
3137return vID
3138}
3139GetVehicleModelIDByVPed(dwvPed) {
3140checkHandles()
3141id := readMem(hGTA, dwvPed + 0x22, 2, "Short")
3142return id
3143}
3144getStreamedVehicles() {
3145if (!checkHandles())
3146return false
3147if (iRefreshVeh + iUpdateTickVeh > A_TickCount)
3148return true
3149oVehiclePoolData := []
3150iRefreshVeh := A_TickCount
3151dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
3152dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
3153stVehiclePool := readDWORD(hGTA, dwAddress + 0x1C)
3154vehicleoffset := 0
3155Loop, % SAMP_MAX_VEHICLES
3156{
3157index := A_Index - 1, vehicleoffset += 4
3158iIsListed := readDWORD(hGTA, stVehiclePool + VEHPOOL_iIsListed + index * 0x4)
3159if (iIsListed == 0)
3160continue
3161ptrGTAVeh := readDWORD(hGTA, stVehiclePool + VEHPOOL_pGTA_Vehicle + index * 0x4)
3162if (ptrGTAVeh == 0)
3163continue
3164dwDriver := readDWORD(hGTA, ptrGTAVeh + 1120)
3165occupied := dwDriver != 0 ? 1 : 0
3166GTACARid := GetVehicleModelIDByVPed(ptrGTAVeh)
3167sVehId := Round((vehicleoffset / 4) - 1)
3168if (GTACARid > 400 && GTACARid < 611)
3169oVehiclePoolData[index] := Object("PTR", ptrGTAVeh, "SAMPID", sVehId, "CARNAME", ovehicleNames[GTACARid - 399], "OCCUPIED", occupied)
3170}
3171return true
3172}
3173getVehiclePointer(wID) {
3174if (wID < 1 || wID > SAMP_MAX_VEHICLES || !checkHandles())
3175return false
3176var1 := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
3177var2 := readDWORD(hGTA, var1 + SAMP_PPOOLS_OFFSET)
3178stVehiclePool := readDWORD(hGTA, var2 + SAMP_PPOOL_VEHICLE_OFFSET)
3179if (stVehiclePool) {
3180var3 := readDWORD(hGTA, stVehiclePool + 0x4FB4 + wID * 0x4)
3181return var3
3182} else {
3183return false
3184}
3185}
3186getVehiclePos(dwVehPtr = 0xBA18FC) {
3187if (!checkHandles())
3188return false
3189if (dwVehPtr = ADDR_VEHICLE_PTR)
3190dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
3191dwAddress := readDWORD(hGTA, dwVehPtr + 0x14)
3192if (!dwAddress)
3193return false
3194fX := readFloat(hGTA, dwAddress + 0x30)
3195fY := readFloat(hGTA, dwAddress + 0x34)
3196fZ := readFloat(hGTA, dwAddress + 0x38)
3197vehicleID := readDWORD(hGTA, dwVehPtr + 0x22)
3198return [fX, fY, fZ, vehicleID]
3199}
3200getVehicleRot(dwVehPtr = 0xBA18FC) {
3201if (!checkHandles())
3202return false
3203if (dwVehPtr = ADDR_VEHICLE_PTR)
3204dwVehPtr := readDWORD(hGTA, ADDR_VEHICLE_PTR)
3205dwAddress := readDWORD(hGTA, dwVehPtr + 0x14)
3206if (!dwAddress)
3207return false
3208rotX := readFloat(hGTA, dwAddress + 0x0)
3209rotY := readFloat(hGTA, dwAddress + 0x4)
3210rotZ := readFloat(hGTA, dwAddress + 0x8)
3211vehicleID := readDWORD(hGTA, dwVehPtr + 0x22)
3212return [rotX, rotY, rotZ, vehicleID]
3213}
3214getSeatIDs() {
3215if (!checkHandles())
3216return -1
3217dw := readDWORD(hGTA, 0xBA18FC)
3218if (dw) {
3219driver := readDWORD(hGTA, dw + 0x460)
3220psg1 := readDWORD(hGTA, dw + 0x464)
3221psg2 := readDWORD(hGTA, dw + 0x468)
3222psg3 := readDWORD(hGTA, dw + 0x46C)
3223psg4 := readDWORD(hGTA, dw + 0x470)
3224psg5 := readDWORD(hGTA, dw + 0x474)
3225psg6 := readDWORD(hGTA, dw + 0x478)
3226psg7 := readDWORD(hGTA, dw + 0x47C)
3227psg8 := readDWORD(hGTA, dw + 0x480)
3228psg9 := readDWORD(hGTA, dw + 0x484)
3229return [getIdByPed(driver), getIdByPed(psg1), getIdByPed(psg2), getIdByPed(psg3), getIdByPed(psg4), getIdByPed(psg5), getIdByPed(psg6), getIdByPed(psg7), getIdByPed(psg8), getIdByPed(psg9)]
3230} else {
3231addChatMessage2(PREFIX . "Du befindest dich nicht in einem Fahrzeug!")
3232}
3233}
3234GetVehicleColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "API_GetVehicleColor")
3235GetVehicleColor(ByRef int_ColorFirst, ByRef int_ColorSecond) {
3236global GetVehicleColor_func
3237res := DllCall(GetVehicleColor_func, IntP, int_ColorFirst, IntP, int_ColorSecond)
3238return res
3239}
3240createTextLabel(sText, dwColor, fX, fY, fZ, fDrawDistance := 50.0, bTestLOS := 0, wPlayerID := 0xFFFF, wVehicleID := 0xFFFF) {
3241if (!checkHandles())
3242return -1
3243dwAddress := readDWORD(hGTA, readDWORD(hGTA, readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET) + SAMP_PPOOLS_OFFSET) + 0xC)
3244Loop, 2048 {
3245wID := A_Index - 1
3246if (!readDWORD(hGTA, dwAddress + 0xE800 + wID * 4)) {
3247return callWithParams2(hGTA, dwSAMP + 0x11C0, [["i", dwAddress], ["i", wID], ["s", sText], ["i", dwColor], ["f", fX], ["f", fY], ["f", fZ]
3248, ["f", fDrawDistance], ["i", bTestLOS], ["i", wPlayerID], ["i", wVehicleID]], false, true) ? wID : -1
3249}
3250}
3251return -1
3252}
3253updateTextLabel(wID, sText, dwColor) {
3254if (wID < 0 || wID > 2047 || !checkHandles())
3255return false
3256dwAddress := readDWORD(hGTA, readDWORD(hGTA, readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET) + SAMP_PPOOLS_OFFSET) + 0xC)
3257fX := readFloat(hGTA, dwAddress + wID * 0x1D + 0x8)
3258fY := readFloat(hGTA, dwAddress + wID * 0x1D + 0xC)
3259fZ := readFloat(hGTA, dwAddress + wID * 0x1D + 0x10)
3260fDrawDistance := readFloat(hGTA, dwAddress + wID * 0x1D + 0x14)
3261bTestLOS := readMem(hGTA, dwAddress + wID * 0x1D + 0x18, 1, "Byte")
3262wPlayerID := readMem(hGTA, dwAddress + wID * 0x1D + 0x19, 2, "UShort")
3263wVehicleID := readMem(hGTA, dwAddress + wID * 0x1D + 0x1B, 2, "UShort")
3264return callWithParams2(hGTA, dwSAMP + 0x11C0, [["i", dwAddress], ["i", wID], ["s", sText], ["i", dwColor], ["f", fX], ["f", fY], ["f", fZ], ["f", fDrawDistance]
3265, ["i", bTestLOS], ["i", wPlayerID], ["i", wVehicleID]], false, true)
3266}
3267deleteTextLabel(ByRef wID) {
3268if (!checkHandles())
3269return false
3270dwAddress := readDWORD(hGTA, readDWORD(hGTA, readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET) + SAMP_PPOOLS_OFFSET) + 0xC)
3271if (callWithParams2(hGTA, dwSAMP + 0x12D0, [["i", dwAddress], ["i", wID]], false, true)) {
3272wID := -1
3273return true
3274}
3275return false
3276}
3277global SAMP_3DTEXT := 0x12C7BC
3278getLabelText() {
3279if (!checkHandles())
3280return -1
3281ADDR_3DText := readDWORD(hGTA, dwSAMP + SAMP_3DTEXT)
3282TEXT_3DTEXT := readString(hGTA, ADDR_3DText, 512)
3283return TEXT_3DTEXT
3284}
3285global iRefreshTL := 0
3286global oTextLabelData := ""
3287global iUpdateTickTL := 1000
3288updateTextLabelData() {
3289if (!checkHandles())
3290return 0
3291if (iRefreshTL+iUpdateTickTL > A_TickCount)
3292return 1
3293oTextLabelData := []
3294iRefreshTL := A_TickCount
3295dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
3296if (ErrorLevel || dwAddress==0) {
3297ErrorLevel := ERROR_READ_MEMORY
3298return 0
3299}
3300dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
3301if (ErrorLevel || dwAddress==0) {
3302ErrorLevel := ERROR_READ_MEMORY
3303return 0
3304}
3305dwTextLabels := readDWORD(hGTA, dwAddress + 12)
3306if (ErrorLevel || dwTextDraws==0) {
3307ErrorLevel := ERROR_READ_MEMORY
3308return 0
3309}
3310Loop, % 2048
3311{
3312i := A_Index-1
3313dwIsActive := readDWORD(hGTA, dwTextLabels + 59392 + i*4)
3314if (ErrorLevel) {
3315ErrorLevel := ERROR_READ_MEMORY
3316return 0
3317}
3318if (dwIsActive==0)
3319continue
3320dwAddr := readDWORD(hGTA, dwTextLabels + i*29)
3321if (ErrorLevel) {
3322ErrorLevel := ERROR_READ_MEMORY
3323return 0
3324}
3325if (dwAddr==0)
3326continue
3327sText := readString(hGTA, dwAddr, 256)
3328if (ErrorLevel) {
3329ErrorLevel := ERROR_READ_MEMORY
3330return 0
3331}
3332fX := readFloat(hGTA, dwTextLabels + i*29 +8)
3333if (ErrorLevel) {
3334ErrorLevel := ERROR_READ_MEMORY
3335return 0
3336}
3337fY := readFloat(hGTA, dwTextLabels + i*29 +12)
3338if (ErrorLevel) {
3339ErrorLevel := ERROR_READ_MEMORY
3340return 0
3341}
3342fZ := readFloat(hGTA, dwTextLabels + i*29 +16)
3343if (ErrorLevel) {
3344ErrorLevel := ERROR_READ_MEMORY
3345return 0
3346}
3347wPlayerID := readMem(hGTA, dwTextLabels + i * 0x1D + 0x19, 2, "UShort")
3348wVehicleID := readMem(hGTA, dwTextLabels + i * 0x1D + 0x1B, 2, "UShort")
3349oTextLabelData[i] := Object("TEXT", sText, "XPOS", fX , "YPOS", fY , "ZPOS", fZ, "PLAYERID", wPlayerID, "VEHICLEID", wVehicleID)
3350}
3351ErrorLevel := ERROR_OK
3352return 1
3353}
3354countLabels() {
3355if (!updateTextLabelData())
3356return -1
3357j := 0
3358For i, o in oTextLabelData
3359{
3360j += 1
3361}
3362return j
3363}
3364printLabels() {
3365if (!updateTextLabelData())
3366return
3367For i, o in oTextLabelData
3368{
3369addChatMessage2("ID: " . i . ", x:" . o.XPOS . ", y:" . o.YPOS . ", z:" . o.ZPOS . ", player: " . o.PLAYERID . ", vehicle: " . o.VEHICLEID)
3370addChatMessage2("{FFFFFF}" . o.TEXT)
3371}
3372}
3373createTextDraw(sString, fX, fY, dwLetterColor := 0xFFFFFFFF, bFont := 3, fLetterWidth := 0.4, fLetterHeight := 1, bShadowSize := 0, bOutline := 1
3374, dwShadowColor := 0xFF000000, bBox := 0, dwBoxColor := 0xFFFFFFFF, fBoxSizeX := 0.0, fBoxSizeY := 0.0, bLeft := 0, bRight := 0, bCenter := 1
3375, bProportional := 1, wModel := 0, fXRot := 0.0, fYRot := 0.0, fZRot := 0.0, fZoom := 1.0, wColor1 := 0xFFFF, wColor2 := 0xFFFF) {
3376if (StrLen(sString) > 800 || bFont > 5 || !checkHandles())
3377return -1
3378dwAddress := readDWORD(hGTA, readDWORD(hGTA, readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET) + SAMP_PPOOLS_OFFSET) + 0x10)
3379Loop, 2048 {
3380wID := A_Index - 1
3381if (!readDWORD(hGTA, dwAddress + wID * 4)) {
3382VarSetCapacity(struct, 63, 0)
3383NumPut((bBox ? 1 : 0) + (bLeft ? 2 : 0) + (bRight ? 4 : 0) + (bCenter ? 8 : 0) + (bProportional ? 16 : 0), &struct, 0, "Byte")
3384NumPut(fLetterWidth, &struct, 1, "Float")
3385NumPut(fLetterHeight, &struct, 5, "Float")
3386NumPut(dwLetterColor, &struct, 9, "Int")
3387NumPut(fBoxSizeX, &struct, 0xD, "Float")
3388NumPut(fBoxSizeY, &struct, 0x11, "Float")
3389NumPut(dwBoxColor, &struct, 0x15, "Int")
3390NumPut(bShadowSize, &struct, 0x19, "Byte")
3391NumPut(bOutline, &struct, 0x1A, "Byte")
3392NumPut(dwShadowColor, &struct, 0x1B, "Int")
3393NumPut(bFont, &struct, 0x1F, "Byte")
3394NumPut(1, &struct, 0x20, "Byte")
3395NumPut(fX, &struct, 0x21, "Float")
3396NumPut(fY, &struct, 0x25, "Float")
3397NumPut(wModel, &struct, 0x29, "Short")
3398NumPut(fXRot, &struct, 0x2B, "Float")
3399NumPut(fYRot, &struct, 0x2F, "Float")
3400NumPut(fZRot, &struct, 0x33, "Float")
3401NumPut(fZoom, &struct, 0x37, "Float")
3402NumPut(wColor1, &struct, 0x3B, "Short")
3403NumPut(wColor2, &struct, 0x3D, "Short")
3404writeRaw(hGTA, pParam5, &struct, 63)
3405if (ErrorLevel)
3406return -1
3407return callWithParams2(hGTA, dwSAMP + 0x1AE20, [["i", dwAddress], ["i", wID], ["i", pParam5], ["s", sString]], false, true) ? wID : -1
3408}
3409}
3410return -1
3411}
3412moveTextDraw(wID, xPos, yPos) {
3413if (wID < 0 || wID > 2047 || !checkHandles())
3414return false
3415dwAddress := readDWORD(hGTA, readDWORD(hGTA, readDWORD(hGTA, readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET) + SAMP_PPOOLS_OFFSET) + 0x10) + wID * 4 + (4 * (SAMP_MAX_PLAYERTEXTDRAWS + SAMP_MAX_TEXTDRAWS)))
3416return writeMemory(hGTA, dwAddress + 0x98B, xPos, 4, "Float") && writeMemory(hGTA, dwAddress + 0x98F, yPos, 4, "Float")
3417}
3418updateTextDraw(wID, sString) {
3419if (wID < 0 || wID > 2047 || StrLen(sString) > 800 || !checkHandles())
3420return false
3421dwAddress := readDWORD(hGTA, readDWORD(hGTA, readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET) + SAMP_PPOOLS_OFFSET) + 0x10)
3422return writeString(hGTA, readDWORD(hGTA, dwAddress + wID * 4 + (4 * (SAMP_MAX_PLAYERTEXTDRAWS + SAMP_MAX_TEXTDRAWS))), sString)
3423}
3424deleteTextDraw(ByRef wID) {
3425if (wID < 0 || wID > 2047 || !checkHandles())
3426return false
3427dwAddress := readDWORD(hGTA, readDWORD(hGTA, readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET) + SAMP_PPOOLS_OFFSET) + 0x10)
3428if (callWithParams2(hGTA, dwSAMP + 0x1AD00, [["i", dwAddress], ["i", wID]], false, true)) {
3429wID := -1
3430return true
3431}
3432return false
3433}
3434global TEXT_DRAW_POOL_OFFSET := 0x10
3435global SAMP_MAX_PLAYERTEXTDRAWS := 256
3436global SAMP_MAX_TEXTDRAWS := 2048
3437global iRefreshTD := 0
3438global iUpdateTickTD := 1000
3439global oTextDraws := []
3440updateTextDraws() {
3441if (!checkHandles())
3442return 0
3443if (iRefreshTD + iUpdateTickTD > A_TickCount)
3444return 1
3445oTextDraws := []
3446iRefreshTD := A_TickCount
3447dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
3448if (ErrorLevel || !dwAddress) {
3449ErrorLevel := ERROR_READ_MEMORY
3450return 0
3451}
3452dwAddress := readDWORD(hGTA, dwAddress + SAMP_PPOOLS_OFFSET)
3453if (ErrorLevel || !dwAddress) {
3454ErrorLevel := ERROR_READ_MEMORY
3455return 0
3456}
3457dwTextDraw := readDWORD(hGTA, dwAddress + TEXT_DRAW_POOL_OFFSET)
3458if (ErrorLevel || !dwTextDraw) {
3459ErrorLevel := ERROR_READ_MEMORY
3460return 0
3461}
3462Loop, % SAMP_MAX_TEXTDRAWS
3463{
3464i := A_Index - 1
3465dwIsActive := readDWORD(hGTA, dwTextDraw + i * 4)
3466if (ErrorLevel) {
3467ErrorLevel := ERROR_READ_MEMORY
3468return 0
3469}
3470if (!dwIsActive)
3471continue
3472dwAddr := readDWORD(hGTA, dwTextDraw + i * 4 + (4 * (SAMP_MAX_PLAYERTEXTDRAWS + SAMP_MAX_TEXTDRAWS)))
3473if (ErrorLevel) {
3474ErrorLevel := ERROR_READ_MEMORY
3475return 0
3476}
3477if (!dwAddr)
3478continue
3479sText := readString(hGTA, dwAddr, 800)
3480if (ErrorLevel) {
3481ErrorLevel := ERROR_READ_MEMORY
3482return 0
3483}
3484oTextDraws[i] := sText
3485}
3486ErrorLevel := ERROR_OK
3487return 1
3488}
3489printTextDraws() {
3490if (!updateTextDraws())
3491return
3492oReplace := ["~s~", "~r~", "~w~", "~h~", "~g~", "~y~", "~n~", "~b~", " ", " "]
3493For i, o in oTextDraws
3494{
3495Loop % oReplace.MaxIndex() {
3496o := StrReplace(o, oReplace[A_Index], " ")
3497}
3498addChatMessage2(o)
3499}
3500return
3501}
3502getTextDrawBySubstring(substring) {
3503if (!updateTextDraws())
3504return
3505oReplace := ["~s~", "~r~", "~w~", "~h~", "~g~", "~y~", "~n~", "~b~", " ", " "]
3506For i, o in oTextDraws
3507{
3508if (!InStr(o, substring))
3509continue
3510Loop % oReplace.MaxIndex()
3511o := StrReplace(o, oReplace[A_Index], " ")
3512return o
3513}
3514}
3515restartGameEx() {
3516if (!checkHandles())
3517return -1
3518dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
3519if (ErrorLevel || dwAddress==0) {
3520ErrorLevel := ERROR_READ_MEMORY
3521return -1
3522}
3523dwFunc := dwSAMP + 0xA060
3524VarSetCapacity(injectData, 11, 0)
3525NumPut(0xB9, injectData, 0, "UChar")
3526NumPut(dwAddress, injectData, 1, "UInt")
3527NumPut(0xE8, injectData, 5, "UChar")
3528offset := dwFunc - (pInjectFunc + 10)
3529NumPut(offset, injectData, 6, "Int")
3530NumPut(0xC3, injectData, 10, "UChar")
3531writeRaw(hGTA, pInjectFunc, &injectData, 11)
3532if (ErrorLevel)
3533return false
3534hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
3535if (ErrorLevel)
3536return false
3537waitForSingleObject(hThread, 0xFFFFFFFF)
3538return true
3539}
3540disconnectEx() {
3541if (!checkHandles())
3542return 0
3543dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
3544if (ErrorLevel || dwAddress==0) {
3545ErrorLevel := ERROR_READ_MEMORY
3546return 0
3547}
3548dwAddress := readDWORD(hGTA, dwAddress + 0x3c9)
3549if (ErrorLevel || dwAddress==0) {
3550ErrorLevel := ERROR_READ_MEMORY
3551return 0
3552}
3553ecx := dwAddress
3554dwAddress := readDWORD(hGTA, dwAddress)
3555if (ErrorLevel || dwAddress==0) {
3556ErrorLevel := ERROR_READ_MEMORY
3557return 0
3558}
3559VarSetCapacity(injectData, 24, 0)
3560NumPut(0xB9, injectData, 0, "UChar")
3561NumPut(ecx, injectData, 1, "UInt")
3562NumPut(0xB8, injectData, 5, "UChar")
3563NumPut(dwAddress, injectData, 6, "UInt")
3564NumPut(0x68, injectData, 10, "UChar")
3565NumPut(0, injectData, 11, "UInt")
3566NumPut(0x68, injectData, 15, "UChar")
3567NumPut(500, injectData, 16, "UInt")
3568NumPut(0x50FF, injectData, 20, "UShort")
3569NumPut(0x08, injectData, 22, "UChar")
3570NumPut(0xC3, injectData, 23, "UChar")
3571writeRaw(hGTA, pInjectFunc, &injectData, 24)
3572if (ErrorLevel)
3573return false
3574hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
3575if (ErrorLevel)
3576return false
3577waitForSingleObject(hThread, 0xFFFFFFFF)
3578return true
3579}
3580setRestart() {
3581VarSetCapacity(old, 4, 0)
3582dwAddress := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET)
3583if (ErrorLevel || dwAddress==0) {
3584ErrorLevel := ERROR_READ_MEMORY
3585return 0
3586}
3587NumPut(9,old,0,"Int")
3588writeRaw(hGTA, dwAddress + 957, &old, 4)
3589}
3590restart() {
3591restartGameEx()
3592disconnectEx()
3593Sleep, 1000
3594setRestart()
3595}
3596addChatMessage2(text, color := 0xFFFFFFFF, timestamp := true) {
3597return !checkHandles() ? false : callWithParams2(hGTA, dwSAMP + 0x64010, [["i", readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)], ["i", timestamp ? 4 : 2]
3598, ["s", text], ["i", 0], ["i", color], ["i", 0]], false, true)
3599}
3600global SAMP_CHAT_OFF := 0x0152
3601global SAMP_CHAT_SIZE := 144
3602readChatLine(line, color = 0) {
3603if (!checkHandles())
3604return 0
3605dwPTR := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
3606chat := readString(hGTA, dwPTR + SAMP_CHAT_OFF + SIZE_SAMP_CHATMSG * (99 - line), SAMP_CHAT_SIZE)
3607if (!color)
3608chat := RegExReplace(chat, "\{[a-fA-F0-9]{6}\}")
3609return chat
3610}
3611setChatLine(line, text) {
3612if (!checkHandles())
3613return 0
3614dwPTR := readDWORD(hGTA, dwSAMP + ADDR_SAMP_CHATMSG_PTR)
3615result := writeString(hGTA, dwPTR + SAMP_CHAT_OFF + SIZE_SAMP_CHATMSG * (99 - line), text)
3616return result
3617}
3618getKills() {
3619if (!checkHandles()) {
3620return false
3621}
3622pedLocal := readDWORD(hGTA, 0xB6F5F0)
3623if (!pedLocal) {
3624return false
3625}
3626peds := getPeds()
3627if (!peds) {
3628return false
3629}
3630data := []
3631For index, object in peds {
3632state := readMem(hGTA, object.PED + 0x530, 4, "UInt")
3633if ((pedStates[object.PED] == 55 || pedStates[object.PED] == 54) == (state == 55 || state == 54)) {
3634Continue
3635}
3636pedStates[object.PED] := state
3637if (object.PED && !object.ISNPC && (state == 55 || state == 54)) {
3638pedMurderer := readDWORD(hGTA, object.PED + 0x764)
3639murderer := false
3640For index2, object2 in peds
3641{
3642if (object2.PED == pedMurderer) {
3643murderer := object2
3644Break
3645}
3646}
3647weapon := readMem(hGTA, object.PED + 0x760, 4, "UInt")
3648skin := readMem(hGTA, object.PED + 0x22, 2, "UShort")
3649if (!murderer)
3650data.Push({victim: object, weapon: weapon, skin: skin})
3651else
3652data.Push({victim: object, murderer: murderer, weapon: weapon, skin: skin})
3653}
3654}
3655return data
3656}
3657getPeds() {
3658if (!checkHandles()) {
3659return false
3660}
3661if (!updateScoreboardDataEx()) {
3662return false
3663}
3664dwAddress := readDWORD(hGTA, dwSAMP + 0x21A0F8)
3665dwAddress := readDWORD(hGTA, dwAddress + 0x3CD)
3666dwAddress := readDWORD(hGTA, dwAddress + 0x18)
3667data := []
3668wID := readMem(hGTA, dwAddress + 0x4, 2, "UShort")
3669dwPed := readDWORD(hGTA, 0xB6F5F0)
3670if (readDWORD(hGTA, dwAddress + 0x1A) <= 16) {
3671sName := readString(hGTA, dwAddress + 0xA, 16)
3672} else {
3673sName := readString(hGTA, readDWORD(hGTA, dwAddress + 0xA), 20)
3674}
3675data.Push({LOCAL: true, ID: wID, PED: dwPed, ISNPC: false, NAME: sName})
3676Loop % 1000
3677{
3678i := A_Index - 1
3679dwRemotePlayer := readDWORD(hGTA, dwAddress + 0x2E + i*4)
3680if (!dwRemotePlayer) {
3681Continue
3682}
3683dwRemotePlayerData := readDWORD(hGTA, dwRemotePlayer)
3684dwRemotePlayerData := readDWORD(hGTA, dwRemotePlayerData)
3685dwPed := readDWORD(hGTA, dwRemotePlayerData + 0x2A4)
3686if (!dwPed) {
3687Continue
3688}
3689dwIsNPC := readDWORD(hGTA, dwRemotePlayer + 0x4)
3690if (readMem(hGTA, dwRemotePlayer + 0x1C, 4, "Int") <= 16) {
3691sName := readString(hGTA, dwRemotePlayer + 0xC, 16)
3692} else {
3693sName := readString(hGTA, readDWORD(hGTA, dwRemotePlayer + 0xC), 20)
3694}
3695data.Push({LOCAL: false, ID: i, PED: dwPed, ISNPC: dwIsNPC, NAME: sName})
3696}
3697return data
3698}
3699global GAMETEXT_1 := 0xBAAD40
3700global GAMETEXT_2 := 0xBAADC0
3701global GAMETEXT_3 := 0xBAAE40
3702global GAMETEXT_4 := 0xBAAEC0
3703global GAMETEXT_5 := 0xBAABC0
3704getGameText(type = 1, length = 12) {
3705if (!checkHandles())
3706return ""
3707if (type == 1) {
3708text := readString(hGTA, GAMETEXT_1, length)
3709} else if (type == 2) {
3710text := readString(hGTA, GAMETEXT_2, length)
3711} else if (type == 3) {
3712text := readString(hGTA, GAMETEXT_3, length)
3713} else if (type == 4) {
3714text := readString(hGTA, GAMETEXT_4, length)
3715} else if (type == 5) {
3716text := readString(hGTA, GAMETEXT_5, length)
3717}
3718return text
3719}
3720instruction := 0
3721fpsUnlock() {
3722if (!checkHandles())
3723return 0
3724global instruction
3725instruction := readMem(hGTA, dwSAMP + 0x9D9D0, 4, "UInt")
3726return writeMemory(hGTA, dwSAMP + 0x9D9D0, 0x5051FF15, 4, "UChar")
3727}
3728fpsLock() {
3729if (!checkHandles())
3730return 0
3731global instruction
3732if (instruction) {
3733return writeMemory(hGTA, dwSAMP + 0x9D9D0, instruction, 4, "UInt")
3734} else {
3735return false
3736}
3737}
3738blockDialog() {
3739if (!checkHandles()) {
3740ErrorLevel := ERROR_INVALID_HANDLE
3741return false
3742}
3743VarSetCapacity(injectBytecode, 7, 0)
3744Loop, 7 {
3745NumPut(0x90, injectBytecode, A_Index - 1, "UChar")
3746}
3747return writeRaw(hGTA, dwSAMP + 0x6C014, &injectBytecode, 7)
3748}
3749unblockDialog() {
3750if (!checkHandles()) {
3751ErrorLevel := ERROR_INVALID_HANDLE
3752return false
3753}
3754bytecodes := [0xC7, 0x46, 0x28, 0x1, 0x0, 0x0, 0x0]
3755VarSetCapacity(injectBytecode, 7, 0)
3756for i, o in bytecodes
3757NumPut(o, injectBytecode, i - 1, "UChar")
3758return writeRaw(hGTA, dwSAMP + 0x6C014, &injectBytecode, 7)
3759}
3760DownloadBin(url, byref buf) {
3761if (!DllCall("LoadLibrary", "str", "wininet") || !(h := DllCall("wininet\InternetOpen", "str", a, "uint", 1, "ptr", 0, "ptr", 0, "uint", 0, "ptr")))
3762return 0
3763c := s := 0
3764if (f := DllCall("wininet\InternetOpenUrl", "ptr", h, "str", url, "ptr", 0, "uint", 0, "uint", 0x80003000, "ptr", 0, "ptr")) {
3765while (DllCall("wininet\InternetQueryDataAvailable", "ptr", f, "uint*", s, "uint", 0, "ptr", 0) && s>0) {
3766VarSetCapacity(b, c+s, 0)
3767if (c>0)
3768DllCall("RtlMoveMemory", "ptr", &b, "ptr", &buf, "ptr", c)
3769DllCall("wininet\InternetReadFile", "ptr", f, "ptr", &b+c, "uint", s, "uint*", r)
3770c += r
3771VarSetCapacity(buf, c, 0)
3772if (c>0)
3773DllCall("RtlMoveMemory", "ptr", &buf, "ptr", &b, "ptr", c)
3774}
3775DllCall("wininet\InternetCloseHandle", "ptr", f)
3776}
3777DllCall("wininet\InternetCloseHandle", "ptr", h)
3778return c
3779}
3780DownloadToString(url, head, encoding = "utf-8") {
3781static a := "AutoHotkey/" A_AhkVersion
3782if (!DllCall("LoadLibrary", "str", "wininet") || !(h := DllCall("wininet\InternetOpen", "str", a, "uint", 1, "ptr", 0, "ptr", 0, "uint", 0, "ptr")))
3783return 0
3784c := s := 0, o := ""
3785if (f := DllCall("wininet\InternetOpenUrl", "ptr", h, "str", url, "str", head, "int", -1, "uint", 0x80083000, "ptr", 0, "ptr")) {
3786while (DllCall("wininet\InternetQueryDataAvailable", "ptr", f, "uint*", s, "uint", 0, "ptr", 0) && s > 0) {
3787VarSetCapacity(b, s, 0)
3788DllCall("wininet\InternetReadFile", "ptr", f, "ptr", &b, "uint", s, "uint*", r)
3789o .= StrGet(&b, r >> (encoding = "utf-16" || encoding = "cp1200"), encoding)
3790}
3791DllCall("wininet\InternetCloseHandle", "ptr", f)
3792}
3793DllCall("wininet\InternetCloseHandle", "ptr", h)
3794return o
3795}
3796URLDownloadToVar(url, showerror := false) {
3797hObject := ComObjCreate("WinHttp.WinHttpRequest.5.1")
3798try {
3799hObject.Open("GET", url)
3800hObject.SetTimeouts(0, 2000, 2000, 2000)
3801hObject.Send()
3802data := hObject.ResponseText
3803} catch e {
3804if (showerror == true) {
3805addChatMessage2(PREFIX . "Aktuell liegt ein Fehler in der Verbindung zum Server vor!")
3806}
3807return "ERROR_CONNECTION"
3808}
3809return data
3810}
3811Unzip(sZip, sUnz) {
3812fso := ComObjCreate("Scripting.FileSystemObject")
3813psh := ComObjCreate("Shell.Application")
3814zippedItems := psh.Namespace( sZip ).items().count
3815psh.Namespace( sUnz ).CopyHere( psh.Namespace( sZip ).items, 4|16 )
3816Loop {
3817Sleep, 50
3818unzippedItems := psh.Namespace( sUnz ).items().count
3819IfEqual, zippedItems, %unzippedItems%
3820break
3821}
3822}
3823PlayerInput(text) {
3824global alternativePlayerInput
3825if (alternativePlayerInput) {
3826Sleep, 100
3827Suspend, On
3828SendInput, t^a{backspace}/%text%
3829Input, var, V, {Enter}{Esc}{LButton}
3830SendInput, {End}+{Home}{Del}{Esc}
3831Suspend, Off
3832} else {
3833KeyWait, Enter
3834SendInput, t^a{backspace}/%text%
3835Input, var, V, {Enter}{Esc}{LButton}
3836SendInput, {End}+{Home}{Del}{Esc}
3837KeyWait, Enter
3838}
3839return var
3840}
3841getFullName(name, showerror := false) {
3842if name is number
3843{
3844name := getPlayerNameById(name)
3845if (name == "") {
3846if (showerror)
3847addChatMessage2(PREFIX . "Der Spieler mit der ID " . SECCOL . name . " {FFFFFF}ist nicht auf dem Server!")
3848return ""
3849} else {
3850return name
3851}
3852} else {
3853name := getPlayerIdByName(name)
3854if (name == -1) {
3855if (showerror)
3856addChatMessage2(PREFIX . "Der Spieler " . SECCOL . name . " {FFFFFF}ist nicht auf dem Server!")
3857return ""
3858} else {
3859return getPlayerNameById(name)
3860}
3861}
3862}
3863sendClientMessage(message) {
3864if (StrLen(message) > 144) {
3865subMessage := SubStr(message, 1, 141)
3866if (RegExMatch(subMessage, "(.+)({\S{6}})(\s*)$", message_)) {
3867addChatMessage2(message_1 . "...")
3868sendClientMessage(message_2 . "..." . message_3 . SubStr(message, 142))
3869} else if (RegExMatch(subMessage, "(.+)({\S{0,6})$", message_)) {
3870addChatMessage2(message_1 . "...")
3871subMessage2 := SubStr(message, 142)
3872if (RegExMatch(subMessage2, "^(\S{0,6}})(.+)", message2_)) {
3873sendClientMessage(message_2 . message2_1 . "..." . message2_2)
3874} else {
3875sendClientMessage("..." . subMessage2)
3876}
3877} else {
3878addChatMessage2(subMessage . "...")
3879color := ""
3880if (RegExMatch(subMessage, "(.*)({\S{6}})(.*)", message_)) {
3881color := message_2
3882}
3883sendClientMessage(color . "..." . SubStr(message, 142))
3884}
3885} else {
3886addChatMessage2(message)
3887}
3888}
3889getWeaponName(id) {
3890weapons := {0: "Fist", 1: "Brass Knuckles", 2: "Golf Club", 3: "Nightstick", 4: "Knife", 5: "Baseball Bat", 6: "Shovel", 7: "Pool Cue", 8: "Katana", 9: "Chainsaw", 10: "Purple Dildo", 11: "Dildo", 12: "Vibrator", 13: "Silver Vibrator", 14: "Flowers", 15: "Cane", 16: "Grenade", 17: "Tear Gas", 18: "Molotov Cocktail", 22: "9mm", 23: "Silenced 9mm", 24: "Desert Eagle", 25: "Shotgun", 26: "Sawnoff Shotgun", 27: "Combat Shotgun", 28: "Micro SMG/Uzi", 29: "MP5", 30: "AK-47", 31: "M4", 32: "Tec-9", 33: "Country Rifle", 34: "Sniper Rifle", 35: "RPG", 36: "HS Rocket", 37: "Flamethrower", 38: "Minigun", 39: "Satchel Charge", 40: "Detonator", 41: "Spraycan", 42: "Fire Extinguisher", 43: "Camera", 44: "Night Vis Goggles", 45: "Thermal Goggles", 46: "Parachute", 47: "Fake Pistol", 49: "Vehicle", 50: "Helicopter Blades", 51: "Explosion", 53: "Drowned", 54: "Splat", 255: "Suicide"}
3891if (weapons[id]) {
3892return weapons[id]
3893}
3894return "Unknown"
3895}
3896getLocation() {
3897zone := getPlayerZone()
3898city := getPlayerCity()
3899if (city == "" || city == "Unbekannt") {
3900return zone
3901} else {
3902return zone . ", " . city
3903}
3904}
3905formatNumber(_number) {
3906StringReplace, _number, _number, -
3907IfEqual, ErrorLevel, 0, SetEnv Sign, -
3908Loop, Parse, _number, .
3909if (A_Index = 1) {
3910len := StrLen(A_LoopField)
3911Loop, Parse, A_LoopField
3912if (Mod(len-A_Index,3) = 0 and A_Index != len) {
3913x .= A_LoopField "."
3914} else {
3915x .= A_LoopField
3916}
3917} else {
3918Return Sign x "." A_LoopField
3919}
3920Return Sign x
3921}
3922formatTime(time) {
3923hours := Floor(time / 60 / 60)
3924minutes := Floor(time / 60) - hours * 60
3925seconds := time - minutes * 60 - hours * 60 * 60
3926time := ""
3927if (hours > 0) {
3928time .= hours . "h"
3929if (minutes > 0) {
3930time .= ", "
3931} else if (seconds > 0) {
3932time .= ", "
3933}
3934}
3935if (minutes > 0) {
3936time .= minutes . "min"
3937if (seconds > 0) {
3938time .= ", "
3939}
3940}
3941if (seconds > 0 || (minutes == 0 && hours == 0)) {
3942time .= seconds . "s"
3943}
3944return time
3945}
3946getDayTime() {
3947FormatTime, time,, HH
3948if (time >= 11 && time < 18) {
3949return "Tag"
3950} else if (time >= 18) {
3951return "Abend"
3952} else if (time >= 0 && time < 11) {
3953return "Morgen"
3954}
3955return ""
3956}
3957getUnixTimestamp(time_orig) {
3958StringLeft, now_year, time_orig, 4
3959StringMid, now_month, time_orig, 5, 2
3960StringMid, now_day, time_orig, 7, 2
3961StringMid, now_hour, time_orig, 9, 2
3962StringMid, now_min, time_orig, 11, 2
3963StringRight, now_sec, time_orig, 2
3964year_sec := 31536000 * (now_year - 1970)
3965leap_days := (now_year - 1972) / 4 + 1
3966Transform, leap_days, Floor, %leap_days%
3967this_leap := now_year/4
3968Transform, this_leap_round, Floor, %this_leap%
3969if (this_leap = this_leap_round) {
3970if (now_month <= 2) {
3971leap_days--
3972}
3973}
3974leap_sec := leap_days * 86400
3975if (now_month == 01)
3976month_sec = 0
3977if (now_month == 02)
3978month_sec = 2678400
3979if (now_month == 03)
3980month_sec = 5097600
3981if (now_month == 04)
3982month_sec = 7776000
3983if (now_month == 05)
3984month_sec = 10368000
3985if (now_month == 06)
3986month_sec = 13046400
3987if (now_month == 07)
3988month_sec = 15638400
3989if (now_month == 08)
3990month_sec = 18316800
3991if (now_month == 09)
3992month_sec = 20995200
3993if (now_month == 10)
3994month_sec = 23587200
3995if (now_month == 11)
3996month_sec = 26265600
3997if (now_month == 12)
3998month_sec = 28857600
3999day_sec := (now_day - 1) * 86400
4000hour_sec := now_hour * 3600
4001min_sec := now_min * 60
4002date_sec := year_sec + month_sec + day_sec + leap_sec + hour_sec + min_sec + now_sec
4003return date_sec
4004}
4005getDistanceBetween(posX, posY, posZ, _posX, _posY, _posZ, _posRadius) {
4006X := posX -_posX
4007Y := posY -_posY
4008Z := posZ -_posZ
4009if (((X < _posRadius) && (X > -_posRadius)) && ((Y < _posRadius) && (Y > -_posRadius)) && ((Z < _posRadius) && (Z > -_posRadius)))
4010return TRUE
4011return FALSE
4012}
4013getDistanceToPoint(posX, posY, posZ, _posX, _posY, _posZ) {
4014return Sqrt((posX - _posX) ** 2 + (posY - _posY) ** 2 + (posZ - _posZ) ** 2)
4015}
4016IniRead(fileName, section, key, default := 0) {
4017IniRead, var, %fileName%, %section%, %key%, %default%
4018return var
4019}
4020getUserFriendlyHotkeyName(hk) {
4021StringUpper, hk, hk
4022hk := StrReplace(hk, "~", "")
4023hk := StrReplace(hk, "+", "UMSCHALT+")
4024hk := StrReplace(hk, "^", "STRG+")
4025hk := StrReplace(hk, "!", "ALT+")
4026return hk
4027}
4028global fractions := {"": [0, "Zivilist"], "lspd": [1, "LSPD"], "fbi": [2, "FBI"], "lvpd": [3, "LVPD"], "lsmd": [4, "LSMD"], "russen": [5, "Russen Mafia"], "yakuza": [6, "Yakuza"], "regierung": [7, "Regierung"], "agency": [8, "Agency"], "news": [9, "San News"], "grove": [10, "Grove Street"], "ballas": [11, "Ballas"], "lcm": [12, "LCM"], "oamt": [13, "Ordnungsamt"], "gmbh": [14, "Transport GmbH"], "rifa": [15, "S.F. Rifa"], "vagos": [16, "Vagos"], "triaden": [17, "Triaden"], "safd": [19, "SAFD"]}
4029getFraktionByID(id) {
4030fraction := ""
4031for index, entry in fractions {
4032if (entry[1] == id) {
4033fraction := entry[2]
4034break
4035}
4036}
4037return fraction
4038}
4039getFraktionColorByID(id) {
4040fractionColor := ""
4041if (id == 1) {
4042fractionColor := "{217BFF}"
4043} else if (id == 2) {
4044fractionColor := "{0E00DC}"
4045} else if (id == 4) {
4046fractionColor := "{AA3333}"
4047} else if (id == 5) {
4048fractionColor := "{85847F}"
4049} else if (id == 6) {
4050fractionColor := "{FFFFFF}"
4051} else if (id == 10) {
4052fractionColor := "{078C09}"
4053} else if (id == 11) {
4054fractionColor := "{9300FF}"
4055} else if (id == 12) {
4056fractionColor := "{0046FF}"
4057} else if (id == 15) {
4058fractionColor := "{00DCFF}"
4059} else if (id == 16) {
4060fractionColor := "{FFFF00}"
4061} else if (id == 17) {
4062fractionColor := "{FF8000}"
4063}
4064return fractionColor
4065}
4066getFraktionColorByName(name) {
4067fractionColor := ""
4068if (InStr(name, "LSPD")) {
4069fractionColor := "{217BFF}"
4070} else if (InStr(name, "FBI")) {
4071fractionColor := "{0E00DC}"
4072} else if (InStr(name, "LVPD")) {
4073fractionColor := "{AA3333}"
4074} else if (InStr(name, "Russen")) {
4075fractionColor := "{85847F}"
4076} else if (InStr(name, "Yakuza")) {
4077fractionColor := "{FFFFFF}"
4078} else if (InStr(name, "Grove")) {
4079fractionColor := "{078C09}"
4080} else if (InStr(name, "Ballas")) {
4081fractionColor := "{9300FF}"
4082} else if (InStr(name, "Chickos")) {
4083fractionColor := "{0046FF}"
4084} else if (InStr(name, "Rifa")) {
4085fractionColor := "{00DCFF}"
4086} else if (InStr(name, "Vagos")) {
4087fractionColor := "{FFFF00}"
4088} else if (InStr(name, "Triaden")) {
4089fractionColor := "{FF8000}"
4090}
4091return fractionColor
4092}
4093getFraktionNameShort(name) {
4094nameShort := ""
4095if (InStr(name, "Russen")) {
4096nameShort := "Russen"
4097} else if (InStr(name, "Yakuza")) {
4098nameShort := "Yaku"
4099} else if (InStr(name, "Grove")) {
4100nameShort := "GS"
4101} else if (InStr(name, "Ballas")) {
4102nameShort := "Ballas"
4103} else if (InStr(name, "Chickos")) {
4104nameShort := "LCM"
4105} else if (InStr(name, "Rifa")) {
4106nameShort := "Rifa"
4107} else if (InStr(name, "Vagos")) {
4108nameShort := "Vagos"
4109} else if (InStr(name, "Triaden")) {
4110nameShort := "Triaden"
4111}
4112return nameShort
4113}
4114getFraktionBySkinID(id) {
4115fraction := 0
4116skins := {1: [163, 164, 265, 266, 267, 280, 281, 283, 284, 288, 306], 2: [165, 166, 240, 286, 294, 11, 172, 194, 211, 309], 3: [282, 287, 307], 5: [43, 111, 112, 113, 124, 125, 126, 127, 258, 272, 40], 6: [121, 122, 123, 186, 203, 204, 228, 169, 224], 10: [105, 106, 107, 269, 271, 65, 270], 11: [102, 103, 104, 293, 13], 12: [46, 47, 48, 98, 185, 223, 249, 214], 15: [114, 115, 116, 173, 174, 175, 184, 273, 195, 298], 16: [108, 109, 110, 292, 91], 17: [49, 117, 118, 120, 208, 263]}
4117for fname, fskins in skins
4118{
4119for index, fskin in fskins
4120{
4121if (fskin == id) {
4122fraction := fname
4123break, 2
4124}
4125}
4126}
4127return fraction
4128}
4129callWithParams2(hProcess, dwFunc, aParams, bCleanupStack = true, bThisCall = false, bReturn = false, sDatatype = "Char") {
4130if (!hProcess || !dwFunc)
4131return false
4132dataOffset := 0
4133i := aParams.MaxIndex()
4134bytesUsed := 0
4135bytesMax := 5120
4136dwLen := i * 5 + bCleanupStack * 3 + bReturn * 5 + 6
4137VarSetCapacity(injectData, dwLen, 0)
4138while (i > 0) {
4139if (aParams[i][1] == "i" || aParams[i][1] == "p" || aParams[i][1] == "f")
4140value := aParams[i][2]
4141else if (aParams[i][1] == "s") {
4142if (bytesMax - bytesUsed < StrLen(aParams[i][2]))
4143return false
4144value := pMemory + bytesUsed
4145writeString(hProcess, value, aParams[i][2])
4146bytesUsed += StrLen(aParams[i][2]) + 1
4147if (ErrorLevel)
4148return false
4149}
4150else
4151return false
4152NumPut((bThisCall && i == 1 ? 0xB9 : 0x68), injectData, dataOffset, "UChar")
4153NumPut(value, injectData, ++dataOffset, aParams[i][1] == "f" ? "Float" : "Int")
4154dataOffset += 4
4155i--
4156}
4157offset := dwFunc - (pInjectFunc + dataOffset + 5)
4158NumPut(0xE8, injectData, dataOffset, "UChar")
4159NumPut(offset, injectData, ++dataOffset, "Int")
4160dataOffset += 4
4161if (bReturn) {
4162NumPut(sDatatype = "Char" ? 0xA2 : 0xA3, injectData, dataOffset, "UChar")
4163NumPut(pParam1, injectData, ++dataOffset, "UInt")
4164dataOffset += 4
4165}
4166if (bCleanupStack) {
4167NumPut(0xC483, injectData, dataOffset, "UShort")
4168dataOffset += 2
4169NumPut((aParams.MaxIndex() - bThisCall) * 4, injectData, dataOffset, "UChar")
4170dataOffset++
4171}
4172NumPut(0xC3, injectData, dataOffset, "UChar")
4173writeRaw(hGTA, pInjectFunc, &injectData, dwLen)
4174if (ErrorLevel)
4175return false
4176hThread := createRemoteThread(hGTA, 0, 0, pInjectFunc, 0, 0, 0)
4177if (ErrorLevel)
4178return false
4179waitForSingleObject(hThread, 0xFFFFFFFF)
4180closeProcess(hThread)
4181if (bReturn)
4182return readMem(hGTA, pParam1, 4, sDatatype)
4183return true
4184}
4185class JSON
4186{
4187class Load extends JSON.Functor
4188{
4189Call(self, ByRef text, reviver:="")
4190{
4191this.rev := IsObject(reviver) ? reviver : false
4192this.keys := this.rev ? {} : false
4193static quot := Chr(34), bashq := "\" . quot
4194, json_value := quot . "{[01234567890-tfn"
4195, json_value_or_array_closing := quot . "{[]01234567890-tfn"
4196, object_key_or_object_closing := quot . "}"
4197key := ""
4198is_key := false
4199root := {}
4200stack := [root]
4201next := json_value
4202pos := 0
4203while ((ch := SubStr(text, ++pos, 1)) != "") {
4204if InStr(" `t`r`n", ch)
4205continue
4206if !InStr(next, ch, 1)
4207this.ParseError(next, text, pos)
4208holder := stack[1]
4209is_array := holder.IsArray
4210if InStr(",:", ch) {
4211next := (is_key := !is_array && ch == ",") ? quot : json_value
4212} else if InStr("}]", ch) {
4213ObjRemoveAt(stack, 1)
4214next := stack[1]==root ? "" : stack[1].IsArray ? ",]" : ",}"
4215} else {
4216if InStr("{[", ch) {
4217static json_array := Func("Array").IsBuiltIn || ![].IsArray ? {IsArray: true} : 0
4218(ch == "{")
4219? ( is_key := true
4220, value := {}
4221, next := object_key_or_object_closing )
4222: ( value := json_array ? new json_array : []
4223, next := json_value_or_array_closing )
4224ObjInsertAt(stack, 1, value)
4225if (this.keys)
4226this.keys[value] := []
4227} else {
4228if (ch == quot) {
4229i := pos
4230while (i := InStr(text, quot,, i+1)) {
4231value := StrReplace(SubStr(text, pos+1, i-pos-1), "\\", "\u005c")
4232static tail := A_AhkVersion<"2" ? 0 : -1
4233if (SubStr(value, tail) != "\")
4234break
4235}
4236if (!i)
4237this.ParseError("'", text, pos)
4238value := StrReplace(value, "\/", "/")
4239, value := StrReplace(value, bashq, quot)
4240, value := StrReplace(value, "\b", "`b")
4241, value := StrReplace(value, "\f", "`f")
4242, value := StrReplace(value, "\n", "`n")
4243, value := StrReplace(value, "\r", "`r")
4244, value := StrReplace(value, "\t", "`t")
4245pos := i
4246i := 0
4247while (i := InStr(value, "\",, i+1)) {
4248if !(SubStr(value, i+1, 1) == "u")
4249this.ParseError("\", text, pos - StrLen(SubStr(value, i+1)))
4250uffff := Abs("0x" . SubStr(value, i+2, 4))
4251if (A_IsUnicode || uffff < 0x100)
4252value := SubStr(value, 1, i-1) . Chr(uffff) . SubStr(value, i+6)
4253}
4254if (is_key) {
4255key := value, next := ":"
4256continue
4257}
4258} else {
4259value := SubStr(text, pos, i := RegExMatch(text, "[\]\},\s]|$",, pos)-pos)
4260static number := "number", integer :="integer"
4261if value is %number%
4262{
4263if value is %integer%
4264value += 0
4265}
4266else if (value == "true" || value == "false")
4267value := %value% + 0
4268else if (value == "null")
4269value := ""
4270else
4271this.ParseError(next, text, pos, i)
4272pos += i-1
4273}
4274next := holder==root ? "" : is_array ? ",]" : ",}"
4275}
4276is_array? key := ObjPush(holder, value) : holder[key] := value
4277if (this.keys && this.keys.HasKey(holder))
4278this.keys[holder].Push(key)
4279}
4280}
4281return this.rev ? this.Walk(root, "") : root[""]
4282}
4283ParseError(expect, ByRef text, pos, len:=1)
4284{
4285static quot := Chr(34), qurly := quot . "}"
4286line := StrSplit(SubStr(text, 1, pos), "`n", "`r").Length()
4287col := pos - InStr(text, "`n",, -(StrLen(text)-pos+1))
4288msg := Format("{1}`n`nLine:`t{2}`nCol:`t{3}`nChar:`t{4}"
4289, (expect == "") ? "Extra data"
4290: (expect == "'") ? "Unterminated string starting at"
4291: (expect == "\") ? "Invalid \escape"
4292: (expect == ":") ? "Expecting ':' delimiter"
4293: (expect == quot) ? "Expecting object key enclosed in double quotes"
4294: (expect == qurly) ? "Expecting object key enclosed in double quotes or object closing '}'"
4295: (expect == ",}") ? "Expecting ',' delimiter or object closing '}'"
4296: (expect == ",]") ? "Expecting ',' delimiter or array closing ']'"
4297: InStr(expect, "]") ? "Expecting JSON value or array closing ']'"
4298: "Expecting JSON value(string, number, true, false, null, object or array)"
4299, line, col, pos)
4300static offset := A_AhkVersion<"2" ? -3 : -4
4301throw Exception(msg, offset, SubStr(text, pos, len))
4302}
4303Walk(holder, key)
4304{
4305value := holder[key]
4306if IsObject(value) {
4307for i, k in this.keys[value] {
4308v := this.Walk(value, k)
4309if (v != JSON.Undefined)
4310value[k] := v
4311else
4312ObjDelete(value, k)
4313}
4314}
4315return this.rev.Call(holder, key, value)
4316}
4317}
4318class Dump extends JSON.Functor
4319{
4320Call(self, value, replacer:="", space:="")
4321{
4322this.rep := IsObject(replacer) ? replacer : ""
4323this.gap := ""
4324if (space) {
4325static integer := "integer"
4326if space is %integer%
4327Loop, % ((n := Abs(space))>10 ? 10 : n)
4328this.gap .= " "
4329else
4330this.gap := SubStr(space, 1, 10)
4331this.indent := "`n"
4332}
4333return this.Str({"": value}, "")
4334}
4335Str(holder, key)
4336{
4337value := holder[key]
4338if (this.rep)
4339value := this.rep.Call(holder, key, ObjHasKey(holder, key) ? value : JSON.Undefined)
4340if IsObject(value) {
4341static type := A_AhkVersion<"2" ? "" : Func("Type")
4342if (type ? type.Call(value) == "Object" : ObjGetCapacity(value) != "") {
4343if (this.gap) {
4344stepback := this.indent
4345this.indent .= this.gap
4346}
4347is_array := value.IsArray
4348if (!is_array) {
4349for i in value
4350is_array := i == A_Index
4351until !is_array
4352}
4353str := ""
4354if (is_array) {
4355Loop, % value.Length() {
4356if (this.gap)
4357str .= this.indent
4358v := this.Str(value, A_Index)
4359str .= (v != "") ? v . "," : "null,"
4360}
4361} else {
4362colon := this.gap ? ": " : ":"
4363for k in value {
4364v := this.Str(value, k)
4365if (v != "") {
4366if (this.gap)
4367str .= this.indent
4368str .= this.Quote(k) . colon . v . ","
4369}
4370}
4371}
4372if (str != "") {
4373str := RTrim(str, ",")
4374if (this.gap)
4375str .= stepback
4376}
4377if (this.gap)
4378this.indent := stepback
4379return is_array ? "[" . str . "]" : "{" . str . "}"
4380}
4381} else
4382return ObjGetCapacity([value], 1)=="" ? value : this.Quote(value)
4383}
4384Quote(string)
4385{
4386static quot := Chr(34), bashq := "\" . quot
4387if (string != "") {
4388string := StrReplace(string, "\", "\\")
4389, string := StrReplace(string, quot, bashq)
4390, string := StrReplace(string, "`b", "\b")
4391, string := StrReplace(string, "`f", "\f")
4392, string := StrReplace(string, "`n", "\n")
4393, string := StrReplace(string, "`r", "\r")
4394, string := StrReplace(string, "`t", "\t")
4395static rx_escapable := A_AhkVersion<"2" ? "O)[^\x20-\x7e]" : "[^\x20-\x7e]"
4396while RegExMatch(string, rx_escapable, m)
4397string := StrReplace(string, m.Value, Format("\u{1:04x}", Ord(m.Value)))
4398}
4399return quot . string . quot
4400}
4401}
4402Undefined[]
4403{
4404get {
4405static empty := {}, vt_empty := ComObject(0, &empty, 1)
4406return vt_empty
4407}
4408}
4409class Functor
4410{
4411__Call(method, ByRef arg, args*)
4412{
4413if IsObject(method)
4414return (new this).Call(method, arg, args*)
4415else if (method == "")
4416return (new this).Call(arg, args*)
4417}
4418}
4419}
4420ownHotkey(id) {
4421global
4422if (IsInChat())
4423return
4424if (!ownHotkey%id%Active)
4425return
4426if (ownHotkey%id%Text == "")
4427return
4428chatActionsArray := StrSplit(ownHotkey%id%Text, "`n")
4429Loop % chatActionsArray.MaxIndex()
4430{
4431sendLine(chatActionsArray[A_Index])
4432}
4433}
4434sendLine(line, local := false) {
4435global fishTime
4436line := StrReplace(line, "[name]", getUsername())
4437line := StrReplace(line, "[id]", getId())
4438line := StrReplace(line, "[ping]", getPlayerPingById(getId()))
4439line := StrReplace(line, "[zone]", getPlayerZone())
4440line := StrReplace(line, "[city]", getPlayerCity())
4441line := StrReplace(line, "[hp]", getPlayerHealth())
4442line := StrReplace(line, "[armour]", getPlayerArmor())
4443line := StrReplace(line, "[money]", FormatNumber(getPlayerMoney()))
4444line := StrReplace(line, "[skin]", getPlayerSkinId())
4445line := StrReplace(line, "[weaponid]", getPlayerWeaponId())
4446line := StrReplace(line, "[weapon]", getPlayerWeaponName())
4447line := StrReplace(line, "[freezed]", (IsPlayerFreezed() ? "ja" : "nein"))
4448line := StrReplace(line, "[vhealth]", getVehicleHealth())
4449line := StrReplace(line, "[vmodelid]", getVehicleModelId())
4450line := StrReplace(line, "[vmodel]", getVehicleModelName())
4451line := StrReplace(line, "[vspeed]", round(getVehicleSpeed()))
4452line := StrReplace(line, "[fishtime]", formatTime(fishTime))
4453if (RegExMatch(line, "(.*)\[sleep (\d+)\](.*)", line_)) {
4454if (line_1 != "")
4455sendLine(line_1, local)
4456Sleep, %line_2%
4457if (line_3 != "")
4458sendLine(line_3, local)
4459} else if (RegExMatch(line, "(.*)\[local\](.*)", line_)) {
4460if (line_1 != "")
4461sendLine(line_1, local)
4462if (line_2 != "")
4463sendLine(line_2, true)
4464} else if (RegExMatch(line, "(.*)\[usepak\](.*)", line_)) {
4465if (line_1 != "")
4466sendLine(line_1, local)
4467GoSub, firstAidLabel
4468if (line_2 != "")
4469sendLine(line_2, local)
4470} else if (RegExMatch(line, "(.*)\[eatfish\](.*)", line_)) {
4471if (line_1 != "")
4472sendLine(line_1, local)
4473GoSub, eatFishLabel
4474if (line_2 != "")
4475sendLine(line_2, local)
4476} else if (RegExMatch(line, "(.*)\[motor\](.*)", line_)) {
4477if (line_1 != "")
4478sendLine(line_1, local)
4479GoSub, motorSystemLabel
4480if (line_2 != "")
4481sendLine(line_2, local)
4482} else {
4483if (local) {
4484SendClientMessage(PREFIX . line)
4485} else {
4486SendChat(line)
4487}
4488}
4489}
4490removeTask(id) {
4491global tasks
4492indexToRemove := -1
4493for index, entry in tasks {
4494if (entry["id"] == id) {
4495indexToRemove := index
4496}
4497}
4498if (indexToRemove != -1) {
4499tasks.RemoveAt(indexToRemove)
4500return removeTask(id) + 1
4501} else {
4502return 0
4503}
4504}
4505findLinie() {
4506busLine := 0
4507distance := 10000000
4508coords := getCoordinates()
4509global oTextLabelData
4510if (!updateTextLabelData())
4511return
4512for i, o in oTextLabelData {
4513if (o.VEHICLEID != 65535) {
4514if (RegExMatch(o.TEXT, "Linie (\d+)\n(.+)", label_)) {
4515pointer := getVehiclePointer(o.VEHICLEID)
4516if (pointer) {
4517vehiclePos := getVehiclePos(pointer)
4518if (vehiclePos) {
4519x := vehiclePos[1] + o.XPOS
4520y := vehiclePos[2] + o.YPOS
4521z := vehiclePos[3] + o.ZPOS
4522tempDistance := getDistanceToPoint(x, y, z, coords[1], coords[2], coords[3])
4523if (tempDistance < distance) {
4524distance := tempDistance
4525busLine := label_1
4526}
4527}
4528}
4529}
4530}
4531}
4532return busLine
4533}
4534selectLine(busLine) {
4535busLine--
4536BlockInput, On
4537SendChat("/linie")
4538Sleep, 200
4539SendInput, {down %busLine%}{enter}
4540BlockInput, Off
4541}
4542giveWanteds(suspect, reasonID) {
4543global username
4544global password
4545global admin
4546suspect := getFullName(suspect)
4547if (suspect == "") {
4548SendClientMessage(PREFIX . "Der Spieler ist nicht online!")
4549return false
4550}
4551result := URLDownloadToVar(baseURL . "api/catalog-new?username=" . username . "&password=" . password . "&type=wanteds&id=" . reasonID . "&suspect=" . suspect)
4552try {
4553data := JSON.Load(result)
4554} catch {
4555SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
4556FormatTime, time, , dd.MM.yyyy HH:mm:ss
4557FileAppend, [%time%] Beim Laden der Wanted-Vergabe ist ein Fehler aufgetreten: %result%`n, log.txt
4558return false
4559}
4560if (data["error"] != "") {
4561SendClientMessage(PREFIX . data["error"])
4562} else {
4563wanteds := data["amount"]
4564reason := data["reason"]
4565if (!data["registered"]) {
4566SendClientMessage(PREFIX . SECCOL . suspect . " {FFFFFF}hat bereits " . SECCOL . wanteds . " {FFFFFF}Wanteds wegen " . SECCOL . reason . " {FFFFFF}von " . SECCOL . data["lastoffical"] . " {FFFFFF}um " . SECCOL . data["time"] . " Uhr {FFFFFF}bekommen!")
4567SendClientMessage(PREFIX . "Drücke " . SECCOL . "X {FFFFFF}um die Wanteds trotzdem zu vergeben!")
4568KeyWait, X, D, T10
4569if (ErrorLevel) {
4570return false
4571}
4572}
4573FormatTime, time, , HH:mm
4574Loop %wanteds% {
4575SendChat("/suspect " . suspect . " " . reason . " [" . time . "]")
4576if (!admin && wanteds > 2) {
4577Sleep, 500
4578}
4579}
4580if (admin || wanteds <= 2) {
4581Sleep, 200
4582}
4583suspectLine0 := readChatLine(0)
4584suspectLine1 := readChatLine(1)
4585if (InStr(suspectLine0 . suspectLine1, "Du kannst Beamte keine Wanteds eintrragen.") || InStr(suspectLine0 . suspectLine1, "Der Spieler befindet sich im Gefängnis.")) {
4586return false
4587}
4588wanteds := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=wanteds&value=" . wanteds)
4589IniWrite, %wanteds%, stats.ini, Katalog, Wanteds
4590SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . wanteds . " {FFFFFF}Wanteds vergeben.")
4591return true
4592}
4593return false
4594}
4595givePoints(suspect, reasonID, extra := "") {
4596global username
4597global password
4598suspect := getFullName(suspect)
4599if (suspect == "") {
4600SendClientMessage(PREFIX . "Der Spieler ist nicht online!")
4601return false
4602}
4603result := URLDownloadToVar(baseURL . "api/catalog-new?username=" . username . "&password=" . password . "&type=points&id=" . reasonID . "&suspect=" . suspect)
4604try {
4605data := JSON.Load(result)
4606} catch {
4607SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
4608FormatTime, time, , dd.MM.yyyy HH:mm:ss
4609FileAppend, [%time%] Beim Laden der Wanted-Vergabe ist ein Fehler aufgetreten: %result%`n, log.txt
4610return false
4611}
4612if (data["error"] != "") {
4613SendClientMessage(PREFIX . data["error"])
4614} else {
4615points := data["amount"]
4616reason := data["reason"]
4617if (!data["registered"]) {
4618SendClientMessage(PREFIX . SECCOL . suspect . " {FFFFFF}hat bereits " . SECCOL . points . " {FFFFFF}Punkte wegen " . SECCOL . reason . " {FFFFFF}von " . SECCOL . data["lastoffical"] . " {FFFFFF}um " . SECCOL . data["time"] . " Uhr {FFFFFF}bekommen!")
4619SendClientMessage(PREFIX . "Drücke " . SECCOL . "X {FFFFFF}um die Punkte trotzdem zu vergeben!")
4620KeyWait, X, D, T10
4621if (ErrorLevel) {
4622return false
4623}
4624}
4625SendChat("/punkte " . suspect . " " . points . " " . reason . extra)
4626Sleep, 200
4627pointsLine0 := readChatLine(0)
4628pointsLine1 := readChatLine(1)
4629if (InStr(pointsLine0 . pointsLine1, "Du kannst dir keine Punkte geben.")) {
4630return false
4631}
4632points := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=points&value=" . points)
4633IniWrite, %points%, stats.ini, Katalog, Punkte
4634SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . points . " {FFFFFF}Punkte vergeben.")
4635return true
4636}
4637return false
4638}
4639giveTicket(player, money, reason) {
4640if (lastTicketReason == reason && lastTicketPlayer == player) {
4641currentTicket++
4642} else {
4643currentTicket := 1
4644maxTickets := Ceil(money / 10000)
4645}
4646currentTicketMoney := money
4647lastTicketPlayer := player
4648lastTicketReason := reason
4649if (currentTicketMoney > 10000) {
4650currentMoney := 10000
4651currentTicketMoney -= 10000
4652SendClientMessage(PREFIX . "Das nächste Ticket kannst du mit " . SECCOL . "/nt {FFFFFF}ausstellen.")
4653} else {
4654currentMoney := currentTicketMoney
4655currentTicketMoney := 0
4656}
4657if (maxTickets == 1) {
4658reason .= " [" . currentTicket . "/" . maxTickets . "]"
4659}
4660SendChat("/ticket " . player . " " . currentMoney . " " . reason)
4661}
4662payPartnerMoney(money, stat) {
4663global username
4664global password
4665global admin
4666partnerStake := Round(money / (partners.Length() + 1), 0)
4667for index, value in partners {
4668if (!admin)
4669Sleep, 750
4670SendChat("/pay " . value . " " . partnerStake)
4671}
4672statMoney := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=" . stat . "&value=" . partnerStake)
4673if (stat == "arrest_money") {
4674IniWrite, %statMoney%, stats.ini, Arrests, Geld
4675SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(statMoney) . "$ {FFFFFF}durch Verhaftungen verdient.")
4676} else if (stat == "ticket_money") {
4677IniWrite, %statMoney%, stats.ini, Vergaben, TicketGeld
4678SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(statMoney) . "$ {FFFFFF}durch Tickets verdient.")
4679} else if (stat == "plants_money") {
4680IniWrite, %statMoney%, stats.ini, Marihuana, Geld
4681SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(statMoney) . "$ {FFFFFF}durch Marihuana-Pflanzen verdient.")
4682}
4683}
4684check(name) {
4685global username
4686global password
4687global takeSystem
4688global admin
4689global checkingPlayers
4690pos := checkingPlayers.Push(name)
4691drugsFound := 0
4692matsFound := 0
4693seedsFound := 0
4694packetsFound := 0
4695SendChat("/frisk " . name)
4696Sleep, 200
4697chat := readChatLine(0)
4698if (RegExMatch(chat, "Dieser Spieler ist zu weit entfernt!"))
4699return -1
4700if (takeSystem) {
4701i := 0
4702Loop {
4703if (i > 10)
4704break
4705chat := readChatLine(i)
4706if (RegExMatch(chat, "Gegenstände von (\S+):")) {
4707if (i == 0)
4708break
4709j := i
4710Loop {
4711j--
4712if (j < 0)
4713break
4714chat := readChatLine(j)
4715if (RegExMatch(chat, "Du hast (\d+)g Drogen gefunden\.", chat_)) {
4716drugsFound := chat_1
4717} else if (RegExMatch(chat, "Du hast (\d+) Samen gefunden\.", chat_)) {
4718seedsFound := chat_1
4719} else if (RegExMatch(chat, "Du hast (\d+) Materialien gefunden\.", chat_)) {
4720matsFound := chat_1
4721} else if (RegExMatch(chat, "Du hast (\d+) Materialpakete gefunden\.", chat_)) {
4722packetsFound := chat_1
4723}
4724}
4725break
4726}
4727i++
4728}
4729if (drugsFound || seedsFound) {
4730if (!admin)
4731Sleep, 500
4732SendChat("/take Drogen " . name)
4733if (drugsFound) {
4734drugs := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=drugs&value=" . drugsFound)
4735IniWrite, %drugs%, stats.ini, Kontrollen, Drogen
4736SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(drugs) . "g {FFFFFF}Drogen weggenommen.")
4737}
4738if (seedsFound) {
4739seeds := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=seeds&value=" . seedsFound)
4740IniWrite, %seeds%, stats.ini, Kontrollen, Samen
4741SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(seeds) . " {FFFFFF}Samen weggenommen.")
4742}
4743}
4744if (matsFound || packetsFound) {
4745if (!admin)
4746Sleep, 500
4747SendChat("/take Materialien " . name)
4748if (matsFound) {
4749mats := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=mats&value=" . matsFound)
4750IniWrite, %mats%, stats.ini, Kontrollen, Materialien
4751SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(mats) . " {FFFFFF}Materialien weggenommen.")
4752}
4753if (packetsFound) {
4754matpackets := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=matpackets&value=" . packetsFound)
4755IniWrite, %matpackets%, stats.ini, Kontrollen, Materialpakete
4756SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(matpackets) . " {FFFFFF}Materialpakete weggenommen.")
4757}
4758}
4759}
4760checkingPlayers.RemoveAt(pos)
4761return [drugsFound, seedsFound, matsFound, packetsFound]
4762}
4763readCarInfos() {
4764dialog := getDialogText()
4765if (InStr(dialog, "Allgemeines")) {
4766RegExMatch(dialog, "Besitzer: (\S+)", owner)
4767id := getPlayerIdByName(owner1, true)
4768if (owner1 == "S.F.") {
4769owner1 := "S.F. Rifa"
4770} else if (owner1 == "L.S.") {
4771owner1 := "L.S. Vagos"
4772} else if (owner1 == "Los") {
4773owner1 := "Los Chickos Malos"
4774} else if (owner1 == "Grove") {
4775owner1 := "Grove Street"
4776} else if (owner1 == "Russen") {
4777owner1 := "Russen Mafia"
4778}
4779zone := getPlayerZone()
4780city := getPlayerCity()
4781if (id == -1) {
4782SendClientMessage(SECCOL . "Besitzer: {FFFFFF}" . owner1)
4783SendClientMessage(SECCOL . "Stadt: {FFFFFF}" . city . SECCOL . " Bezirk: {FFFFFF}" . zone)
4784} else {
4785lvl := getPlayerScoreById(id)
4786SendClientMessage(SECCOL . "Besitzer: {FFFFFF}" . owner1 . SECCOL . " ID: {FFFFFF}" . id . SECCOL . " Level: {FFFFFF}" . lvl)
4787SendClientMessage(SECCOL . "Stadt: {FFFFFF}" . city . SECCOL . " Bezirk: {FFFFFF}" . zone)
4788}
4789SendChat("/time")
4790}
4791}
4792sendPosition(chat) {
4793if (IsInChat())
4794return
4795zone := getPlayerZone()
4796city := getPlayerCity()
4797id := getId()
4798if (city == "" || city == "Unbekannt") {
4799SendChat("/" . chat . " Ich befinde mich derzeit in " . zone . " - [ID: " . id . "]")
4800} else {
4801SendChat("/" . chat . " Ich befinde mich derzeit in " . zone . ", " . city . " - [ID: " . id . "]")
4802}
4803}
4804getFishValue(fishName, fishWeight) {
4805if (fishName == "Bernfisch") {
4806value := fishWeight * 1
4807} else if (fishName == "Blauer Fächerfisch") {
4808value := fishWeight * 1
4809} else if (fishName == "Roter Schnapper") {
4810value := fishWeight * 2
4811} else if (fishName == "Schwertfisch") {
4812value := fishWeight * 2
4813} else if (fishName == "Zackenbarsch") {
4814value := fishWeight * 2
4815} else if (fishName == "Katzenfisch") {
4816value := fishWeight * 3
4817} else if (fishName == "Forelle") {
4818value := fishWeight * 3
4819} else if (fishName == "Delphin") {
4820value := fishWeight * 4
4821} else if (fishName == "Hai") {
4822value := fishWeight * 4
4823} else if (fishName == "Segelfisch") {
4824value := fishWeight * 4
4825} else if (fishName == "Makrele") {
4826value := fishWeight * 5
4827} else if (fishName == "Aal") {
4828value := fishWeight * 6
4829} else if (fishName == "Hecht") {
4830value := fishWeight * 6
4831} else if (fishName == "Schildkröte") {
4832value := fishWeight * 8
4833} else if (fishName == "Thunfisch") {
4834value := fishWeight * 8
4835} else if (fishName == "Wolfbarsch") {
4836value := fishWeight * 8
4837} else {
4838value := 0
4839}
4840return value
4841}
4842showStats() {
4843blockDialog()
4844if (tv) {
4845SendChat("/check " . tvName)
4846} else {
4847SendChat("/stats")
4848}
4849Sleep, 100
4850title := getDialogCaption()
4851dialog := getDialogText()
4852unblockDialog()
4853if (RegExMatch(dialog, statsFormat, dialog_)) {
4854gender := dialog_1
4855partner := dialog_2
4856level := dialog_3
4857rp := dialog_4
4858levelRP := dialog_5
4859timeToPayday := dialog_6
4860maxTimePayday := dialog_7
4861fraction := dialog_8
4862fractionRank := dialog_9
4863job := dialog_10
4864crew := dialog_11
4865cashMoney := dialog_12
4866accountMoney := dialog_13
4867depositMoney := dialog_14
4868depositMoneyInterest := dialog_15 . "." . dialog_16
4869kills := dialog_17
4870deaths := dialog_18
4871crimes := FormatNumber(dialog_19)
4872playingTime := FormatNumber(dialog_20)
4873jail := FormatNumber(dialog_21)
4874wanteds := dialog_22
4875warns := dialog_23
4876maxWarns := dialog_24
4877mats := FormatNumber(dialog_25)
4878matsSafe := FormatNumber(dialog_26)
4879drugs := FormatNumber(dialog_27)
4880drugsSafe := FormatNumber(dialog_28)
4881number := dialog_29
4882packet := dialog_30
4883canister := dialog_31
4884wdSkill := dialog_32
4885wdExp := dialog_33
4886ddSkill := dialog_34
4887ddExp := dialog_35
4888anglerSkill := dialog_36
4889busSkill := dialog_37
4890busExp := dialog_38
4891busMaxExp := dialog_39
4892lawyerSkill := dialog_40
4893lawerExp := dialog_41
4894detectiveSkill := dialog_42
4895detectiveExp := dialog_43
4896pilotExp := dialog_44
4897fisherExp := dialog_45
4898farmerExp := dialog_46
4899rank := dialog_47
4900if (partner != "Niemand") {
4901partnerID := getPlayerIdByName(partner, true)
4902if (partnerID != -1) {
4903partner .= " [ID: " . partnerID . "]"
4904}
4905}
4906level .= " (" . Round(rp / levelRP * 100) . "%)"
4907respect := rp . "/" . levelRP . " (noch " . (levelRP - rp) . " Punkte)"
4908payday := timeToPayday . "/" . maxTimePayday . " Minuten (noch " . (maxTimePayday - timeToPayday) . " Minuten)"
4909crewInfos := ""
4910if (RegExMatch(crew, "(.+)`tRang: (\d+)`n`t`tCrew-Motto: (\S+)", crew_)) {
4911crewInfos := crew_1 . "`t{FFFF00}Rang: {FFFFFF}" . crew_2 . "`n`t`t{FFFF00}Crew-Motto: {FFFFFF}" . crew_3
4912} else if (RegExMatch(crew, "(.+)`tRang: (\d+)", crew_)) {
4913crewInfos := crew_1 . "`t{FFFF00}Rang: {FFFFFF}" . crew_2
4914} else {
4915crewInfos := crew
4916}
4917if (!tv) {
4918IniWrite, %accountMoney%, stats.ini, Vermögen, Bank
4919IniWrite, %depositMoney%, stats.ini, Vermögen, Festgeld
4920}
4921allMoney := FormatNumber(cashMoney + accountMoney + depositMoney)
4922cashMoney := FormatNumber(cashMoney)
4923accountMoney := FormatNumber(accountMoney)
4924depositMoney := FormatNumber(depositMoney)
4925kd := Round(kills / deaths, 2)
4926if (!tv) {
4927IniWrite, %deaths%, stats.ini, Gesamt, Tode
4928IniWrite, %kills%, stats.ini, Gesamt, Kills
4929}
4930kills := FormatNumber(kills)
4931deaths := FormatNumber(deaths)
4932if (wdSkill <= 1) {
4933wdMaxExp := 50
4934} else if (wdSkill == 2) {
4935wdMaxExp := 50
4936} else if (wdSkill == 3) {
4937wdMaxExp := 100
4938} else if (wdSkill >= 4) {
4939wdMaxExp := 200
4940}
4941if (wdSkill == 1) {
4942wdLevelExp := wdExp
4943} else {
4944wdLevelExp := wdExp - wdMaxExp
4945}
4946if (ddSkill <= 1) {
4947ddMaxExp := 50
4948} else if (ddSkill == 2) {
4949ddMaxExp := 50
4950} else if (ddSkill == 3) {
4951ddMaxExp := 100
4952} else if (ddSkill >= 4) {
4953ddMaxExp := 200
4954}
4955if (ddSkill == 1) {
4956ddLevelExp := ddExp
4957} else {
4958ddLevelExp := ddExp - ddMaxExp
4959}
4960lawyerMaxExp := lawyerSkill * 50
4961if (detectiveSkill <= 1) {
4962detectiveMaxExp := 50
4963} else if (detectiveSkill == 2) {
4964detectiveMaxExp := 100
4965} else if (detectiveSkill == 3) {
4966detectiveMaxExp := 200
4967} else if (detectiveSkill >= 4) {
4968detectiveMaxExp := 400
4969}
4970if (!tv) {
4971IniWrite, %fisherExp%, stats.ini, Hochseefischer, XP
4972IniWrite, %farmerExp%, stats.ini, Farmer, XP
4973IniWrite, %ddExp%, stats.ini, Drogen, XP
4974IniWrite, %wdExp%, stats.ini, Materialien, XP
4975jobWeapondealerSkill := wdSkill + 1
4976jobDetectiveSkill := detectiveSkill + 1
4977IniWrite, %jobWeapondealerSkill%, settings.ini, Job, Waffendealerskill
4978IniWrite, %jobDetectiveSkill%, settings.ini, Job, Detektivskill
4979}
4980statistik =
4981 (LTrim
4982 {FFFFFF}Personalien:`t{FFFF00}Geschlecht: {FFFFFF}%gender%
4983 `t`t{FFFF00}Partner: {FFFFFF}%partner%
4984
4985 `t`t{FFFF00}Level: {FFFFFF}%level%
4986 `t`t{FFFF00}Respekt: {FFFFFF}%respect%
4987 `t`t{FFFF00}Payday: {FFFFFF}%payday%
4988
4989 Berufe:`t`t{FFFF00}Fraktion: {FFFFFF}%fraction% {FFFF00}Rang: {FFFFFF}%fractionRank%
4990 `t`t{FFFF00}Nebenjob: {FFFFFF}%job%
4991 `t`t{FFFF00}Crew: {FFFFFF}%crewInfos%
4992
4993 Finanzen:`t{FFFF00}Bargeld: {FFFFFF}%cashMoney%$
4994 `t`t{FFFF00}Konto: {FFFFFF}%accountMoney%$
4995 `t`t{FFFF00}Festgeld: {FFFFFF}%depositMoney%$ {FFFF00}Zinssatz: {FFFFFF}%depositMoneyInterest%
4996 `t`t{FFFF00}Gesamtgeld: {FFFFFF}%allMoney%$
4997
4998 Statistik:`t{FFFF00}Morde: {FFFFFF}%kills%
4999 `t`t{FFFF00}Gestorben: {FFFFFF}%deaths%
5000 `t`t{FFFF00}K/D: {FFFFFF}%kd%
5001 `t`t{FFFF00}Verbrechen: {FFFFFF}%crimes%
5002 `t`t{FFFF00}Spielzeit: {FFFFFF}%playingTime%h
5003 `t`t{FFFF00}Knast: {FFFFFF}%jail%
5004 `t`t{FFFF00}Wanteds: {FFFFFF}%wanteds%
5005 `t`t{FFFF00}Verwarnungen: {FFFFFF}%warns%/%maxWarns%
5006
5007 Inventar:`t{FFFF00}Materialien: {FFFFFF}%mats% ({FFFF00}Safe: {FFFFFF}%matsSafe%)
5008 `t`t{FFFF00}Drogen: {FFFFFF}%drugs%g ({FFFF00}Safe: {FFFFFF}%drugsSafe%g)
5009 `t`t{FFFF00}Handy {FFFFFF}({FFFF00}Nr. {FFFFFF}%number%)%packet%%canister%
5010
5011 Skills:`t`t{FFFF00}Waffendealer: {FFFFFF}%wdSkill% (%wdExp%)`t{FFFF00}Exp: {FFFFFF}%wdLevelExp%/%wdMaxExp%
5012 `t`t{FFFF00}Drogendealer: {FFFFFF}%ddSkill% (%ddExp%)`t{FFFF00}Exp: {FFFFFF}%ddLevelExp%/%ddMaxExp%
5013 `t`t{FFFF00}Busfahrer: {FFFFFF}%busSkill%`t`t{FFFF00}Exp: {FFFFFF}%busExp%/%busMaxExp%
5014 `t`t{FFFF00}Anwalt: {FFFFFF}%lawyerSkill%`t`t{FFFF00}Exp: {FFFFFF}%lawerExp%/%lawyerMaxExp%
5015 `t`t{FFFF00}Detektiv: {FFFFFF}%detectiveSkill%`t`t{FFFF00}Exp: {FFFFFF}%detectiveExp%/%detectiveMaxExp%
5016 `t`t{FFFF00}Pilot: {FFFFFF}%pilotExp%
5017 `t`t{FFFF00}Angler: {FFFFFF}%anglerSkill%
5018 `t`t{FFFF00}Hochseefischer: {FFFFFF}%fisherExp%
5019 `t`t{FFFF00}Farmer: {FFFFFF}%farmerExp%%rank%`n
5020)
5021Sleep, 100
5022ShowDialog(0, title, statistik, "Schließen")
5023}
5024}
5025gk(id, store := "", showGK := false) {
5026result := URLDownloadToVar(baseURL . "api/newgk.php?gk=" . id)
5027if (result == "ERROR_CONNECTION") {
5028SendClientMessage(PREFIX . "{FF0000}Fehler bei der Verbindung zum Server!")
5029} else if (result == "ERROR_BAD_LINK") {
5030SendClientMessage(PREFIX . "{FF0000}Fehlerhafte Parameterübergabe!")
5031} else if (result == "ERROR_ACCESS_DENIED") {
5032SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert, das Passwort ist falsch!")
5033} else if (result == "ERROR_WRONG_FORMAT") {
5034SendClientMessage(PREFIX . "{FF0000}Fehlerhaftes Format!")
5035} else if (result == "ERROR_NOT_FOUND") {
5036SendClientMessage(PREFIX . "{FF0000}Der Komplex wurde nicht in der Datenbank gefunden!")
5037} else {
5038if (store == "") {
5039SendClientMessage(PREFIX . "Gebäudekomplex {FF0000}" . id . "{FFFFFF}:")
5040}
5041try {
5042data := JSON.Load(result)
5043} catch {
5044SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
5045FormatTime, time, , dd.MM.yyyy HH:mm:ss
5046FileAppend, [%time%] Beim Laden des GK ist ein Fehler aufgetreten: %result%`n, log.txt
5047return
5048}
5049for index, entry in data {
5050name := entry["name"]
5051location := ""
5052if (entry["type"] == "public") {
5053color := "{00FF00}"
5054location := " (" . calculateZone(entry["x"], entry["y"], 0.0) . ", " . calculateCity(entry["x"], entry["y"], 0.0) . ")"
5055} else if (entry["type"] == "house") {
5056color := "{00FFFF}"
5057if (name == "Nobody") {
5058name := "Haus (frei)"
5059} else if (name == "Auktion im CP") {
5060name := "Haus (" . name . ")"
5061} else {
5062name := "Haus von " . name
5063}
5064location := " (" . calculateZone(entry["x"], entry["y"], 0.0) . ", " . calculateCity(entry["x"], entry["y"], 0.0) . ")"
5065} else if (entry["type"] == "faction") {
5066color := "{7F00FF}"
5067location := " (" . calculateZone(entry["x"], entry["y"], 0.0) . ", " . calculateCity(entry["x"], entry["y"], 0.0) . ")"
5068} else if (entry["type"] == "vehicle") {
5069color := "{FF00FF}"
5070}
5071if (entry["x"] == -5000 || entry["y"] == -5000) {
5072location := ""
5073}
5074if (store != "") {
5075if (store == "BS" && name == "Burger Shot") {
5076} else if (store == "SM" && name == "24/7") {
5077} else if (store == "CB" && name == "Clucking Bell") {
5078} else if (store == "CS" && name == "Binco") {
5079} else if (store == "PS" && name == "Well Stacked Pizza") {
5080} else {
5081continue
5082}
5083SendClientMessage(PREFIX . SECCOL . "[GK " . id . "] " . color . "[ID: " . entry["type"] . "." . entry["id"] . "] " . name . location)
5084if (showGK) {
5085Sleep, 50
5086showGK(entry["type"] . "." . entry["id"], true)
5087}
5088} else {
5089SendClientMessage(PREFIX . SECCOL . "[GK] " . color . "[ID: " . entry["type"] . "." . entry["id"] . "] " . name . location)
5090}
5091}
5092}
5093}
5094showGK(gk, ignoreExisting := false) {
5095if (RegExMatch(gk, "^(public|house|faction)\.(\d+)$", regex_)) {
5096result := UrlDownloadToVar(baseURL . "api/newgk.php?id=" . gk)
5097if (result == "ERROR_CONNECTION") {
5098SendClientMessage(PREFIX . "{FF0000}Fehler bei der Verbindung zum Server!")
5099} else if (result == "ERROR_BAD_LINK") {
5100SendClientMessage(PREFIX . "{FF0000}Fehlerhafte Parameterübergabe!")
5101} else if (result == "ERROR_ACCESS_DENIED") {
5102SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert, das Passwort ist falsch!")
5103} else if (result == "ERROR_WRONG_FORMAT") {
5104SendClientMessage(PREFIX . "{FF0000}Fehlerhaftes Format!")
5105} else if (result == "ERROR_NOT_FOUND") {
5106SendClientMessage(PREFIX . "{FF0000}Der Komplex wurde nicht in der Datenbank gefunden!")
5107} else {
5108try {
5109data := JSON.Load(result)
5110} catch {
5111SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
5112FormatTime, time, , dd.MM.yyyy HH:mm:ss
5113FileAppend, [%time%] Beim Laden des showGK ist ein Fehler aufgetreten: %result%`n, log.txt
5114return
5115}
5116if (IsMarkerCreated() && !ignoreExisting) {
5117SendClientMessage(PREFIX . "Es ist bereits ein Checkpoint gesetzt, wenn du diesen überschreiben willst, drücke " . SECCOL . "X{FFFFFF}!")
5118KeyWait, X, D, T10
5119if (ErrorLevel) {
5120return
5121}
5122}
5123zPos := data["z"]
5124if (zPos == -1)
5125zPos := 20
5126if (setCheckpoint(data["x"], data["y"], zPos, 5)) {
5127SendClientMessage(PREFIX . "Der Checkpoint zum GK mit der ID " . SECCOL . gk . " {FFFFFF}wurde erfolgreich gesetzt!")
5128} else {
5129SendClientMessage(PREFIX . "Beim Setzen des Checkpoints ist ein Fehler aufgetreten!")
5130}
5131}
5132} else {
5133SendClientMessage(PREFIX . SECCOL . "[GK] {FF0000}Fehler: Die ID wurde falsch formatiert. " . SECCOL . "Beispiel: public.12")
5134}
5135}
5136SetWorkingDir, %A_ScriptDir%
5137SetTimer, AntiDecompile, 100
5138IfExist, update.bat
5139{
5140FileDelete, update.bat
5141}
5142global baseURL := "https://lspd.comniemeer.de/"
5143global projectName := "LSPD"
5144global fullProjectName := "Los Santos Police Department"
5145version := "2.1.2"
5146IniRead, username, login.ini, login, username, %A_Space%
5147IniRead, password, login.ini, login, password, %A_Space%
5148if (username != "" && password != "") {
5149Sleep, 100
5150loginResult := URLDownloadToVar(baseURL . "api/keybinder.php?type=login&username=" . username . "&password=" . password . "&version=" . version)
5151FormatTime, time, , dd.MM.yyyy HH:mm:ss
5152FileAppend, [%time%] Loginergebnis: %loginResult%`n, log.txt
5153if (loginResult == "true") {
5154Goto, Start
5155} else if (loginResult == "false") {
5156ExitApp
5157} else {
5158ExitApp
5159}
5160} else {
5161IniWrite, % "", login.ini, login, username
5162IniWrite, % "", login.ini, login, password
5163ExitApp
5164}
5165return
5166Start:
5167{
5168newver := URLDownloadToVar(baseURL . "api/getsetting?key=version")
5169StringSplit, version_, version, .
5170StringSplit, newver_, newver, .
5171if (version_1 < newver_1 || (version_1 <= newver_1 && version_2 < newver_2) || (version_1 <= newver_1 && version_2 <= newver_2 && version_3 < newver_3)) {
5172changelog := URLDownloadToVar(baseURL . "api/getupdatelog?version=" . newver . "&single")
5173MsgBox, 68, %projectName% Keybinder - Version %version%, Es wurde eine neue Keybinderversion (Version %newver%) veröffentlicht!`nMöchtest du diese nun herunterladen?`n`n%changelog%
5174IfMsgBox, Yes
5175{
5176Progress, 25, Lädt neue Version herunter, Der Keybinder wird nun geupdated..., Update
5177URLDownloadToVar(baseURL . "api/keybinder.php?type=update&username=" . username . "&password=" . password . "&version=" . newver)
5178extraVersion := ""
5179UrlDownloadToFile, %baseURL%downloads/%projectName%%extraVersion%.exe, %projectName%%extraVersion%.new.exe
5180Progress, 75, Installiere Update, Der Keybinder wird nun geupdated..., Update
5181Sleep, 500
5182UpdateBat =
5183(LTrim
5184ping 127.0.0.1 -n 2 > nul
5185Del "%projectName%%extraVersion%.exe"
5186Rename "%projectName%%extraVersion%.new.exe" "%projectName%%extraVersion%.exe"
5187"%projectName%%extraVersion%.exe"
5188)
5189FileAppend, %UpdateBat%, update.bat
5190Run, update.bat, , hide
5191Progress, 100, Abgeschlossen, Der Keybinder wird nun geupdated..., Update
5192ExitApp
5193}
5194}
5195unBlockChatInput()
5196chatLogFile := FileOpen(A_MyDocuments . "\GTA San Andreas User Files\SAMP\chatlog.txt", "r")
5197firstChatLogRun := true
5198chatLogLines := []
5199FormatTime, time, , dd.MM.yyyy HH:mm:ss
5200IfNotExist, bin
5201{
5202FileCreateDir, bin
5203}
5204IfNotExist, bin\sqlite3.dll
5205{
5206URLDownloadToFile, %baseURL%downloads/bin/sqlite3.dll, bin\sqlite3.dll
5207}
5208IniRead, SQLite3DllPath, SQLiteDB.ini, Main, DllPath, %A_Space%
5209if (SQLite3DllPath != "bin\SQLite3.dll") {
5210IniWrite, % "bin\SQLite3.dll", SQLiteDB.ini, Main, DllPath
5211}
5212Class SQLiteDB Extends SQLiteDB.BaseClass {
5213Class BaseClass {
5214Static Version := ""
5215Static _SQLiteDLL := A_ScriptDir . "\SQLite3.dll"
5216Static _RefCount := 0
5217Static _MinVersion := "3.6"
5218}
5219Class _Table {
5220__New() {
5221This.ColumnCount := 0
5222This.RowCount := 0
5223This.ColumnNames := []
5224This.Rows := []
5225This.HasNames := False
5226This.HasRows := False
5227This._CurrentRow := 0
5228}
5229GetRow(RowIndex, ByRef Row) {
5230Row := ""
5231If (RowIndex < 1 || RowIndex > This.RowCount)
5232Return False
5233If !This.Rows.HasKey(RowIndex)
5234Return False
5235Row := This.Rows[RowIndex]
5236This._CurrentRow := RowIndex
5237Return True
5238}
5239Next(ByRef Row) {
5240Row := ""
5241If (This._CurrentRow >= This.RowCount)
5242Return -1
5243This._CurrentRow += 1
5244If !This.Rows.HasKey(This._CurrentRow)
5245Return False
5246Row := This.Rows[This._CurrentRow]
5247Return True
5248}
5249Reset() {
5250This._CurrentRow := 0
5251Return True
5252}
5253}
5254Class _RecordSet {
5255__New() {
5256This.ColumnCount := 0
5257This.ColumnNames := []
5258This.HasNames := False
5259This.HasRows := False
5260This.CurrentRow := 0
5261This.ErrorMsg := ""
5262This.ErrorCode := 0
5263This._Handle := 0
5264This._DB := {}
5265}
5266Next(ByRef Row) {
5267Static SQLITE_NULL := 5
5268Static SQLITE_BLOB := 4
5269Static EOR := -1
5270Row := ""
5271This.ErrorMsg := ""
5272This.ErrorCode := 0
5273If !(This._Handle) {
5274This.ErrorMsg := "Invalid query handle!"
5275Return False
5276}
5277RC := DllCall("SQlite3.dll\sqlite3_step", "Ptr", This._Handle, "Cdecl Int")
5278If (ErrorLevel) {
5279This.ErrorMsg := "DLLCall sqlite3_step failed!"
5280This.ErrorCode := ErrorLevel
5281Return False
5282}
5283If (RC <> This._DB._ReturnCode("SQLITE_ROW")) {
5284If (RC = This._DB._ReturnCode("SQLITE_DONE")) {
5285This.ErrorMsg := "EOR"
5286This.ErrorCode := RC
5287Return EOR
5288}
5289This.ErrorMsg := This._DB.ErrMsg()
5290This.ErrorCode := RC
5291Return False
5292}
5293RC := DllCall("SQlite3.dll\sqlite3_data_count", "Ptr", This._Handle, "Cdecl Int")
5294If (ErrorLevel) {
5295This.ErrorMsg := "DLLCall sqlite3_data_count failed!"
5296This.ErrorCode := ErrorLevel
5297Return False
5298}
5299If (RC < 1) {
5300This.ErrorMsg := "RecordSet is empty!"
5301This.ErrorCode := This._DB._ReturnCode("SQLITE_EMPTY")
5302Return False
5303}
5304Row := []
5305Loop, %RC% {
5306Column := A_Index - 1
5307ColumnType := DllCall("SQlite3.dll\sqlite3_column_type", "Ptr", This._Handle, "Int", Column, "Cdecl Int")
5308If (ErrorLevel) {
5309This.ErrorMsg := "DLLCall sqlite3_column_type failed!"
5310This.ErrorCode := ErrorLevel
5311Return False
5312}
5313If (ColumnType = SQLITE_NULL) {
5314Row[A_Index] := ""
5315} Else If (ColumnType = SQLITE_BLOB) {
5316BlobPtr := DllCall("SQlite3.dll\sqlite3_column_blob", "Ptr", This._Handle, "Int", Column, "Cdecl UPtr")
5317BlobSize := DllCall("SQlite3.dll\sqlite3_column_bytes", "Ptr", This._Handle, "Int", Column, "Cdecl Int")
5318If (BlobPtr = 0) || (BlobSize = 0) {
5319Row[A_Index] := ""
5320} Else {
5321Row[A_Index] := {}
5322Row[A_Index].Size := BlobSize
5323Row[A_Index].Blob := ""
5324Row[A_Index].SetCapacity("Blob", BlobSize)
5325Addr := Row[A_Index].GetAddress("Blob")
5326DllCall("Kernel32.dll\RtlMoveMemory", "Ptr", Addr, "Ptr", BlobPtr, "Ptr", BlobSize)
5327}
5328} Else {
5329StrPtr := DllCall("SQlite3.dll\sqlite3_column_text", "Ptr", This._Handle, "Int", Column, "Cdecl UPtr")
5330If (ErrorLevel) {
5331This.ErrorMsg := "DLLCall sqlite3_column_text failed!"
5332This.ErrorCode := ErrorLevel
5333Return False
5334}
5335Row[A_Index] := StrGet(StrPtr, "UTF-8")
5336}
5337}
5338This.CurrentRow += 1
5339Return True
5340}
5341Reset() {
5342This.ErrorMsg := ""
5343This.ErrorCode := 0
5344If !(This._Handle) {
5345This.ErrorMsg := "Invalid query handle!"
5346Return False
5347}
5348RC := DllCall("SQlite3.dll\sqlite3_reset", "Ptr", This._Handle, "Cdecl Int")
5349If (ErrorLevel) {
5350This.ErrorMsg := "DLLCall sqlite3_reset failed!"
5351This.ErrorCode := ErrorLevel
5352Return False
5353}
5354If (RC) {
5355This.ErrorMsg := This._DB._ErrMsg()
5356This.ErrorCode := RC
5357Return False
5358}
5359This.CurrentRow := 0
5360Return True
5361}
5362Free() {
5363This.ErrorMsg := ""
5364This.ErrorCode := 0
5365If !(This._Handle)
5366Return True
5367RC := DllCall("SQlite3.dll\sqlite3_finalize", "Ptr", This._Handle, "Cdecl Int")
5368If (ErrorLevel) {
5369This.ErrorMsg := "DLLCall sqlite3_finalize failed!"
5370This.ErrorCode := ErrorLevel
5371Return False
5372}
5373If (RC) {
5374This.ErrorMsg := This._DB._ErrMsg()
5375This.ErrorCode := RC
5376Return False
5377}
5378This._DB._Queries.Remove(This._Handle)
5379This._Handle := 0
5380Return True
5381}
5382}
5383__New() {
5384This._Path := ""
5385This._Handle := 0
5386This._Queries := {}
5387If (This.Base._RefCount = 0) {
5388SQLiteDLL := This.Base._SQLiteDLL
5389If !FileExist(SQLiteDLL)
5390If FileExist(A_ScriptDir . "\SQLiteDB.ini") {
5391IniRead, SQLiteDLL, %A_ScriptDir%\SQLiteDB.ini, Main, DllPath, %SQLiteDLL%
5392This.Base._SQLiteDLL := SQLiteDLL
5393}
5394If !(DLL := DllCall("LoadLibrary", "Str", This.Base._SQLiteDLL, "UPtr")) {
5395MsgBox, 16, SQLiteDB Error, % "DLL " . SQLiteDLL . " does not exist!"
5396ExitApp
5397}
5398This.Base.Version := StrGet(DllCall("SQlite3.dll\sqlite3_libversion", "Cdecl UPtr"), "UTF-8")
5399SQLVersion := StrSplit(This.Base.Version, ".")
5400MinVersion := StrSplit(This.Base._MinVersion, ".")
5401If (SQLVersion[1] < MinVersion[1]) || ((SQLVersion[1] = MinVersion[1]) && (SQLVersion[2] < MinVersion[2])){
5402DllCall("FreeLibrary", "Ptr", DLL)
5403MsgBox, 16, SQLite ERROR, % "Version " . This.Base.Version . " of SQLite3.dll is not supported!`n`n"
5404. "You can download the current version from www.sqlite.org!"
5405ExitApp
5406}
5407}
5408This.Base._RefCount += 1
5409}
5410__Delete() {
5411If (This._Handle)
5412This.CloseDB()
5413This.Base._RefCount -= 1
5414If (This.Base._RefCount = 0) {
5415If (DLL := DllCall("GetModuleHandle", "Str", This.Base._SQLiteDLL, "UPtr"))
5416DllCall("FreeLibrary", "Ptr", DLL)
5417}
5418}
5419_StrToUTF8(Str, ByRef UTF8) {
5420VarSetCapacity(UTF8, StrPut(Str, "UTF-8"), 0)
5421StrPut(Str, &UTF8, "UTF-8")
5422Return &UTF8
5423}
5424_UTF8ToStr(UTF8) {
5425Return StrGet(UTF8, "UTF-8")
5426}
5427_ErrMsg() {
5428If (RC := DllCall("SQLite3.dll\sqlite3_errmsg", "Ptr", This._Handle, "Cdecl UPtr"))
5429Return StrGet(&RC, "UTF-8")
5430Return ""
5431}
5432_ErrCode() {
5433Return DllCall("SQLite3.dll\sqlite3_errcode", "Ptr", This._Handle, "Cdecl Int")
5434}
5435_Changes() {
5436Return DllCall("SQLite3.dll\sqlite3_changes", "Ptr", This._Handle, "Cdecl Int")
5437}
5438_ReturnCode(RC) {
5439Static RCODE := {SQLITE_OK: 0
5440, SQLITE_ERROR: 1
5441, SQLITE_INTERNAL: 2
5442, SQLITE_PERM: 3
5443, SQLITE_ABORT: 4
5444, SQLITE_BUSY: 5
5445, SQLITE_LOCKED: 6
5446, SQLITE_NOMEM: 7
5447, SQLITE_READONLY: 8
5448, SQLITE_INTERRUPT: 9
5449, SQLITE_IOERR: 10
5450, SQLITE_CORRUPT: 11
5451, SQLITE_NOTFOUND: 12
5452, SQLITE_FULL: 13
5453, SQLITE_CANTOPEN: 14
5454, SQLITE_PROTOCOL: 15
5455, SQLITE_EMPTY: 16
5456, SQLITE_SCHEMA: 17
5457, SQLITE_TOOBIG: 18
5458, SQLITE_CONSTRAINT: 19
5459, SQLITE_MISMATCH: 20
5460, SQLITE_MISUSE: 21
5461, SQLITE_NOLFS: 22
5462, SQLITE_AUTH: 23
5463, SQLITE_FORMAT: 24
5464, SQLITE_RANGE: 25
5465, SQLITE_NOTADB: 26
5466, SQLITE_ROW: 100
5467, SQLITE_DONE: 101}
5468Return RCODE.HasKey(RC) ? RCODE[RC] : ""
5469}
5470ErrorMsg := ""
5471ErrorCode := 0
5472Changes := 0
5473SQL := ""
5474OpenDB(DBPath, Access := "W", Create := True) {
5475Static SQLITE_OPEN_READONLY := 0x01
5476Static SQLITE_OPEN_READWRITE := 0x02
5477Static SQLITE_OPEN_CREATE := 0x04
5478Static MEMDB := ":memory:"
5479This.ErrorMsg := ""
5480This.ErrorCode := 0
5481HDB := 0
5482If (DBPath = "")
5483DBPath := MEMDB
5484If (DBPath = This._Path) && (This._Handle)
5485Return True
5486If (This._Handle) {
5487This.ErrorMsg := "You must first close DB " . This._Path . "!"
5488Return False
5489}
5490Flags := 0
5491Access := SubStr(Access, 1, 1)
5492If (Access <> "W") && (Access <> "R")
5493Access := "R"
5494Flags := SQLITE_OPEN_READONLY
5495If (Access = "W") {
5496Flags := SQLITE_OPEN_READWRITE
5497If (Create)
5498Flags |= SQLITE_OPEN_CREATE
5499}
5500This._Path := DBPath
5501This._StrToUTF8(DBPath, UTF8)
5502RC := DllCall("SQlite3.dll\sqlite3_open_v2", "Ptr", &UTF8, "PtrP", HDB, "Int", Flags, "Ptr", 0, "Cdecl Int")
5503If (ErrorLevel) {
5504This._Path := ""
5505This.ErrorMsg := "DLLCall sqlite3_open_v2 failed!"
5506This.ErrorCode := ErrorLevel
5507Return False
5508}
5509If (RC) {
5510This._Path := ""
5511This.ErrorMsg := This._ErrMsg()
5512This.ErrorCode := RC
5513Return False
5514}
5515This._Handle := HDB
5516Return True
5517}
5518CloseDB() {
5519This.ErrorMsg := ""
5520This.ErrorCode := 0
5521This.SQL := ""
5522If !(This._Handle)
5523Return True
5524For Each, Query in This._Queries
5525DllCall("SQlite3.dll\sqlite3_finalize", "Ptr", Query, "Cdecl Int")
5526RC := DllCall("SQlite3.dll\sqlite3_close", "Ptr", This._Handle, "Cdecl Int")
5527If (ErrorLevel) {
5528This.ErrorMsg := "DLLCall sqlite3_close failed!"
5529This.ErrorCode := ErrorLevel
5530Return False
5531}
5532If (RC) {
5533This.ErrorMsg := This._ErrMsg()
5534This.ErrorCode := RC
5535Return False
5536}
5537This._Path := ""
5538This._Handle := ""
5539This._Queries := []
5540Return True
5541}
5542AttachDB(DBPath, DBAlias) {
5543Return This.Exec("ATTACH DATABASE '" . DBPath . "' As " . DBAlias . ";")
5544}
5545DetachDB(DBAlias) {
5546Return This.Exec("DETACH DATABASE " . DBAlias . ";")
5547}
5548Exec(SQL, Callback := "") {
5549This.ErrorMsg := ""
5550This.ErrorCode := 0
5551This.SQL := SQL
5552If !(This._Handle) {
5553This.ErrorMsg := "Invalid dadabase handle!"
5554Return False
5555}
5556CBPtr := 0
5557Err := 0
5558If (FO := Func(Callback)) && (FO.MinParams = 4)
5559CBPtr := RegisterCallback(Callback, "F C", 4, &SQL)
5560This._StrToUTF8(SQL, UTF8)
5561RC := DllCall("SQlite3.dll\sqlite3_exec", "Ptr", This._Handle, "Ptr", &UTF8, "Int", CBPtr, "Ptr", Object(This)
5562, "PtrP", Err, "Cdecl Int")
5563CallError := ErrorLevel
5564If (CBPtr)
5565DllCall("Kernel32.dll\GlobalFree", "Ptr", CBPtr)
5566If (CallError) {
5567This.ErrorMsg := "DLLCall sqlite3_exec failed!"
5568This.ErrorCode := CallError
5569Return False
5570}
5571If (RC) {
5572This.ErrorMsg := StrGet(Err, "UTF-8")
5573This.ErrorCode := RC
5574DllCall("SQLite3.dll\sqlite3_free", "Ptr", Err, "Cdecl")
5575Return False
5576}
5577This.Changes := This._Changes()
5578Return True
5579}
5580GetTable(SQL, ByRef TB, MaxResult := 0) {
5581TB := ""
5582This.ErrorMsg := ""
5583This.ErrorCode := 0
5584This.SQL := SQL
5585If !(This._Handle) {
5586This.ErrorMsg := "Invalid dadabase handle!"
5587Return False
5588}
5589If !RegExMatch(SQL, "i)^\s*(SELECT|PRAGMA)\s") {
5590This.ErrorMsg := "Method " . A_ThisFunc . " requires a query statement!"
5591Return False
5592}
5593Names := ""
5594Err := 0, RC := 0, GetRows := 0
5595I := 0, Rows := Cols := 0
5596Table := 0
5597If MaxResult Is Not Integer
5598MaxResult := 0
5599If (MaxResult < -2)
5600MaxResult := 0
5601This._StrToUTF8(SQL, UTF8)
5602RC := DllCall("SQlite3.dll\sqlite3_get_table", "Ptr", This._Handle, "Ptr", &UTF8, "PtrP", Table
5603, "IntP", Rows, "IntP", Cols, "PtrP", Err, "Cdecl Int")
5604If (ErrorLevel) {
5605This.ErrorMsg := "DLLCall sqlite3_get_table failed!"
5606This.ErrorCode := ErrorLevel
5607Return False
5608}
5609If (RC) {
5610This.ErrorMsg := StrGet(Err, "UTF-8")
5611This.ErrorCode := RC
5612DllCall("SQLite3.dll\sqlite3_free", "Ptr", Err, "Cdecl")
5613Return False
5614}
5615TB := new This._Table
5616TB.ColumnCount := Cols
5617TB.RowCount := Rows
5618If (MaxResult = -1) {
5619DllCall("SQLite3.dll\sqlite3_free_table", "Ptr", Table, "Cdecl")
5620If (ErrorLevel) {
5621This.ErrorMsg := "DLLCall sqlite3_free_table failed!"
5622This.ErrorCode := ErrorLevel
5623Return False
5624}
5625Return True
5626}
5627If (MaxResult = -2)
5628GetRows := 0
5629Else If (MaxResult > 0) && (MaxResult <= Rows)
5630GetRows := MaxResult
5631Else
5632GetRows := Rows
5633Offset := 0
5634Names := Array()
5635Loop, %Cols% {
5636Names[A_Index] := StrGet(NumGet(Table+0, Offset, "UPtr"), "UTF-8")
5637Offset += A_PtrSize
5638}
5639TB.ColumnNames := Names
5640TB.HasNames := True
5641Loop, %GetRows% {
5642I := A_Index
5643TB.Rows[I] := []
5644Loop, %Cols% {
5645TB.Rows[I][A_Index] := StrGet(NumGet(Table+0, Offset, "UPtr"), "UTF-8")
5646Offset += A_PtrSize
5647}
5648}
5649If (GetRows)
5650TB.HasRows := True
5651DllCall("SQLite3.dll\sqlite3_free_table", "Ptr", Table, "Cdecl")
5652If (ErrorLevel) {
5653TB := ""
5654This.ErrorMsg := "DLLCall sqlite3_free_table failed!"
5655This.ErrorCode := ErrorLevel
5656Return False
5657}
5658Return True
5659}
5660Query(SQL, ByRef RS) {
5661RS := ""
5662This.ErrorMsg := ""
5663This.ErrorCode := 0
5664This.SQL := SQL
5665ColumnCount := 0
5666HasRows := False
5667If !(This._Handle) {
5668This.ErrorMsg := "Invalid dadabase handle!"
5669Return False
5670}
5671If !RegExMatch(SQL, "i)^\s*(SELECT|PRAGMA)\s|") {
5672This.ErrorMsg := "Method " . A_ThisFunc . " requires a query statement!"
5673Return False
5674}
5675Query := 0
5676This._StrToUTF8(SQL, UTF8)
5677RC := DllCall("SQlite3.dll\sqlite3_prepare_v2", "Ptr", This._Handle, "Ptr", &UTF8, "Int", -1
5678, "PtrP", Query, "Ptr", 0, "Cdecl Int")
5679If (ErrorLeveL) {
5680This.ErrorMsg := "DLLCall sqlite3_prepare_v2 failed!"
5681This.ErrorCode := ErrorLevel
5682Return False
5683}
5684If (RC) {
5685This.ErrorMsg := This._ErrMsg()
5686This.ErrorCode := RC
5687Return False
5688}
5689RC := DllCall("SQlite3.dll\sqlite3_column_count", "Ptr", Query, "Cdecl Int")
5690If (ErrorLevel) {
5691This.ErrorMsg := "DLLCall sqlite3_column_count failed!"
5692This.ErrorCode := ErrorLevel
5693Return False
5694}
5695If (RC < 1) {
5696This.ErrorMsg := "Query result is empty!"
5697This.ErrorCode := This._ReturnCode("SQLITE_EMPTY")
5698Return False
5699}
5700ColumnCount := RC
5701Names := []
5702Loop, %RC% {
5703StrPtr := DllCall("SQlite3.dll\sqlite3_column_name", "Ptr", Query, "Int", A_Index - 1, "Cdecl UPtr")
5704If (ErrorLevel) {
5705This.ErrorMsg := "DLLCall sqlite3_column_name failed!"
5706This.ErrorCode := ErrorLevel
5707Return False
5708}
5709Names[A_Index] := StrGet(StrPtr, "UTF-8")
5710}
5711RC := DllCall("SQlite3.dll\sqlite3_step", "Ptr", Query, "Cdecl Int")
5712If (ErrorLevel) {
5713This.ErrorMsg := "DLLCall sqlite3_step failed!"
5714This.ErrorCode := ErrorLevel
5715Return False
5716}
5717If (RC = This._ReturnCode("SQLITE_ROW"))
5718HasRows := True
5719RC := DllCall("SQlite3.dll\sqlite3_reset", "Ptr", Query, "Cdecl Int")
5720If (ErrorLevel) {
5721This.ErrorMsg := "DLLCall sqlite3_reset failed!"
5722This.ErrorCode := ErrorLevel
5723Return False
5724}
5725RS := new This._RecordSet
5726RS.ColumnCount := ColumnCount
5727RS.ColumnNames := Names
5728RS.HasNames := True
5729RS.HasRows := HasRows
5730RS._Handle := Query
5731RS._DB := This
5732This._Queries[Query] := Query
5733Return True
5734}
5735LastInsertRowID(ByRef RowID) {
5736This.ErrorMsg := ""
5737This.ErrorCode := 0
5738This.SQL := ""
5739If !(This._Handle) {
5740This.ErrorMsg := "Invalid dadabase handle!"
5741Return False
5742}
5743RowID := 0
5744RC := DllCall("SQLite3.dll\sqlite3_last_insert_rowid", "Ptr", This._Handle, "Cdecl Int64")
5745If (ErrorLevel) {
5746This.ErrorMsg := "DLLCall sqlite3_last_insert_rowid failed!"
5747This.ErrorCode := ErrorLevel
5748Return False
5749}
5750RowID := RC
5751Return True
5752}
5753TotalChanges(ByRef Rows) {
5754This.ErrorMsg := ""
5755This.ErrorCode := 0
5756This.SQL := ""
5757If !(This._Handle) {
5758This.ErrorMsg := "Invalid dadabase handle!"
5759Return False
5760}
5761Rows := 0
5762RC := DllCall("SQLite3.dll\sqlite3_total_changes", "Ptr", This._Handle, "Cdecl Int")
5763If (ErrorLevel) {
5764This.ErrorMsg := "DLLCall sqlite3_total_changes failed!"
5765This.ErrorCode := ErrorLevel
5766Return False
5767}
5768Rows := RC
5769Return True
5770}
5771SetTimeout(Timeout := 1000) {
5772This.ErrorMsg := ""
5773This.ErrorCode := 0
5774This.SQL := ""
5775If !(This._Handle) {
5776This.ErrorMsg := "Invalid dadabase handle!"
5777Return False
5778}
5779If Timeout Is Not Integer
5780Timeout := 1000
5781RC := DllCall("SQLite3.dll\sqlite3_busy_timeout", "Ptr", This._Handle, "Cdecl Int")
5782If (ErrorLevel) {
5783This.ErrorMsg := "DLLCall sqlite3_busy_timeout failed!"
5784This.ErrorCode := ErrorLevel
5785Return False
5786}
5787If (RC) {
5788This.ErrorMsg := This._ErrMsg()
5789This.ErrorCode := RC
5790Return False
5791}
5792Return True
5793}
5794EscapeStr(ByRef Str, Quote := True) {
5795This.ErrorMsg := ""
5796This.ErrorCode := 0
5797This.SQL := ""
5798If !(This._Handle) {
5799This.ErrorMsg := "Invalid dadabase handle!"
5800Return False
5801}
5802If Str Is Number
5803Return True
5804OP := Quote ? "%Q" : "%q"
5805This._StrToUTF8(Str, UTF8)
5806Ptr := DllCall("SQLite3.dll\sqlite3_mprintf", "Ptr", &OP, "Ptr", &UTF8, "Cdecl UPtr")
5807If (ErrorLevel) {
5808This.ErrorMsg := "DLLCall sqlite3_mprintf failed!"
5809This.ErrorCode := ErrorLevel
5810Return False
5811}
5812Str := This._UTF8ToStr(Ptr)
5813DllCall("SQLite3.dll\sqlite3_free", "Ptr", Ptr, "Cdecl")
5814Return True
5815}
5816StoreBLOB(SQL, BlobArray) {
5817Static SQLITE_STATIC := 0
5818Static SQLITE_TRANSIENT := -1
5819This.ErrorMsg := ""
5820This.ErrorCode := 0
5821If !(This._Handle) {
5822This.ErrorMsg := "Invalid dadabase handle!"
5823Return False
5824}
5825If !RegExMatch(SQL, "i)^\s*(INSERT|UPDATE|REPLACE)\s") {
5826This.ErrorMsg := A_ThisFunc . " requires an INSERT/UPDATE/REPLACE statement!"
5827Return False
5828}
5829Query := 0
5830This._StrToUTF8(SQL, UTF8)
5831RC := DllCall("SQlite3.dll\sqlite3_prepare_v2", "Ptr", This._Handle, "Ptr", &UTF8, "Int", -1
5832, "PtrP", Query, "Ptr", 0, "Cdecl Int")
5833If (ErrorLeveL) {
5834This.ErrorMsg := A_ThisFunc . ": DLLCall sqlite3_prepare_v2 failed!"
5835This.ErrorCode := ErrorLevel
5836Return False
5837}
5838If (RC) {
5839This.ErrorMsg := A_ThisFunc . ": " . This._ErrMsg()
5840This.ErrorCode := RC
5841Return False
5842}
5843For BlobNum, Blob In BlobArray {
5844If !(Blob.Addr) || !(Blob.Size) {
5845This.ErrorMsg := A_ThisFunc . ": Invalid parameter BlobArray!"
5846This.ErrorCode := ErrorLevel
5847Return False
5848}
5849RC := DllCall("SQlite3.dll\sqlite3_bind_blob", "Ptr", Query, "Int", BlobNum, "Ptr", Blob.Addr
5850, "Int", Blob.Size, "Ptr", SQLITE_STATIC, "Cdecl Int")
5851If (ErrorLeveL) {
5852This.ErrorMsg := A_ThisFunc . ": DLLCall sqlite3_prepare_v2 failed!"
5853This.ErrorCode := ErrorLevel
5854Return False
5855}
5856If (RC) {
5857This.ErrorMsg := A_ThisFunc . ": " . This._ErrMsg()
5858This.ErrorCode := RC
5859Return False
5860}
5861}
5862RC := DllCall("SQlite3.dll\sqlite3_step", "Ptr", Query, "Cdecl Int")
5863If (ErrorLevel) {
5864This.ErrorMsg := A_ThisFunc . ": DLLCall sqlite3_step failed!"
5865This.ErrorCode := ErrorLevel
5866Return False
5867}
5868If (RC) && (RC <> This._ReturnCode("SQLITE_DONE")) {
5869This.ErrorMsg := A_ThisFunc . ": " . This._ErrMsg()
5870This.ErrorCode := RC
5871Return False
5872}
5873RC := DllCall("SQlite3.dll\sqlite3_finalize", "Ptr", Query, "Cdecl Int")
5874If (ErrorLevel) {
5875This.ErrorMsg := A_ThisFunc . ": DLLCall sqlite3_finalize failed!"
5876This.ErrorCode := ErrorLevel
5877Return False
5878}
5879If (RC) {
5880This.ErrorMsg := A_ThisFunc . ": " . This._ErrMsg()
5881This.ErrorCode := RC
5882Return False
5883}
5884Return True
5885}
5886}
5887SQLiteDB := new SQLiteDB
5888SQLiteDB.OpenDB(projectName . ".db")
5889if (!SQLiteDB.Exec("CREATE TABLE IF NOT EXISTS friends (name VARCHAR(35), added INT(10), PRIMARY KEY (name));")) {
5890MsgBox, 16, SQLite Fehler, % "Es ist ein Fehler beim Erstellen der Freunde-Datenbank aufgetreten!`n`nFehlernachricht:`t" . SQLiteDB.ErrorMsg . "`nFehlercode:`t" . SQLiteDB.ErrorCode . "`n`nBitte melde dich bei Martin im Forum!"
5891SQLiteDB.CloseDB()
5892ExitApp
5893}
5894registeredHotkeys := Object()
5895defaultHotkeysArray := Object()
5896defaultHotkeysArray["atkWanteds"] := "!Numpad1"
5897defaultHotkeysArray["escapeWanteds"] := "!Numpad2"
5898defaultHotkeysArray["refusalWanteds"] := "!Numpad3"
5899defaultHotkeysArray["obstructionWanteds"] := "!Numpad4"
5900defaultHotkeysArray["possessionWanteds"] := "!Numpad5"
5901defaultHotkeysArray["drugConsumptionWanteds"] := "!Numpad6"
5902defaultHotkeysArray["escapeAidWanteds"] := "!Numpad7"
5903defaultHotkeysArray["tradeWanteds"] := "!Numpad8"
5904defaultHotkeysArray["unauthorizedEnterWanteds"] := "!Numpad9"
5905defaultHotkeysArray["customsEscapeWanteds"] := "!Z"
5906defaultHotkeysArray["vehicleTheftWanteds"] := "!K"
5907defaultHotkeysArray["insultingWanteds"] := "!H"
5908defaultHotkeysArray["useOfWeaponsWanteds"] := "!I"
5909defaultHotkeysArray["possessionOfWeaponsWanteds"] := "!U"
5910defaultHotkeysArray["briberyWanteds"] := "!B"
5911defaultHotkeysArray["escWanteds"] := "!E"
5912defaultHotkeysArray["clearWanteds"] := "~-"
5913defaultHotkeysArray["secondRowPoints"] := "~^Numpad0"
5914defaultHotkeysArray["roadHazardPoints"] := "~^Numpad1"
5915defaultHotkeysArray["wrongSitePoints"] := "~^Numpad2"
5916defaultHotkeysArray["speedPoints"] := "~^Numpad3"
5917defaultHotkeysArray["rightOfWayPoints"] := "~^Numpad4"
5918defaultHotkeysArray["offsitePoints"] := "~^Numpad5"
5919defaultHotkeysArray["lightPoints"] := "~^Numpad6"
5920defaultHotkeysArray["noParkingPoints"] := "~^Numpad7"
5921defaultHotkeysArray["influenceOfDrugsPoints"] := "~^Numpad8"
5922defaultHotkeysArray["clearPoints"] := "!-"
5923defaultHotkeysArray["motorSystem"] := "~1"
5924defaultHotkeysArray["lock"] := "~Y"
5925defaultHotkeysArray["light"] := "~+1"
5926defaultHotkeysArray["uclight"] := "~B"
5927defaultHotkeysArray["repeat"] := "~ä"
5928defaultHotkeysArray["thanks"] := "~ü"
5929defaultHotkeysArray["sorry"] := "~+"
5930defaultHotkeysArray["megaFollow"] := "~Numpad0"
5931defaultHotkeysArray["megaControl"] := "~Numpad1"
5932defaultHotkeysArray["megaStop"] := "~Numpad2"
5933defaultHotkeysArray["megaShootWarning"] := "~Numpad3"
5934defaultHotkeysArray["megaGetOutOfCar"] := "~Numpad4"
5935defaultHotkeysArray["megaClear"] := "~Numpad5"
5936defaultHotkeysArray["megaWeapons"] := "~Numpad6"
5937defaultHotkeysArray["megaLeave"] := "~Numpad9"
5938defaultHotkeysArray["megaStopFollow"] := "!NumpadEnter"
5939defaultHotkeysArray["megaRoadTrafficAct"] := "~NumpadDot"
5940defaultHotkeysArray["equip"] := "!F4"
5941defaultHotkeysArray["heal"] := "^F4"
5942defaultHotkeysArray["equipProfile1"] := "F4"
5943defaultHotkeysArray["equipProfile2"] := "F5"
5944defaultHotkeysArray["equipProfile3"] := "F6"
5945defaultHotkeysArray["members"] := "~M"
5946defaultHotkeysArray["crewmembers"] := "!M"
5947defaultHotkeysArray["backup"] := "~NumpadAdd"
5948defaultHotkeysArray["backupWh"] := "~^NumpadAdd"
5949defaultHotkeysArray["noBackup"] := "!NumpadAdd"
5950defaultHotkeysArray["position"] := "~^P"
5951defaultHotkeysArray["fPosition"] := "!P"
5952defaultHotkeysArray["rPosition"] := "~P"
5953defaultHotkeysArray["acceptJob"] := "~´"
5954defaultHotkeysArray["doneJob"] := "!´"
5955defaultHotkeysArray["autoAcceptEmergency"] := "~^"
5956defaultHotkeysArray["acceptEmergency"] := "~+^"
5957defaultHotkeysArray["autoImprison"] := "~#"
5958defaultHotkeysArray["imprison"] := "~Numpad8"
5959defaultHotkeysArray["arrestSlots"] := "!#"
5960defaultHotkeysArray["resetArrestSlots"] := "F9"
5961defaultHotkeysArray["arrest"] := "~Numpad7"
5962defaultHotkeysArray["uncuff"] := "~U"
5963defaultHotkeysArray["check"] := "~K"
5964defaultHotkeysArray["askCheck"] := "~2"
5965defaultHotkeysArray["openTrunk"] := "^K"
5966defaultHotkeysArray["checkTrunk"] := "~^L"
5967defaultHotkeysArray["askTrunkOpen"] := "~ß"
5968defaultHotkeysArray["tempomat"] := "~."
5969defaultHotkeysArray["jobexecute"] := "~J"
5970defaultHotkeysArray["askPapers"] := "~3"
5971defaultHotkeysArray["cooperation"] := "~4"
5972defaultHotkeysArray["getOutOfCar"] := "~5"
5973defaultHotkeysArray["stayInCar"] := "~^5"
5974defaultHotkeysArray["arrestedCar"] := "~6"
5975defaultHotkeysArray["arrestedFoot"] := "~7"
5976defaultHotkeysArray["putWeaponsAway"] := "~I"
5977defaultHotkeysArray["grab"] := "~9"
5978defaultHotkeysArray["ungrab"] := "~^9"
5979defaultHotkeysArray["togCellphone"] := "!F1"
5980defaultHotkeysArray["eatFish"] := "F2"
5981defaultHotkeysArray["firstAid"] := "F3"
5982defaultHotkeysArray["countdown"] := "~End"
5983defaultHotkeysArray["stopwatch"] := "~`,"
5984defaultHotkeysArray["stopAutomaticSystems"] := "~<"
5985defaultHotkeysArray["openDoor"] := "~NumpadSub"
5986defaultHotkeysArray["openCustoms"] := "!NumpadSub"
5987defaultHotkeysArray["closeCustomsControl"] := "~sc135"
5988defaultHotkeysArray["openCustomsControl"] := "!sc135"
5989defaultHotkeysArray["govClosedCustoms"] := "~NumpadMult"
5990defaultHotkeysArray["govOpenedCustoms"] := "!NumpadMult"
5991defaultHotkeysArray["ram"] := "~8"
5992defaultHotkeysArray["pause"] := "~Pause"
5993IfNotExist, Hotkeys.ini
5994{
5995for key, value in defaultHotkeysArray {
5996IniWrite, %value%, Hotkeys.ini, Hotkeys, %key%
5997}
5998}
5999for key, value in defaultHotkeysArray {
6000IniRead, hk, Hotkeys.ini, Hotkeys, %key%, %A_Space%
6001if (!hk) {
6002alreadyRegistered := false
6003for k, v in registeredHotkeys {
6004hk2 := StrReplace(value, "~", "")
6005v2 := StrReplace(v, "~", "")
6006if (hk2 = v2 && StrLen(hk2) == StrLen(v2)) {
6007alreadyRegistered := true
6008alreadyRegisteredKey := k
6009alreadyRegisteredValue := v
6010break
6011}
6012}
6013if (!alreadyRegistered) {
6014Hotkey, %value%, %key%Label
6015StringReplace, %key%NoMods, value, ~
6016registeredHotkeys[key] := value
6017} else {
6018FileAppend, [%time%] Der Standard-Hotkey für %key% (%value%) ist bereits registriert (%alreadyRegisteredKey% - %alreadyRegisteredValue%)!`n, log.txt
6019}
6020} else if (hk != "---") {
6021alreadyRegistered := false
6022for k, v in registeredHotkeys {
6023hk2 := StrReplace(hk, "~", "")
6024v2 := StrReplace(v, "~", "")
6025if (hk2 = v2 && StrLen(hk2) == StrLen(v2)) {
6026alreadyRegistered := true
6027alreadyRegisteredKey := k
6028alreadyRegisteredValue := v
6029break
6030}
6031}
6032if (!alreadyRegistered) {
6033Hotkey, %hk%, %key%Label
6034StringReplace, %key%NoMods, hk, ~
6035registeredHotkeys[key] := hk
6036} else {
6037FileAppend, [%time%] Der Hotkey für %key% (%hk%) ist bereits registriert (%alreadyRegisteredKey% - %alreadyRegisteredValue%)!`n, log.txt
6038}
6039}
6040}
6041global ownHotkeyCount := 48
6042Loop, %ownHotkeyCount% {
6043outerIndex := A_Index
6044IniRead, ownHotkey%outerIndex%Active, ownhotkeys.ini, %outerIndex%, Active, 0
6045IniRead, ownHotkey%outerIndex%Text, ownhotkeys.ini, %outerIndex%, Text, %A_Space%
6046IniRead, hk, ownhotkeys.ini, %outerIndex%, Hotkey, %A_Space%
6047ownHotkey%outerIndex%Text := StrReplace(ownHotkey%outerIndex%Text, "~", "`n")
6048if (hk) {
6049alreadyRegistered := false
6050for key, value in registeredHotkeys {
6051hk2 := StrReplace(hk, "~", "")
6052value2 := StrReplace(value, "~", "")
6053if (hk2 = value2 && StrLen(hk2) == StrLen(value2)) {
6054alreadyRegistered := true
6055alreadyRegisteredKey := key
6056alreadyRegisteredValue := value
6057break
6058}
6059}
6060StringReplace, ownHotkey%outerIndex%NoMods, hk, ~
6061if (!alreadyRegistered) {
6062if (ownHotkey%outerIndex%Active) {
6063Hotkey, %hk%, ownHotkey%outerIndex%Label
6064registeredHotkeys["ownHotkey" . outerIndex] := hk
6065}
6066} else {
6067FileAppend, [%time%] Der Hotkey für ownHotkey%outerIndex% (%hk%) ist bereits registriert (%alreadyRegisteredKey% - %alreadyRegisteredValue%)!`n, log.txt
6068}
6069}
6070}
6071IfNotExist, images
6072{
6073FileCreateDir, images
6074}
6075IfNotExist, images\Banner-%projectName%.png
6076{
6077URLDownloadToFile, %baseURL%downloads/Banner-%projectName%.png, Banner-%projectName%.png
6078FileMove, Banner-%projectName%.png, images\Banner-%projectName%.png
6079}
6080IfNotExist, bin
6081{
6082FileCreateDir, bin
6083}
6084IfNotExist, bin\overlay.dll
6085{
6086URLDownloadToFile, %baseURL%downloads/bin/overlay.dll, bin\overlay.dll
6087}
6088#NoEnv
6089API_ERROR_NONE := 0
6090API_ERROR_SNAPSHOT_FAILED := 1
6091API_ERROR_SAMP_NOT_FOUND := 2
6092API_ERROR_REMOTE_MEMORY_ALLOCATION_FAILED := 3
6093API_ERROR_WRITEPROCESSMEMORY_FAILED := 4
6094API_ERROR_GETPROCADDRESS_FAILED := 5
6095API_ERROR_REMOTETHREAD_FAILED := 6
6096API_ERROR_INVALID_GTA_HANDLE := 7
6097API_ERROR_PIPE_DOESNT_RESPOND := 8
6098API_ERROR_STRING_TOO_LONG := 9
6099PATH_API := RelToAbs(A_ScriptDir, "bin\overlay.dll")
6100dllModule := DllCall("LoadLibrary", Str, PATH_API)
6101if(dllModule == -1 || dllModule == 0)
6102{
6103MsgBox, 48, API - Fehler, Die overlay.dll konnte nicht gefunden werden.`nDer Keybinder wird nun beendet.
6104ExitApp
6105}
6106Init_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_Init")
6107SetParam_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_SetParam")
6108ReadMemory_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ReadMemory")
6109WriteMemory_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_WriteMemory")
6110GetBasePointer_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_GetBasePointer")
6111GetCommandLine_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_GetCommandLine")
6112GetLastError_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_GetLastError")
6113SetLastError_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_SetLastError")
6114TextCreate_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextCreate")
6115TextDestroy_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextDestroy")
6116TextSetShadow_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetShadow")
6117TextSetShown_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetShown")
6118TextSetColor_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetColor")
6119TextSetPos_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetPos")
6120TextSetString_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetString")
6121TextUpdate_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextUpdate")
6122BoxCreate_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxCreate")
6123BoxDestroy_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxDestroy")
6124BoxSetShown_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetShown")
6125BoxSetBorder_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetBorder")
6126BoxSetBorderColor_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetBorderColor")
6127BoxSetColor_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetColor")
6128BoxSetHeight_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetHeight")
6129BoxSetPos_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetPos")
6130BoxSetWidth_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetWidth")
6131LineCreate_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineCreate")
6132LineDestroy_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineDestroy")
6133LineSetShown_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetShown")
6134LineSetColor_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetColor")
6135LineSetWidth_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetWidth")
6136LineSetPos_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetPos")
6137ImageCreate_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageCreate")
6138ImageDestroy_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageDestroy")
6139ImageSetShown_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetShown")
6140ImageSetAlign_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetAlign")
6141ImageSetPos_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetPos")
6142ImageSetRotation_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetRotation")
6143DestroyAllVisual_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_DestroyAllVisual")
6144ShowAllVisual_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ShowAllVisual")
6145HideAllVisual_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_HideAllVisual")
6146Init()
6147{
6148global Init_func
6149res := DllCall(Init_func)
6150return res
6151}
6152SetParam(str_Name, str_Value)
6153{
6154global SetParam_func
6155res := DllCall(SetParam_func, Str, str_Name, Str, str_Value)
6156return res
6157}
6158ReadMemory(addr, size, ByRef data)
6159{
6160global ReadMemory_func
6161VarSetCapacity(data,size)
6162res := DllCall(ReadMemory_func, UInt, addr, UInt, size, StrP, data)
6163return res
6164}
6165GetBasePointer(dll)
6166{
6167global GetBasePointer_func
6168res :=DllCall(GetBasePointer_func, Str, dll)
6169return res
6170}
6171GetCommandLine(ByRef line)
6172{
6173global GetCommandLine_func
6174VarSetCapacity(line,512,0)
6175res := DllCall(GetCommandLine_func, StrP, line)
6176return res
6177}
6178GetLastError()
6179{
6180global GetLastError_func
6181res:=DllCall(GetLastError_func)
6182return res
6183}
6184SetLastError(error)
6185{
6186global SetLastError_func
6187res := DllCall(SetLastError_func, Int, error)
6188return res
6189}
6190TextCreate(Font, fontsize, bold, italic, x, y, color, text, shadow, show)
6191{
6192global TextCreate_func
6193res := DllCall(TextCreate_func,Str,Font,Int,fontsize,UChar,bold,UChar,italic,Int,x,Int,y,UInt,color,Str,text,UChar,shadow,UChar,show)
6194return res
6195}
6196TextDestroy(id)
6197{
6198global TextDestroy_func
6199res := DllCall(TextDestroy_func,Int,id)
6200return res
6201}
6202TextSetShadow(id, shadow)
6203{
6204global TextSetShadow_func
6205res := DllCall(TextSetShadow_func,Int,id,UChar,shadow)
6206return res
6207}
6208TextSetShown(id, show)
6209{
6210global TextSetShown_func
6211res := DllCall(TextSetShown_func,Int,id,UChar,show)
6212return res
6213}
6214TextSetColor(id,color)
6215{
6216global TextSetColor_func
6217res := DllCall(TextSetColor_func,Int,id,UInt,color)
6218return res
6219}
6220TextSetPos(id,x,y)
6221{
6222global TextSetPos_func
6223res := DllCall(TextSetPos_func,Int,id,Int,x,Int,y)
6224return res
6225}
6226TextSetString(id,Text)
6227{
6228global TextSetString_func
6229res := DllCall(TextSetString_func,Int,id,Str,Text)
6230return res
6231}
6232TextUpdate(id,Font,Fontsize,bold,italic)
6233{
6234global TextUpdate_func
6235res := DllCall(TextUpdate_func,Int,id,Str,Font,int,Fontsize,UChar,bold,UChar,italic)
6236return res
6237}
6238BoxCreate(x,y,width,height,Color,show)
6239{
6240global BoxCreate_func
6241res := DllCall(BoxCreate_func,Int,x,Int,y,Int,width,Int,height,UInt,Color,UChar,show)
6242return res
6243}
6244BoxDestroy(id)
6245{
6246global BoxDestroy_func
6247res := DllCall(BoxDestroy_func,Int,id)
6248return res
6249}
6250BoxSetShown(id,Show)
6251{
6252global BoxSetShown_func
6253res := DllCall(BoxSetShown_func,Int,id,UChar,Show)
6254return res
6255}
6256BoxSetBorder(id,height,Show)
6257{
6258global BoxSetBorder_func
6259res := DllCall(BoxSetBorder_func,Int,id,Int,height,Int,Show)
6260return res
6261}
6262BoxSetBorderColor(id,Color)
6263{
6264global BoxSetBorderColor_func
6265res := DllCall(BoxSetBorderColor_func,Int,id,UInt,Color)
6266return res
6267}
6268BoxSetColor(id,Color)
6269{
6270global BoxSetColor_func
6271res := DllCall(BoxSetColor_func,Int,id,UInt,Color)
6272return res
6273}
6274BoxSetHeight(id,height)
6275{
6276global BoxSetHeight_func
6277res := DllCall(BoxSetHeight_func,Int,id,Int,height)
6278return res
6279}
6280BoxSetPos(id,x,y)
6281{
6282global BoxSetPos_func
6283res := DllCall(BoxSetPos_func,Int,id,Int,x,Int,y)
6284return res
6285}
6286BoxSetWidth(id,width)
6287{
6288global BoxSetWidth_func
6289res := DllCall(BoxSetWidth_func,Int,id,Int,width)
6290return res
6291}
6292LineCreate(x1,y1,x2,y2,width,color,show)
6293{
6294global LineCreate_func
6295res := DllCall(LineCreate_func,Int,x1,Int,y1,Int,x2,Int,y2,Int,Width,UInt,color,UChar,show)
6296return res
6297}
6298LineDestroy(id)
6299{
6300global LineDestroy_func
6301res := DllCall(LineDestroy_func,Int,id)
6302return res
6303}
6304LineSetShown(id,show)
6305{
6306global LineSetShown_func
6307res := DllCall(LineSetShown_func,Int,id,UChar,show)
6308return res
6309}
6310LineSetColor(id,color)
6311{
6312global LineSetColor_func
6313res := DllCall(LineSetColor_func,Int,id,UInt,color)
6314return res
6315}
6316LineSetWidth(id, width)
6317{
6318global LineSetWidth_func
6319res := DllCall(LineSetWidth_func,Int,id,Int,width)
6320return res
6321}
6322LineSetPos(id,x1,y1,x2,y2)
6323{
6324global LineSetPos_func
6325res := DllCall(LineSetPos_func,Int,id,Int,x1,Int,y1,Int,x2,Int,y2)
6326return res
6327}
6328ImageCreate(path, x, y, rotation, align, show)
6329{
6330global ImageCreate_func
6331res := DllCall(ImageCreate_func, Str, path, Int, x, Int, y, Int, rotation, Int, align, UChar, show)
6332return res
6333}
6334ImageDestroy(id)
6335{
6336global ImageDestroy_func
6337res := DllCall(ImageDestroy_func,Int,id)
6338return res
6339}
6340ImageSetShown(id,show)
6341{
6342global ImageSetShown_func
6343res := DllCall(ImageSetShown_func,Int,id,UChar,show)
6344return res
6345}
6346ImageSetAlign(id,align)
6347{
6348global ImageSetAlign_func
6349res := DllCall(ImageSetAlign_func,Int,id,Int,align)
6350return res
6351}
6352ImageSetPos(id, x, y)
6353{
6354global ImageSetPos_func
6355res := DllCall(ImageSetPos_func,Int,id,Int,x, Int, y)
6356return res
6357}
6358ImageSetRotation(id, rotation)
6359{
6360global ImageSetRotation_func
6361res := DllCall(ImageSetRotation_func,Int,id,Int, rotation)
6362return res
6363}
6364DestroyAllVisual()
6365{
6366global DestroyAllVisual_func
6367res := DllCall(DestroyAllVisual_func)
6368return res
6369}
6370ShowAllVisual()
6371{
6372global ShowAllVisual_func
6373res := DllCall(ShowAllVisual_func)
6374return res
6375}
6376HideAllVisual()
6377{
6378global HideAllVisual_func
6379res := DllCall(HideAllVisual_func )
6380return res
6381}
6382DecimalToHex(Var){
6383SetFormat, IntegerFast, hex
6384Dec2Hex += Var
6385Dec2Hex .= ""
6386SetFormat, IntegerFast, d
6387StringTrimLeft, Dec2Hex, Dec2Hex, 2
6388StringUpper, Dec2Hex, Dec2Hex
6389sDec2Hex .= Dec2Hex
6390return sDec2Hex
6391}
6392RelToAbs(root, dir, s = "\") {
6393pr := SubStr(root, 1, len := InStr(root, s, "", InStr(root, s . s) + 2) - 1)
6394, root := SubStr(root, len + 1), sk := 0
6395If InStr(root, s, "", 0) = StrLen(root)
6396StringTrimRight, root, root, 1
6397If InStr(dir, s, "", 0) = StrLen(dir)
6398StringTrimRight, dir, dir, 1
6399Loop, Parse, dir, %s%
6400{
6401If A_LoopField = ..
6402StringLeft, root, root, InStr(root, s, "", 0) - 1
6403Else If A_LoopField =
6404root =
6405Else If A_LoopField != .
6406Continue
6407StringReplace, dir, dir, %A_LoopField%%s%
6408}
6409Return, pr . root . s . dir
6410}
6411SetParam("use_window", "1")
6412SetParam("window", "GTA:SA:MP")
6413IniRead, lockSystem, settings.ini, Einstellungen, Locksystem, 1
6414IniRead, motorSystem, settings.ini, Einstellungen, Motorsystem, 1
6415IniRead, takeSystem, settings.ini, Einstellungen, Takesystem, 1
6416IniRead, autoWanteds, settings.ini, Einstellungen, AutoWanteds, 1
6417IniRead, fillSystem, settings.ini, Einstellungen, Tanksystem, 1
6418IniRead, customsSystem, settings.ini, Einstellungen, Zollsystem, 1
6419IniRead, lottoSystem, settings.ini, Einstellungen, Lottosystem, 1
6420IniRead, lottoNumber, settings.ini, Einstellungen, Lottozahl, 0
6421IniRead, chatlogSaver, settings.ini, Einstellungen, Chatlog, 1
6422IniRead, admin, settings.ini, Einstellungen, Admin, 0
6423IniRead, showTasks, settings.ini, Einstellungen, TasksAnzeigen, 1
6424IniRead, primaryColor, settings.ini, Einstellungen, Primärfarbe, %A_Space%
6425IniRead, secondaryColor, settings.ini, Einstellungen, Sekundärfarbe, %A_Space%
6426IniRead, antispamSystem, settings.ini, Einstellungen, Antispamsystem, 1
6427IniRead, statsFormatted, settings.ini, Einstellungen, StatistikFormatiert, 1
6428IniRead, autoFindLastEscapee, settings.ini, Einstellungen, LetztenFluechtigenFinden, 0
6429IniRead, fishMode, settings.ini, Einstellungen, FischModus, 0
6430IniRead, department, settings.ini, Einstellungen, Abteilung, %A_Space%
6431IniRead, ownPrefix, settings.ini, Einstellungen, OwnPrefix, %A_Space%
6432IniRead, autoUncuff, settings.ini, Einstellungen, AutoUncuff, 1
6433IniRead, maxKMH, settings.ini, Einstellungen, MaxKMH, 0
6434IniRead, taxes, settings.ini, Steuern, Steuersatz, 1
6435IniRead, packetMessages, settings.ini, Einstellungen, PaketNachrichten, 1
6436IniRead, paintballMessages, settings.ini, Einstellungen, PaintballNachrichten, 1
6437IniRead, partnerMessages, settings.ini, Einstellungen, PartnerNachrichten, 1
6438IniRead, friendMessages, settings.ini, Einstellungen, FreundeNachrichten, 1
6439IniRead, job, settings.ini, Job, Job, %A_Space%
6440IniRead, jobLine, settings.ini, Job, Linie, %A_Space%
6441IniRead, busRestartLine, settings.ini, Job, BusLinieAutoNeustart, 1
6442IniRead, busSendToJobChat, settings.ini, Job, BusSendJobChat, 0
6443IniRead, jobWeapondealerSkill, settings.ini, Job, Waffendealerskill, %A_Space%
6444IniRead, jobDetectiveSkill, settings.ini, Job, Detektivskill, %A_Space%
6445IniRead, alternativePlayerInput, settings.ini, Einstellungen, AltPlayerInput, %A_Space%
6446if (alternativePlayerInput == "") {
6447alternativePlayerInput := false
6448IniWrite, %alternativePlayerInput%, settings.ini, Einstellungen, AltPlayerInput
6449}
6450IniRead, debug, settings.ini, Einstellungen, Debug, %A_Space%
6451if (debug == "") {
6452debug := false
6453IniWrite, %debug%, settings.ini, Einstellungen, Debug
6454}
6455Loop, 3 {
6456profileID := A_Index
6457Loop, 6 {
6458IniRead, profile%profileID%_%A_Index%, settings.ini, Ausrüstungsprofile, Profil%profileID%_%A_Index%, %A_Space%
6459}
6460}
6461IniRead, ucSkin, settings.ini, Ausrüstungsprofile, UCSkin, 0
6462IniRead, armour, settings.ini, Ausrüstungsprofile, Schutzweste, 0
6463primaryColor := StrReplace(primaryColor, "{", "")
6464primaryColor := StrReplace(primaryColor, "}", "")
6465secondaryColor := StrReplace(secondaryColor, "{", "")
6466secondaryColor := StrReplace(secondaryColor, "}", "")
6467if (primaryColor == "") {
6468primaryColor := "0033FF"
6469}
6470if (secondaryColor == "") {
6471secondaryColor := "FF9900"
6472}
6473global PRIMCOL := "{" . primaryColor . "}"
6474global SECCOL := "{" . secondaryColor . "}"
6475global PREFIX := "{FFFFFF}|" . PRIMCOL . projectName . "{FFFFFF}| "
6476if (ownPrefix != "") {
6477PREFIX := ownPrefix . " "
6478}
6479IniRead, statsOverlayContent, settings.ini, StatsOverlay, Content, %A_Space%
6480IniRead, statsOverlayAutostart, settings.ini, StatsOverlay, Autostart, 0
6481IniRead, statsOverlayPosX, settings.ini, StatsOverlay, PosX, 20
6482IniRead, statsOverlayPosY, settings.ini, StatsOverlay, PosY, 215
6483IniRead, statsOverlayColors, settings.ini, StatsOverlay, Colors, 1
6484IniRead, statsOverlayItalic, settings.ini, StatsOverlay, Italic, 0
6485IniRead, statsOverlayFont, settings.ini, StatsOverlay, Font, Arial
6486IniRead, statsOverlayFontSize, settings.ini, StatsOverlay, FontSize, 7
6487IniRead, statsOverlayBold, settings.ini, StatsOverlay, Bold, 1
6488IniRead, statsOverlayColor, settings.ini, StatsOverlay, Color, FFFFFF
6489if (statsOverlayContent == "") {
6490statsOverlayContent := "[white]Name: [primcol][name][white], ID: [primcol][id]~[white]HP: [primcol][hp][white], Ping: [primcol][ping]~[white]Standort: [primcol][zone][white], [primcol][city]~[white]Datum: [primcol][date]~[white]Wantedvergaben: [primcol][wanteds]~[white]Punktevergaben: [primcol][points]~[white]Kontrollen: [primcol][checks]~[white]Tazer-Benutzungen: [primcol][tazer]~[white]Radarkontrollen: [primcol][radar]~[white]Verbrecher eingesperrt: [primcol][arrests]~[white]Verbrecher getoetet: [primcol][kills]~[white]Death-Arrests/Prison: [primcol][deatharrests] [white]/ [primcol][deathprison]~[white]Offline-Arrests/Prison: [primcol][offlinearrests] [white]/ [primcol][offlineprison]~[white]Geld durch Verhaftungen: [primcol][arrestmoney]$~[white]Geld durch Tickets: [primcol][ticketmoney]$~[white]Geld durch Fischen: [primcol][fishmoney]$~[white]Gesamtgeld: [primcol][totalmoney]$~[white]Marihuana zerstört: [primcol][marihuana]~[white]Drogen/Samen: [primcol][drugs] [white]/ [primcol][seeds]~[white]Du kannst wieder fischen in: [primcol][fishtime]~[white]Distanz zum Checkpoint: [primcol][checkpoint]~[white]Payday: [primcol][pdmoney]$ [white]([primcol][pdmoneynetto]$[white])~[white]Find: [primcol][find]~[white]Partner: [primcol][partners]~[motor]~[lock]~[light]"
6491IniWrite, %statsOverlayContent%, settings.ini, StatsOverlay, Content
6492}
6493statsOverlayContent := StrReplace(statsOverlayContent, "~", "`n")
6494statsOverlayPrimColor := SECCOL
6495statsOverlaySecColor := "{" . statsOverlayColor . "}"
6496statsOverlayPositiveColor := "{00FF00}"
6497statsOverlayNegativeColor := "{FF0000}"
6498IniRead, mdcOverlayAutostart, settings.ini, MDCOverlay, Autostart, 0
6499IniRead, mdcOverlayPosX, settings.ini, MDCOverlay, PosX, 495
6500IniRead, mdcOverlayPosY, settings.ini, MDCOverlay, PosY, 405
6501IniRead, mdcOverlayColors, settings.ini, MDCOverlay, Colors, 1
6502IniRead, mdcOverlayItalic, settings.ini, MDCOverlay, Italic, 0
6503IniRead, mdcOverlayLines, settings.ini, MDCOverlay, Lines, 15
6504IniRead, mdcOverlayFont, settings.ini, MDCOverlay, Font, Courier New
6505IniRead, mdcOverlayFontSize, settings.ini, MDCOverlay, FontSize, 7
6506IniRead, mdcOverlayBold, settings.ini, MDCOverlay, Bold, 1
6507IniRead, mdcOverlayColor, settings.ini, MDCOverlay, Color, 0174DF
6508IniRead, mdcOverlayBoxEnabled, settings.ini, MDCOverlay, Box, 1
6509mdcOverlayPrimColor := "{" . mdcOverlayColor . "}"
6510mdcOverlaySecColor := "{FFFFFF}"
6511mdcOverlayBackupColor := "{FF8000}"
6512mdcOverlayStoreRobColor := "{F4F442}"
6513statsOverlayEnabled := false
6514mdcOverlayEnabled := false
6515if (statsOverlayAutostart) {
6516createOverlay(1)
6517statsOverlayEnabled := true
6518}
6519if (mdcOverlayAutostart) {
6520createOverlay(2)
6521mdcOverlayEnabled := true
6522}
6523global mdc := []
6524global tasks := []
6525global partners := []
6526global arrestList := []
6527global wantedTickets := []
6528global checkingPlayers := []
6529global totalArrestMoney := 0
6530if (department == "") {
6531department := projectName
6532}
6533global watermode := false
6534global airmode := false
6535global deathArrested := false
6536global lastSpeed := 0
6537global lastSpeedUser := ""
6538global lastTicketReason := ""
6539global lastTicketPlayer := ""
6540global currentTicket := 1
6541global maxTickets := 1
6542global currentTicketMoney = 0
6543global tv := false
6544global tvName := ""
6545global oldHour := -1
6546global fishTime := 0
6547global timeout := true
6548global pbKillStreak := 0
6549global paydayMoney := 0
6550global pedStates := {}
6551global tempo := 80
6552global tempomat := false
6553global currentSpeed := 0
6554global currentFish := 1
6555global fishTraps := []
6556global fishingFull := false
6557global showNamechanges := false
6558global showFriendLabels := true
6559global onlinePlayers := []
6560global onlineFriends := []
6561global firstFriendsTimerRun := true
6562global gasstations := []
6563global countdownRunning := false
6564global autoFindRunning := false
6565global autoShowRunning := false
6566global statsFormat := "Personalien:\tGeschlecht: (\S+)\n\t\tPartner: (\S+)\n\n\t\tLevel: (\d+)\n\t\tRespekt: (\d+)\/(\d+)\n\t\tPayday: (\d+)\/(\d+) Minuten\n\nBerufe:\t\tFraktion: (.+)\tRang: (\d+)\n\t\tNebenjob: (\S+)\n\t\tCrew: (.+)\n\nFinanzen:\tBargeld: (\d+)\$\n\t\tKonto: (\d+)\$\n\t\tFestgeld: (\d+)\$\tZinssatz: (\d+)\.(\d+)\n\nStatistik:\tMorde: (\d+)\n\t\tGestorben: (\d+)\n\t\tVerbrechen: (\d+)\n\t\tSpielzeit: (\d+)h\n\t\tKnast: (\d+)\n\t\tWanteds: (\d+)\n\t\tVerwarnungen: (\d+)\/(\d+)\n\nInventar:\tMaterialien: (\d+) \(Safe: (\d+)\)\n\t\tDrogen: (\d+)g \(Safe: (\d+)g\)\n\t\tHandy \(Nr\. (\d+)\)(\n\t\tErste-Hilfe-Paket)?(\n\t\tBenzin Kanister)?\n\nSkills:\t\tWaffendealer: (\d+) \((\d+)\)\n\t\tDrogendealer: (\d+) \((\d+)\)\n\t\tAngler: (\d+)\n\t\tBusfahrer: (\d+)\t\tExp: (\d+)\/(\d+)\n\t\tAnwalt: (\d+)\t\tExp: (\d+)\n\t\tDetektiv: (\d+)\t\tExp: (\d+)\n\t\tPilot: (\d+)\n\t\tHochseefischer: (\d+)\n\t\tFarmer: (\d+)(\n\n\n{(\S+)}(\S+)( \(noch (.+)\))?)?"
6567SetTimer, ChatTimer, 100
6568SetTimer, TankTimer, 100
6569SetTimer, UncuffTimer, 100
6570SetTimer, FillCustoms, 500
6571SetTimer, HealTimer, 500
6572SetTimer, ChatlogSaveTimer, 500
6573SetTimer, LottoTimer, 1000
6574SetTimer, TempoTimer, 100
6575SetTimer, KillTimer, 100
6576SetTimer, TaskCheckTimer, 5000
6577SetTimer, FriendsTimer, 1000
6578SetTimer, GasstationsTimer, 500
6579Gui, Color, white
6580Gui, Font, S10 CDefault, Verdana
6581Gui, Add, Picture, x10 y-5 w600 h225, images\Banner-%projectName%.png
6582Gui, Add, Button, x320 y230 w140 h40 gSettingsGUI, Einstellungen
6583Gui, Add, Button, x470 y230 w140 h40 gHotkeysGUI, Hotkeys
6584Gui, Add, Button, x320 y280 w140 h40 gNewsGUI, News
6585Gui, Add, Button, x470 y280 w140 h40 gHelpGUI, Hilfe
6586Gui, Add, Button, x320 y330 w140 h40 gControlPanel, Control Panel
6587Gui, Add, Button, x470 y330 w140 h40 gSupport, Fehler melden
6588Gui, Add, Button, x320 y380 w140 h40 gTeamSpeak, %projectName% - TS
6589Gui, Add, Button, x470 y380 w140 h40 gRPGConnect, RPG Connect
6590Gui, Add, Button, x470 y450 w140 h40 gGuiClose, Schließen
6591Gui, Add, Groupbox, x10 y220 w300 h270, Neuigkeiten (Version %version%)
6592msg := URLDownloadToVar(baseURL . "api/getupdatelog?version=" . version . "&username=" . username . "&password=" . password)
6593StringReplace, update, msg, ', `r`n, All
6594Gui, Add, Edit, x20 y240 w280 h240 ReadOnly, %update%
6595Gui, Add, Groupbox, x320 y425 w140 h65, Versionsinfos
6596Gui, Add, Text, x330 y445 w120 h20, Overlay aktiv
6597Gui, Add, Text, x330 y465 w120 h20, User-Version
6598Gui, Show, w620 h500, %projectName% - Version: %version%
6599}
6600return
6601GuiClose:
6602{
6603if (statsOverlayEnabled) {
6604TextDestroy(statsOverlay)
6605}
6606if (mdcOverlayEnabled) {
6607if (mdcOverlayBoxEnabled) {
6608BoxDestroy(mdcBox)
6609}
6610TextDestroy(mdcHeader)
6611TextDestroy(mdcText)
6612}
6613for friendName, textLabelID in onlineFriends {
6614if (textLabelID != -1) {
6615deleteTextLabel(textLabelID)
6616}
6617}
6618for playerName, textLabelID in onlinePlayers {
6619if (textLabelID != -1) {
6620deleteTextLabel(textLabelID)
6621}
6622}
6623logoutResult := URLDownloadToVar(baseURL . "api/keybinder.php?type=logout&username=" . username . "&password=" . password . "&version=" . version)
6624FormatTime, time, , dd.MM.yyyy HH:mm:ss
6625FileAppend, [%time%] Logoutergebnis: %logoutResult%`n, log.txt
6626SQLiteDB.CloseDB()
6627ExitApp
6628}
6629return
6630TeamSpeak:
6631{
6632teamspeak := URLDownloadToVar(baseURL . "api/getsetting?key=teamspeak")
6633run, ts3server://%teamspeak%
6634}
6635return
6636Support:
6637{
6638Run, %baseURL%feedback
6639}
6640return
6641ControlPanel:
6642{
6643Run, %baseURL%
6644}
6645return
6646SettingsGUI:
6647{
6648Gui, Settings: Destroy
6649Gui, Settings: Color, white
6650Gui, Settings: Font, S10 CDefault, Verdana
6651Gui, Settings: Add, Button, x10 y670 w130 h40 gOverlaySettingsGUI, Overlay
6652Gui, Settings: Add, Button, x340 y670 w130 h40 gSettingsSave, Speichern
6653Gui, Settings: Add, Button, x480 y670 w130 h40 gSettingsGuiClose, Schließen
6654Gui, Settings: Add, GroupBox, x10 y10 w600 h230, Allgemeine Einstellungen
6655Gui, Settings: Add, CheckBox, x20 y30 w170 h20 vlockSystem Checked%lockSystem%, Locksystem
6656Gui, Settings: Add, CheckBox, x20 y60 w170 h20 vmotorSystem Checked%motorSystem%, Motor aus bei "F"
6657Gui, Settings: Add, CheckBox, x20 y90 w170 h20 vfillSystem Checked%fillSystem%, Tanksystem
6658Gui, Settings: Add, CheckBox, x20 y120 w170 h20 vlottoSystem Checked%lottoSystem%, Lottosystem
6659Gui, Settings: Add, CheckBox, x20 y150 w170 h20 vantispamSystem Checked%antispamSystem%, Spamschutz-System
6660Gui, Settings: Add, CheckBox, x20 y180 w370 h20 vautoUncuff Checked%autoUncuff%, Verbr. automatisch entcuffen, wenn das Auto brennt
6661Gui, Settings: Add, CheckBox, x20 y210 w170 h20 vstatsFormatted Checked%statsFormatted%, Statistik formatiert
6662Gui, Settings: Add, CheckBox, x190 y30 w200 h20 vtakeSystem Checked%takeSystem%, Gegenst. autom. taken
6663Gui, Settings: Add, CheckBox, x190 y60 w200 h20 vautoWanteds Checked%autoWanteds%, Autom. Wanteds geben
6664Gui, Settings: Add, CheckBox, x190 y90 w200 h20 vcustomsSystem Checked%customsSystem%, Zollsystem
6665Gui, Settings: Add, Text, x190 y120 w150 h20, Lottozahl (0 = zufällig)
6666Gui, Settings: Add, Edit, x350 y120 w40 h20 vlottoNumber, %lottoNumber%
6667Gui, Settings: Add, CheckBox, x190 y150 w200 h20 vautoFindLastEscapee Checked%autoFindLastEscapee%, Letzten Flüchtigen finden
6668Gui, Settings: Add, CheckBox, x190 y210 w410 h20 vfishMode Checked%fishMode%, Fisch mit dem geringsten $-Wert wegwerfen
6669Gui, Settings: Add, CheckBox, x400 y30 w110 h20 vchatlogSaver Checked%chatlogSaver%, Chatlog-Save
6670Gui, Settings: Add, CheckBox, x530 y30 w70 h20 vadmin Checked%admin%, Admin
6671Gui, Settings: Add, CheckBox, x400 y60 w200 h20 vshowTasks Checked%showTasks%, Neue Tasks im Chat anzeig.
6672Gui, Settings: Add, Text, x400 y90 w110 h20, Primärfarbe
6673Gui, Settings: Add, Edit, x530 y90 w70 h20 vprimaryColor, %primaryColor%
6674Gui, Settings: Add, Text, x400 y120 w110 h20, Sekundärfarbe
6675Gui, Settings: Add, Edit, x530 y120 w70 h20 vsecondaryColor, %secondaryColor%
6676Gui, Settings: Add, Text, x400 y150 w110 h20, Abteilung
6677Gui, Settings: Add, Edit, x530 y150 w70 h20 vdepartment, %department%
6678Gui, Settings: Add, Text, x400 y180 w110 h20, Eigener Prefix
6679Gui, Settings: Add, Edit, x530 y180 w70 h20 vownPrefix, %ownPrefix%
6680Gui, Settings: Add, GroupBox, x10 y250 w600 h80, Verschiedene Meldungen
6681Gui, Settings: Add, CheckBox, x20 y270 w150 h20 vpacketMessages checked%packetMessages%, Paket-Nachrichten
6682Gui, Settings: Add, CheckBox, x190 y270 w170 h20 vpaintballMessages checked%paintballMessages%, Paintball-Nachrichten
6683Gui, Settings: Add, CheckBox, x400 y270 w200 h20 vpartnerMessages checked%partnerMessages%, Partner-Nachrichten (/d)
6684Gui, Settings: Add, CheckBox, x20 y300 w160 h20 vfriendMessages checked%friendMessages%, Freunde-Nachrichten
6685Gui, Settings: Add, GroupBox, x10 y340 w600 h320, Ausrüstungsprofile
6686Gui, Settings: Add, Text, x20 y360 w580 h115, Hier kannst du dir drei Ausrüsten-Profile zusammenstellen und direkt Ingame abrufen.`nDie ersten beiden Profile sind für den normalen Streifendienst gedacht und können standardmäßig mit F4 bzw. F5 ausgewählt werden.`nIm dritten Profil kann zusätzlich ein UC-Skin gewählt werden und du kannst entscheiden`, ob du mit einer Schutzweste auf Streife gehen möchtest oder nicht.`nDie UC-Ausrüstung kannst du standardmäßig mit F6 auswählen.`nGehealt wirst du aber in jedem Fall.
6687Gui, Settings: Add, GroupBox, x20 y480 w580 h85, Normale Streife
6688Gui, Settings: Add, Text, x30 y500 w70 h20, Profil 1:
6689Gui, Settings: Add, DropDownList, x100 y500 w75 h120 vprofile1_1, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6690Gui, Settings: Add, DropDownList, x183 y500 w75 h120 vprofile1_2, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6691Gui, Settings: Add, DropDownList, x266 y500 w75 h120 vprofile1_3, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6692Gui, Settings: Add, DropDownList, x349 y500 w75 h120 vprofile1_4, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6693Gui, Settings: Add, DropDownList, x432 y500 w75 h120 vprofile1_5, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6694Gui, Settings: Add, DropDownList, x515 y500 w75 h120 vprofile1_6, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6695GuiControl, Settings: Choose, profile1_1, %profile1_1%
6696GuiControl, Settings: Choose, profile1_2, %profile1_2%
6697GuiControl, Settings: Choose, profile1_3, %profile1_3%
6698GuiControl, Settings: Choose, profile1_4, %profile1_4%
6699GuiControl, Settings: Choose, profile1_5, %profile1_5%
6700GuiControl, Settings: Choose, profile1_6, %profile1_6%
6701Gui, Settings: Add, Text, x30 y530 w70 h20 , Profil 2:
6702Gui, Settings: Add, DropDownList, x100 y530 w75 h120 vprofile2_1, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6703Gui, Settings: Add, DropDownList, x183 y530 w75 h120 vprofile2_2, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6704Gui, Settings: Add, DropDownList, x266 y530 w75 h120 vprofile2_3, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6705Gui, Settings: Add, DropDownList, x349 y530 w75 h120 vprofile2_4, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6706Gui, Settings: Add, DropDownList, x432 y530 w75 h120 vprofile2_5, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6707Gui, Settings: Add, DropDownList, x515 y530 w75 h120 vprofile2_6, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6708GuiControl, Settings: Choose, profile2_1, %profile2_1%
6709GuiControl, Settings: Choose, profile2_2, %profile2_2%
6710GuiControl, Settings: Choose, profile2_3, %profile2_3%
6711GuiControl, Settings: Choose, profile2_4, %profile2_4%
6712GuiControl, Settings: Choose, profile2_5, %profile2_5%
6713GuiControl, Settings: Choose, profile2_6, %profile2_6%
6714Gui, Settings: Add, GroupBox, x20 y570 w580 h80 , Undercover-Streife
6715Gui, Settings: Add, Text, x30 y590 w70 h20 , UC-Profil:
6716Gui, Settings: Add, DropDownList, x100 y590 w75 h120 vprofile3_1, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6717Gui, Settings: Add, DropDownList, x183 y590 w75 h120 vprofile3_2, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6718Gui, Settings: Add, DropDownList, x266 y590 w75 h120 vprofile3_3, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6719Gui, Settings: Add, DropDownList, x349 y590 w75 h120 vprofile3_4, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6720Gui, Settings: Add, DropDownList, x432 y590 w75 h120 vprofile3_5, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6721Gui, Settings: Add, DropDownList, x515 y590 w75 h120 vprofile3_6, ||Deagle|Shotgun|MP5|M4|Rifle|Sniper|Schlagstock|Spray
6722GuiControl, Settings: Choose, profile3_1, %profile3_1%
6723GuiControl, Settings: Choose, profile3_2, %profile3_2%
6724GuiControl, Settings: Choose, profile3_3, %profile3_3%
6725GuiControl, Settings: Choose, profile3_4, %profile3_4%
6726GuiControl, Settings: Choose, profile3_5, %profile3_5%
6727GuiControl, Settings: Choose, profile3_6, %profile3_6%
6728Gui, Settings: Add, Text, x70 y620 w110 h20, UC-Skin (1-39):
6729Gui, Settings: Add, Edit, x183 y620 w75 h20 vucSkin, %ucSkin%
6730Gui, Settings: Add, CheckBox, x266 y620 w110 h20 varmour Checked%armour%, Schutzweste
6731Gui, Settings: Show, h720 w620, %projectName% - Einstellungen - Version %version%
6732}
6733return
6734SettingsSave:
6735{
6736Gui, Settings: Submit, NoHide
6737IniWrite, %lockSystem%, settings.ini, Einstellungen, Locksystem
6738IniWrite, %motorSystem%, settings.ini, Einstellungen, Motorsystem
6739IniWrite, %takeSystem%, settings.ini, Einstellungen, Takesystem
6740IniWrite, %autoWanteds%, settings.ini, Einstellungen, AutoWanteds
6741IniWrite, %fillSystem%, settings.ini, Einstellungen, Tanksystem
6742IniWrite, %customsSystem%, settings.ini, Einstellungen, Zollsystem
6743IniWrite, %lottoSystem%, settings.ini, Einstellungen, Lottosystem
6744IniWrite, %lottoNumber%, settings.ini, Einstellungen, Lottozahl
6745IniWrite, %chatlogSaver%, settings.ini, Einstellungen, Chatlog
6746IniWrite, %admin%, settings.ini, Einstellungen, Admin
6747IniWrite, %showTasks%, settings.ini, Einstellungen, TasksAnzeigen
6748IniWrite, %primaryColor%, settings.ini, Einstellungen, Primärfarbe
6749IniWrite, %secondaryColor%, settings.ini, Einstellungen, Sekundärfarbe
6750IniWrite, %antispamSystem%, settings.ini, Einstellungen, Antispamsystem
6751IniWrite, %autoFindLastEscapee%, settings.ini, Einstellungen, LetztenFluechtigenFinden
6752IniWrite, %autoUncuff%, settings.ini, Einstellungen, AutoUncuff
6753IniWrite, %statsFormatted%, settings.ini, Einstellungen, StatistikFormatiert
6754IniWrite, %fishMode%, settings.ini, Einstellungen, FischModus
6755if (department == "") {
6756department := projectName
6757}
6758IniWrite, %department%, settings.ini, Einstellungen, Abteilung
6759IniWrite, %ownPrefix%, settings.ini, Einstellungen, OwnPrefix
6760if (ownPrefix != "") {
6761PREFIX := ownPrefix . " "
6762}
6763IniWrite, %packetMessages%, settings.ini, Einstellungen, PaketNachrichten
6764IniWrite, %paintballMessages%, settings.ini, Einstellungen, PaintballNachrichten
6765IniWrite, %partnerMessages%, settings.ini, Einstellungen, PartnerNachrichten
6766IniWrite, %friendMessages%, settings.ini, Einstellungen, FreundeNachrichten
6767IniWrite, %profile1_1%, settings.ini, Ausrüstungsprofile, Profil1_1
6768IniWrite, %profile1_2%, settings.ini, Ausrüstungsprofile, Profil1_2
6769IniWrite, %profile1_3%, settings.ini, Ausrüstungsprofile, Profil1_3
6770IniWrite, %profile1_4%, settings.ini, Ausrüstungsprofile, Profil1_4
6771IniWrite, %profile1_5%, settings.ini, Ausrüstungsprofile, Profil1_5
6772IniWrite, %profile1_6%, settings.ini, Ausrüstungsprofile, Profil1_6
6773IniWrite, %profile2_1%, settings.ini, Ausrüstungsprofile, Profil2_1
6774IniWrite, %profile2_2%, settings.ini, Ausrüstungsprofile, Profil2_2
6775IniWrite, %profile2_3%, settings.ini, Ausrüstungsprofile, Profil2_3
6776IniWrite, %profile2_4%, settings.ini, Ausrüstungsprofile, Profil2_4
6777IniWrite, %profile2_5%, settings.ini, Ausrüstungsprofile, Profil2_5
6778IniWrite, %profile2_6%, settings.ini, Ausrüstungsprofile, Profil2_6
6779IniWrite, %profile3_1%, settings.ini, Ausrüstungsprofile, Profil3_1
6780IniWrite, %profile3_2%, settings.ini, Ausrüstungsprofile, Profil3_2
6781IniWrite, %profile3_3%, settings.ini, Ausrüstungsprofile, Profil3_3
6782IniWrite, %profile3_4%, settings.ini, Ausrüstungsprofile, Profil3_4
6783IniWrite, %profile3_5%, settings.ini, Ausrüstungsprofile, Profil3_5
6784IniWrite, %profile3_6%, settings.ini, Ausrüstungsprofile, Profil3_6
6785IniWrite, %ucSkin%, settings.ini, Ausrüstungsprofile, UCSkin
6786IniWrite, %armour%, settings.ini, Ausrüstungsprofile, Schutzweste
6787global PRIMCOL := "{" . primaryColor . "}"
6788global SECCOL := "{" . secondaryColor . "}"
6789global PREFIX := "{FFFFFF}|" . PRIMCOL . projectName . "{FFFFFF}| "
6790MsgBox, 64, Speicherung, Alle Eingaben und Daten wurden erfolgreich gespeichert!
6791Gui, Settings: Destroy
6792}
6793return
6794SettingsGuiClose:
6795{
6796Gui, Settings: Destroy
6797}
6798return
6799OverlaySettingsGUI:
6800{
6801Gui, OverlaySettings: Destroy
6802Gui, OverlaySettings: Color, white
6803Gui, OverlaySettings: Font, S10 CDefault, Verdana
6804Gui, OverlaySettings: Add, Button, x10 y670 w160 h40 gOverlaySettingsSave, Speichern
6805Gui, OverlaySettings: Add, Button, x370 y670 w160 h40 gOverlaySettingsGuiClose, Schließen
6806Gui, OverlaySettings: Add, GroupBox, x10 y10 w520 h260, Overlay-Inhalt
6807Gui, OverlaySettings: Add, Edit, x20 y30 w500 h230 vstatsOverlayContent, %statsOverlayContent%
6808Gui, OverlaySettings: Add, GroupBox, x10 y280 w520 h170, Statistik-Overlay Einstellungen
6809Gui, OverlaySettings: Add, Text, x20 y300 w200 h20, Beim Keybinderstart starten:
6810Gui, OverlaySettings: Add, CheckBox, x230 y300 w80 h20 vstatsOverlayAutostart checked%statsOverlayAutostart%, on / off
6811Gui, OverlaySettings: Add, Text, x20 y330 w90 h20, Koordinaten:
6812Gui, OverlaySettings: Add, Text, x130 y330 w10 h20, x
6813Gui, OverlaySettings: Add, Text, x130 y360 w10 h20, y
6814Gui, OverlaySettings: Add, Text, x20 y390 w120 h20, Farben anzeigen:
6815Gui, OverlaySettings: Add, Text, x20 y420 w120 h20, Kursiv anzeigen:
6816Gui, OverlaySettings: Add, Edit, x150 y330 w70 h20 vstatsOverlayPosX, %statsOverlayPosX%
6817Gui, OverlaySettings: Add, Edit, x150 y360 w70 h20 vstatsOverlayPosY, %statsOverlayPosY%
6818Gui, OverlaySettings: Add, CheckBox, x150 y390 w80 h20 vstatsOverlayColors checked%statsOverlayColors%, on / off
6819Gui, OverlaySettings: Add, CheckBox, x150 y420 w80 h20 vstatsOverlayItalic checked%statsOverlayItalic%, on / off
6820Gui, OverlaySettings: Add, Text, x230 y330 w145 h20, Schriftart (z.B. Arial):
6821Gui, OverlaySettings: Add, Text, x230 y360 w140 h20, Schriftgröße:
6822Gui, OverlaySettings: Add, Text, x230 y390 w140 h20, Fett anzeigen:
6823Gui, OverlaySettings: Add, Text, x230 y420 w140 h20, Sekundärfarbe:
6824Gui, OverlaySettings: Add, Edit, x380 y330 w140 h20 vstatsOverlayFont, %statsOverlayFont%
6825Gui, OverlaySettings: Add, Edit, x380 y360 w140 h20 vstatsOverlayFontSize, %statsOverlayFontSize%
6826Gui, OverlaySettings: Add, CheckBox, x380 y390 w140 h20 vstatsOverlayBold checked%statsOverlayBold%, on / off
6827Gui, OverlaySettings: Add, Edit, x380 y420 w140 h20 vstatsOverlayColor, %statsOverlayColor%
6828Gui, OverlaySettings: Add, GroupBox, x10 y460 w520 h200, MDC-Overlay Einstellungen
6829Gui, OverlaySettings: Add, Text, x20 y480 w200 h20, Beim Keybinderstart starten:
6830Gui, OverlaySettings: Add, CheckBox, x230 y480 w80 h20 vmdcOverlayAutostart checked%mdcOverlayAutostart%, on / off
6831Gui, OverlaySettings: Add, Text, x20 y510 w90 h20, Koordinaten:
6832Gui, OverlaySettings: Add, Text, x130 y510 w10 h20, x
6833Gui, OverlaySettings: Add, Text, x130 y540 w10 h20, y
6834Gui, OverlaySettings: Add, Text, x20 y570 w120 h20, Farben anzeigen:
6835Gui, OverlaySettings: Add, Text, x20 y600 w120 h20, Kursiv anzeigen:
6836Gui, OverlaySettings: Add, Text, x20 y630 w120 h20, Zeilen:
6837Gui, OverlaySettings: Add, Edit, x150 y510 w70 h20 vmdcOverlayPosX, %mdcOverlayPosX%
6838Gui, OverlaySettings: Add, Edit, x150 y540 w70 h20 vmdcOverlayPosY, %mdcOverlayPosY%
6839Gui, OverlaySettings: Add, CheckBox, x150 y570 w80 h20 vmdcOverlayColors checked%mdcOverlayColors%, on / off
6840Gui, OverlaySettings: Add, CheckBox, x150 y600 w80 h20 vmdcOverlayItalic checked%mdcOverlayItalic%, on / off
6841Gui, OverlaySettings: Add, Edit, x150 y630 w70 h20 vmdcOverlayLines, %mdcOverlayLines%
6842Gui, OverlaySettings: Add, Text, x230 y510 w145 h20, Schriftart (z.B. Arial):
6843Gui, OverlaySettings: Add, Text, x230 y540 w140 h20, Schriftgröße:
6844Gui, OverlaySettings: Add, Text, x230 y570 w140 h20, Fett anzeigen:
6845Gui, OverlaySettings: Add, Text, x230 y600 w140 h20, Sekundärfarbe:
6846Gui, OverlaySettings: Add, Text, x230 y630 w180 h20, Box anzeigen:
6847Gui, OverlaySettings: Add, Edit, x380 y510 w140 h20 vmdcOverlayFont, %mdcOverlayFont%
6848Gui, OverlaySettings: Add, Edit, x380 y540 w140 h20 vmdcOverlayFontSize, %mdcOverlayFontSize%
6849Gui, OverlaySettings: Add, CheckBox, x380 y570 w140 h20 vmdcOverlayBold checked%mdcOverlayBold%, on / off
6850Gui, OverlaySettings: Add, Edit, x380 y600 w140 h20 vmdcOverlayColor, %mdcOverlayColor%
6851Gui, OverlaySettings: Add, CheckBox, x380 y630 w140 h20 vmdcOverlayBoxEnabled checked%mdcOverlayBoxEnabled%, on / off
6852Menu, OverlaySettingsInformations, Add, &Informationen, OverlaySettingsInformations
6853Gui, OverlaySettings: Menu, OverlaySettingsInformations
6854Gui, OverlaySettings: Show, h720 w540, %projectName% - Overlay - Version: %version%
6855}
6856return
6857OverlaySettingsGuiClose:
6858{
6859Gui, OverlaySettings: Destroy
6860}
6861return
6862OverlaySettingsSave:
6863{
6864Gui, OverlaySettings: Submit, NoHide
6865savedStatsOverlayContent := StrReplace(statsOverlayContent, "`n", "~")
6866IniWrite, %savedStatsOverlayContent%, settings.ini, StatsOverlay, Content
6867IniWrite, %statsOverlayAutostart%, settings.ini, StatsOverlay, Autostart
6868IniWrite, %statsOverlayPosX%, settings.ini, StatsOverlay, PosX
6869IniWrite, %statsOverlayPosY%, settings.ini, StatsOverlay, PosY
6870IniWrite, %statsOverlayColors%, settings.ini, StatsOverlay, Colors
6871IniWrite, %statsOverlayItalic%, settings.ini, StatsOverlay, Italic
6872IniWrite, %statsOverlayFont%, settings.ini, StatsOverlay, Font
6873IniWrite, %statsOverlayFontSize%, settings.ini, StatsOverlay, FontSize
6874IniWrite, %statsOverlayBold%, settings.ini, StatsOverlay, Bold
6875IniWrite, %statsOverlayColor%, settings.ini, StatsOverlay, Color
6876statsOverlayPrimColor := SECCOL
6877statsOverlaySecColor := "{" . statsOverlayColor . "}"
6878statsOverlayPositiveColor := "{00FF00}"
6879statsOverlayNegativeColor := "{FF0000}"
6880if (statsOverlayEnabled) {
6881SetTimer, StatsOverlayTimer, Off
6882TextDestroy(statsOverlay)
6883createOverlay(1)
6884}
6885IniWrite, %mdcOverlayAutostart%, settings.ini, MDCOverlay, Autostart
6886IniWrite, %mdcOverlayPosX%, settings.ini, MDCOverlay, PosX
6887IniWrite, %mdcOverlayPosY%, settings.ini, MDCOverlay, PosY
6888IniWrite, %mdcOverlayColors%, settings.ini, MDCOverlay, Colors
6889IniWrite, %mdcOverlayItalic%, settings.ini, MDCOverlay, Italic
6890IniWrite, %mdcOverlayLines%, settings.ini, MDCOverlay, Lines
6891IniWrite, %mdcOverlayFont%, settings.ini, MDCOverlay, Font
6892IniWrite, %mdcOverlayFontSize%, settings.ini, MDCOverlay, FontSize
6893IniWrite, %mdcOverlayBold%, settings.ini, MDCOverlay, Bold
6894IniWrite, %mdcOverlayColor%, settings.ini, MDCOverlay, Color
6895IniWrite, %mdcOverlayBoxEnabled%, settings.ini, MDCOverlay, Box
6896mdcOverlayPrimColor := "{" . mdcOverlayColor . "}"
6897mdcOverlaySecColor := "{FFFFFF}"
6898mdcOverlayBackupColor := "{FF8000}"
6899mdcOverlayStoreRobColor := "{F4F442}"
6900if (mdcOverlayEnabled) {
6901SetTimer, MDCOverlayTimer, Off
6902BoxDestroy(mdcBox)
6903TextDestroy(mdcHeader)
6904TextDestroy(mdcText)
6905createOverlay(2)
6906}
6907MsgBox, 64, Speicherung, Alle Eingaben und Daten wurden erfolgreich gespeichert!
6908Gui, OverlaySettings: Destroy
6909}
6910return
6911OverlaySettingsInformations:
6912{
6913Gui, OverlayVariables: Destroy
6914Gui, OverlayVariables: Default
6915Gui, OverlayVariables: Color, white
6916Gui, OverlayVariables: Font, S10 CDefault, Verdana
6917Gui, OverlayVariables: Add, ListView, x10 y10 r20 w460 gOverlayVariablesLV, Platzhalter|Beschreibung
6918Gui, OverlayVariables: Add, Button, x310 y450 w160 h40 gOverlayVariablesGuiClose, Schließen
6919LV_Add("", "-----------------", "Allgemeine Variablen")
6920LV_Add("", "[primcol]", "Primärfarbe")
6921LV_Add("", "[seccol]", "Sekundärfarbe")
6922LV_Add("", "[white]", "Weiß")
6923LV_Add("", "[name]", "Dein Name")
6924LV_Add("", "[id]", "Deine ID")
6925LV_Add("", "[ping]", "Dein Ping")
6926LV_Add("", "[zone]", "Deine Zone")
6927LV_Add("", "[city]", "Deine Stadt")
6928LV_Add("", "[hp]", "Deine HP")
6929LV_Add("", "[armour]", "Deine Armour")
6930LV_Add("", "[money]", "Geld auf der Hand")
6931LV_Add("", "[bankmoney]", "Geld auf dem Konto")
6932LV_Add("", "[allmoney]", "Gesamtgeld")
6933LV_Add("", "[skin]", "Deine Skin-ID")
6934LV_Add("", "[weaponid]", "Weapon-ID der aktuellen Waffe")
6935LV_Add("", "[weapon]", "Name der aktuellen Waffe")
6936LV_Add("", "[freezed]", "ja/nein, ob man gefreezed ist")
6937LV_Add("", "[vhealth]", "Fahrzeugzustand in Prozent")
6938LV_Add("", "[vmodelid]", "Fahrzeug-Modell-ID")
6939LV_Add("", "[vmodel]", "Fahrzeug-Modell-Name")
6940LV_Add("", "[vspeed]", "Fahrzeug-Geschwindigkeit")
6941LV_Add("", "[fishmoney]", "Fisch-Verdienst")
6942LV_Add("", "[fishtime]", "Fisch-Zeit")
6943LV_Add("", "[date]", "Aktuelles Datum im Format TT.MM.JJJJ")
6944LV_Add("", "[motor]", "Motor-Status")
6945LV_Add("", "[lock]", "Lock-Status")
6946LV_Add("", "[light]", "Licht-Status")
6947LV_Add("", "[checkpoint]", "Distanz zum Checkpoint")
6948LV_Add("", "[pdmoney]", "Geld am nächsten Payday (brutto)")
6949LV_Add("", "[pdmoneynetto]", "Geld am nächsten Payday (netto)")
6950LV_Add("", "[find]", "Spieler auf /af oder /asp")
6951LV_Add("", "[partners]", "Eingetragene Partner")
6952LV_Add("", "[wanteds]", "Anzahl der vergebenen Wanteds")
6953LV_Add("", "[points]", "Anzahl der vergebenen Punkte")
6954LV_Add("", "[checks]", "Anzahl der Kontrollen")
6955LV_Add("", "[tazer]", "Anzahl der Tazer-Benutzungen")
6956LV_Add("", "[radar]", "Anzahl der Radarkontrollen")
6957LV_Add("", "[arrests]", "Anzahl der eingesperrten Verbrecher")
6958LV_Add("", "[kills]", "Anzahl der getöteten Verbrecher")
6959LV_Add("", "[deatharrests]", "Anzahl der Death-Arrests")
6960LV_Add("", "[deathprison]", "Anzahl der Death-Prison")
6961LV_Add("", "[offlinearrests]", "Anzahl der Offline-Arrests")
6962LV_Add("", "[offlineprison]", "Anzahl der Offline-Prison")
6963LV_Add("", "[arrestmoney]", "Durch Verhaftungen verdientes Geld")
6964LV_Add("", "[ticketmoney]", "Durch Tickets verdientes Geld")
6965LV_Add("", "[fishmoney]", "Durch Fischen verdientes Geld")
6966LV_Add("", "[totalmoney]", "Gesamt verdientes Geld")
6967LV_Add("", "[marihuana]", "Anzahl zerstörter Marihuana-Pflanzen")
6968LV_Add("", "[drugs]", "Anzahl abgenommener Gramm Drogen")
6969LV_Add("", "[seeds]", "Anzahl abgenommener Samen")
6970LV_Add("", "-----------------", "Jobsystem-Variablen")
6971LV_Add("", "[garbagexp]", "Müllmann-XP")
6972LV_Add("", "[garbagekubik]", "Müllmann-Kubik")
6973LV_Add("", "[garbagemoney]", "Müllmann-Verdienst")
6974LV_Add("", "[fishingxp]", "Hochseefischer-XP")
6975LV_Add("", "[fishingmoney]", "Hochseefischer-Verdienst")
6976LV_Add("", "[truckerxp]", "Trucker-XP")
6977LV_Add("", "[truckermoney]", "Trucker-Verdienst")
6978LV_Add("", "[trainxp]", "Zugfahrer-XP")
6979LV_Add("", "[trainmoney]", "Zugfahrer-Verdienst")
6980LV_Add("", "[gardenerxp]", "Gärtner-XP")
6981LV_Add("", "[gardenermoney]", "Gärtner-Verdienst")
6982LV_Add("", "[gardenermaxmoney]", "Höchster Verdienst als Gärtner")
6983LV_Add("", "[farmerxp]", "Farmer-XP")
6984LV_Add("", "[farmermoney]", "Farmer-Verdienst")
6985LV_Add("", "[farmermaxmoney]", "Höchster Verdienst als Farmer")
6986LV_Add("", "[busrounds]", "Als Busfahrer gefahrene Runden")
6987LV_Add("", "[busmoney]", "Busfahrer-Verdienst")
6988LV_Add("", "[matsbought]", "Anzahl der gekauften Materialien")
6989LV_Add("", "[matsmoney]", "Materialien-Verdienst")
6990LV_Add("", "[matsxp]", "Materialien-XP")
6991LV_Add("", "[mats]", "Anzahl der gefarmten Materialien")
6992LV_Add("", "[waffenstahl]", "Anzahl des gefarmten Waffenstahls")
6993LV_ModifyCol()
6994Gui, OverlayVariables: Show, h500 w480, %projectName% - Overlay-Variablen - Version: %version%
6995}
6996return
6997OverlayVariablesLV:
6998{
6999if A_GuiEvent = DoubleClick
7000{
7001LV_GetText(RowText, A_EventInfo)
7002clipboard := RowText
7003ToolTip, Die Variable "%RowText%" wurde in die Zwischenablage kopiert!
7004SetTimer, RemoveToolTip, 1000
7005}
7006}
7007return
7008RemoveToolTip:
7009{
7010SetTimer, RemoveToolTip, Off
7011ToolTip
7012}
7013return
7014OverlayVariablesGuiClose:
7015{
7016Gui, OverlayVariables: Destroy
7017}
7018return
7019HotkeysGUI:
7020{
7021Gui, Hotkeys: Destroy
7022Gui, Hotkeys: Color, white
7023Gui, Hotkeys: Font, S10 CDefault, Verdana
7024Gui, Hotkeys: Add, Button, x10 y550 w130 h40 gOwnHotkeysGUI, Eigene Hotkeys
7025Gui, Hotkeys: Add, Button, x150 y550 w130 h40 gResetHotkeys, Zurücksetzen
7026Gui, Hotkeys: Add, Button, x480 y550 w130 h40 gHotkeysGuiClose, Schließen
7027Gui, Hotkeys: Add, Tab, x0 y0 w620 h540, Seite 1|Seite 2|Seite 3
7028Gui, Hotkeys: Tab, Seite 1
7029Gui, Hotkeys: Add, Text, x10 y30 w170 h20 , Wtds: Angriff/Beschuss
7030Gui, Hotkeys: Add, Text, x10 y60 w170 h20 , Wtds: Flucht/-versuch
7031Gui, Hotkeys: Add, Text, x10 y90 w170 h20 , Wtds: Beihilfe Flucht
7032Gui, Hotkeys: Add, Text, x10 y120 w170 h20 , Wtds: Verweigerung
7033Gui, Hotkeys: Add, Text, x10 y150 w170 h20 , Wtds: Behinderung d.J.
7034Gui, Hotkeys: Add, Text, x10 y180 w170 h20 , Wtds: Besitz von ill. Geg.
7035Gui, Hotkeys: Add, Text, x10 y210 w170 h20 , Wtds: Handel mit ill. Geg.
7036Gui, Hotkeys: Add, Text, x10 y240 w170 h20 , Wtds: Unbefugter Betritt
7037Gui, Hotkeys: Add, Text, x10 y300 w170 h20 , Wtds: Zollflucht
7038Gui, Hotkeys: Add, Text, x10 y330 w170 h20 , Wtds: Fahrzeugdiebstahl
7039Gui, Hotkeys: Add, Text, x10 y360 w170 h20 , Wtds: Beleidigung
7040Gui, Hotkeys: Add, Text, x10 y390 w170 h20 , Wtds: Waffengebrauch
7041Gui, Hotkeys: Add, Text, x10 y420 w170 h20 , Wtds: Waffenbesitz
7042Gui, Hotkeys: Add, Text, x10 y450 w170 h20 , Wtds: Bestechung
7043Gui, Hotkeys: Add, Text, x10 y510 w170 h20 , Wtds: ESC-Flucht
7044Gui, Hotkeys: Add, Hotkey, x190 y30 w120 h20 vatkWantedsHotkey gSaveHotkeyLabel, %atkWantedsNoMods%
7045Gui, Hotkeys: Add, Hotkey, x190 y60 w120 h20 vescapeWantedsHotkey gSaveHotkeyLabel, %escapeWantedsNoMods%
7046Gui, Hotkeys: Add, Hotkey, x190 y90 w120 h20 vescapeAidWantedsHotkey gSaveHotkeyLabel, %escapeAidWantedsNoMods%
7047Gui, Hotkeys: Add, Hotkey, x190 y120 w120 h20 vrefusalWantedsHotkey gSaveHotkeyLabel, %refusalWantedsNoMods%
7048Gui, Hotkeys: Add, Hotkey, x190 y150 w120 h20 vobstructionWantedsHotkey gSaveHotkeyLabel, %obstructionWantedsNoMods%
7049Gui, Hotkeys: Add, Hotkey, x190 y180 w120 h20 vpossessionWantedsHotkey gSaveHotkeyLabel, %possessionWantedsNoMods%
7050Gui, Hotkeys: Add, Hotkey, x190 y210 w120 h20 vtradeWantedsHotkey gSaveHotkeyLabel, %tradeWantedsNoMods%
7051Gui, Hotkeys: Add, Hotkey, x190 y240 w120 h20 vunauthorizedEnterWantedsHotkey gSaveHotkeyLabel, %unauthorizedEnterWantedsNoMods%
7052Gui, Hotkeys: Add, Hotkey, x190 y300 w120 h20 vcustomsEscapeWantedsHotkey gSaveHotkeyLabel, %customsEscapeWantedsNoMods%
7053Gui, Hotkeys: Add, Hotkey, x190 y330 w120 h20 vvehicleTheftWantedsHotkey gSaveHotkeyLabel, %vehicleTheftWantedsNoMods%
7054Gui, Hotkeys: Add, Hotkey, x190 y360 w120 h20 vinsultingWantedsHotkey gSaveHotkeyLabel, %insultingWantedsNoMods%
7055Gui, Hotkeys: Add, Hotkey, x190 y390 w120 h20 vuseOfWeaponsWantedsHotkey gSaveHotkeyLabel, %useOfWeaponsWantedsNoMods%
7056Gui, Hotkeys: Add, Hotkey, x190 y420 w120 h20 vpossessionOfWeaponsWantedsHotkey gSaveHotkeyLabel, %possessionOfWeaponsWantedsNoMods%
7057Gui, Hotkeys: Add, Hotkey, x190 y450 w120 h20 vbriberyWantedsHotkey gSaveHotkeyLabel, %briberyWantedsNoMods%
7058Gui, Hotkeys: Add, Hotkey, x190 y510 w120 h20 vescWantedsHotkey gSaveHotkeyLabel, %escWantedsNoMods%
7059Gui, Hotkeys: Add, Text, x320 y30 w170 h20 , Punkte: Zweite Reihe
7060Gui, Hotkeys: Add, Text, x320 y60 w170 h20 , Punkte: SVG
7061Gui, Hotkeys: Add, Text, x320 y90 w170 h20 , Punkte: Falsche Seite
7062Gui, Hotkeys: Add, Text, x320 y120 w170 h20 , Punkte: Geschwindigkeit
7063Gui, Hotkeys: Add, Text, x320 y150 w170 h20 , Punkte: Vorfahrt
7064Gui, Hotkeys: Add, Text, x320 y180 w170 h20 , Punkte: Abseits
7065Gui, Hotkeys: Add, Text, x320 y210 w170 h20 , Punkte: Licht
7066Gui, Hotkeys: Add, Text, x320 y240 w170 h20 , Punkte: Parkverbot
7067Gui, Hotkeys: Add, Text, x320 y270 w170 h20 , Punkte: Drogeneinfluss
7068Gui, Hotkeys: Add, Text, x320 y300 w170 h20 , Punkte clearen
7069Gui, Hotkeys: Add, Text, x320 y330 w170 h20 , Motorsystem
7070Gui, Hotkeys: Add, Text, x320 y360 w170 h20 , Fahrzeug abschließen
7071Gui, Hotkeys: Add, Text, x320 y390 w170 h20 , Licht einschalten
7072Gui, Hotkeys: Add, Text, x320 y420 w170 h20 , /uclight
7073Gui, Hotkeys: Add, Text, x320 y480 w170 h20 , Wanteds clearen
7074Gui, Hotkeys: Add, Text, x320 y510 w170 h20 , Wtds: Drogenkonsum
7075Gui, Hotkeys: Add, Hotkey, x490 y30 w120 h20 vsecondRowPointsHotkey gSaveHotkeyLabel, %secondRowPointsNoMods%
7076Gui, Hotkeys: Add, Hotkey, x490 y60 w120 h20 vroadHazardPointsHotkey gSaveHotkeyLabel, %roadHazardPointsNoMods%
7077Gui, Hotkeys: Add, Hotkey, x490 y90 w120 h20 vwrongSitePointsHotkey gSaveHotkeyLabel, %wrongSitePointsNoMods%
7078Gui, Hotkeys: Add, Hotkey, x490 y120 w120 h20 vspeedPointsHotkey gSaveHotkeyLabel, %speedPointsNoMods%
7079Gui, Hotkeys: Add, Hotkey, x490 y150 w120 h20 vrightOfWayPointsHotkey gSaveHotkeyLabel, %rightOfWayPointsNoMods%
7080Gui, Hotkeys: Add, Hotkey, x490 y180 w120 h20 voffsitePointsHotkey gSaveHotkeyLabel, %offsitePointsNoMods%
7081Gui, Hotkeys: Add, Hotkey, x490 y210 w120 h20 vlightPointsHotkey gSaveHotkeyLabel, %lightPointsNoMods%
7082Gui, Hotkeys: Add, Hotkey, x490 y240 w120 h20 vnoParkingPointsHotkey gSaveHotkeyLabel, %noParkingPointsNoMods%
7083Gui, Hotkeys: Add, Hotkey, x490 y270 w120 h20 vinfluenceOfDrugsPointsHotkey gSaveHotkeyLabel, %influenceOfDrugsPointsNoMods%
7084Gui, Hotkeys: Add, Hotkey, x490 y300 w120 h20 vclearPointsHotkey gSaveHotkeyLabel, %clearPointsNoMods%
7085Gui, Hotkeys: Add, Hotkey, x490 y330 w120 h20 vmotorSystemHotkey gSaveHotkeyLabel, %motorSystemNoMods%
7086Gui, Hotkeys: Add, Hotkey, x490 y360 w120 h20 vlockHotkey gSaveHotkeyLabel, %lockNoMods%
7087Gui, Hotkeys: Add, Hotkey, x490 y390 w120 h20 vlightHotkey gSaveHotkeyLabel, %lightNoMods%
7088Gui, Hotkeys: Add, Hotkey, x490 y420 w120 h20 vuclightHotkey gSaveHotkeyLabel, %uclightNoMods%
7089Gui, Hotkeys: Add, Hotkey, x490 y480 w120 h20 vclearWantedsHotkey gSaveHotkeyLabel, %clearWantedsNoMods%
7090Gui, Hotkeys: Add, Hotkey, x490 y510 w120 h20 vdrugConsumptionWantedsHotkey gSaveHotkeyLabel, %drugConsumptionWantedsNoMods%
7091Gui, Hotkeys: Tab, Seite 2
7092Gui, Hotkeys: Add, Text, x10 y30 w170 h20 , Megafon: Folgen
7093Gui, Hotkeys: Add, Text, x10 y60 w170 h20 , Megafon: Kontrolle
7094Gui, Hotkeys: Add, Text, x10 y90 w170 h20 , Megafon: Anhalten
7095Gui, Hotkeys: Add, Text, x10 y120 w170 h20 , Megafon: Schießen
7096Gui, Hotkeys: Add, Text, x10 y150 w170 h20 , Megafon: Aussteigen
7097Gui, Hotkeys: Add, Text, x10 y180 w170 h20 , Megafon: Straße räumen
7098Gui, Hotkeys: Add, Text, x10 y210 w170 h20 , Megafon: Waffen weg
7099Gui, Hotkeys: Add, Text, x10 y240 w170 h20 , Megafon: Verlassen
7100Gui, Hotkeys: Add, Text, x10 y270 w170 h20 , Megafon: Verfolung
7101Gui, Hotkeys: Add, Text, x10 y300 w170 h20 , Megafon: StVO
7102Gui, Hotkeys: Add, Text, x10 y330 w170 h20 , Heilen
7103Gui, Hotkeys: Add, Text, x10 y360 w170 h20 , Ausrüsten
7104Gui, Hotkeys: Add, Text, x10 y390 w170 h20 , Ausrüsten (Profil 1)
7105Gui, Hotkeys: Add, Text, x10 y420 w170 h20 , Ausrüsten (Profil 2)
7106Gui, Hotkeys: Add, Text, x10 y450 w170 h20 , Ausrüsten (Profil 3)
7107Gui, Hotkeys: Add, Text, x10 y480 w170 h20 , Frakmember anzeigen
7108Gui, Hotkeys: Add, Text, x10 y510 w170 h20 , Crewmember anzeigen
7109Gui, Hotkeys: Add, Hotkey, x190 y30 w120 h20 vmegaFollowHotkey gSaveHotkeyLabel, %megaFollowNoMods%
7110Gui, Hotkeys: Add, Hotkey, x190 y60 w120 h20 vmegaControlHotkey gSaveHotkeyLabel, %megaControlNoMods%
7111Gui, Hotkeys: Add, Hotkey, x190 y90 w120 h20 vmegaStopHotkey gSaveHotkeyLabel, %megaStopNoMods%
7112Gui, Hotkeys: Add, Hotkey, x190 y120 w120 h20 vmegaShootWarningHotkey gSaveHotkeyLabel, %megaShootWarningNoMods%
7113Gui, Hotkeys: Add, Hotkey, x190 y150 w120 h20 vmegaGetOutOfCarHotkey gSaveHotkeyLabel, %megaGetOutOfCarNoMods%
7114Gui, Hotkeys: Add, Hotkey, x190 y180 w120 h20 vmegaClearHotkey gSaveHotkeyLabel, %megaClearNoMods%
7115Gui, Hotkeys: Add, Hotkey, x190 y210 w120 h20 vmegaWeaponsHotkey gSaveHotkeyLabel, %megaWeaponsNoMods%
7116Gui, Hotkeys: Add, Hotkey, x190 y240 w120 h20 vmegaLeaveHotkey gSaveHotkeyLabel, %megaLeaveNoMods%
7117Gui, Hotkeys: Add, Hotkey, x190 y270 w120 h20 vmegaStopFollowHotkey gSaveHotkeyLabel, %megaStopFollowNoMods%
7118Gui, Hotkeys: Add, Hotkey, x190 y300 w120 h20 vmegaRoadTrafficActHotkey gSaveHotkeyLabel, %megaRoadTrafficActNoMods%
7119Gui, Hotkeys: Add, Hotkey, x190 y330 w120 h20 vhealHotkey gSaveHotkeyLabel, %healNoMods%
7120Gui, Hotkeys: Add, Hotkey, x190 y360 w120 h20 vequipHotkey gSaveHotkeyLabel, %equipNoMods%
7121Gui, Hotkeys: Add, Hotkey, x190 y390 w120 h20 vequipProfile1Hotkey gSaveHotkeyLabel, %equipProfile1NoMods%
7122Gui, Hotkeys: Add, Hotkey, x190 y420 w120 h20 vequipProfile2Hotkey gSaveHotkeyLabel, %equipProfile2NoMods%
7123Gui, Hotkeys: Add, Hotkey, x190 y450 w120 h20 vequipProfile3Hotkey gSaveHotkeyLabel, %equipProfile3NoMods%
7124Gui, Hotkeys: Add, Hotkey, x190 y480 w120 h20 vmembersHotkey gSaveHotkeyLabel, %membersNoMods%
7125Gui, Hotkeys: Add, Hotkey, x190 y510 w120 h20 vcrewmembersHotkey gSaveHotkeyLabel, %crewmembersNoMods%
7126Gui, Hotkeys: Add, Text, x320 y30 w170 h20 , Backup anfordern
7127Gui, Hotkeys: Add, Text, x320 y60 w170 h20 , Backup (WH) anfordern
7128Gui, Hotkeys: Add, Text, x320 y90 w170 h20 , BK nicht mehr benötigt
7129Gui, Hotkeys: Add, Text, x320 y120 w170 h20 , Position (/d)
7130Gui, Hotkeys: Add, Text, x320 y150 w170 h20 , Position (/f)
7131Gui, Hotkeys: Add, Text, x320 y180 w170 h20 , Position (/r)
7132Gui, Hotkeys: Add, Text, x320 y210 w170 h20 , Auftrag übernehmen
7133Gui, Hotkeys: Add, Text, x320 y240 w170 h20 , Auftrag erledigt
7134Gui, Hotkeys: Add, Text, x320 y270 w170 h20 , Dankeschön!
7135Gui, Hotkeys: Add, Text, x320 y300 w170 h20 , Entschuldigung!
7136Gui, Hotkeys: Add, Text, x320 y330 w170 h20 , Kofferraum öffnen
7137Gui, Hotkeys: Add, Text, x320 y360 w170 h20 , Kofferraum durchsuchen
7138Gui, Hotkeys: Add, Text, x320 y390 w170 h20 , Kofferr. öffnen lassen
7139Gui, Hotkeys: Add, Text, x320 y420 w170 h20 , Tempomat de-/aktivieren
7140Gui, Hotkeys: Add, Text, x320 y450 w170 h20 , Job ausführen (/setjob)
7141Gui, Hotkeys: Add, Text, x320 y510 w170 h20 , Eingabe wiederholen
7142Gui, Hotkeys: Add, Hotkey, x490 y30 w120 h20 vbackupHotkey gSaveHotkeyLabel, %backupNoMods%
7143Gui, Hotkeys: Add, Hotkey, x490 y60 w120 h20 vbackupWhHotkey gSaveHotkeyLabel, %backupWhNoMods%
7144Gui, Hotkeys: Add, Hotkey, x490 y90 w120 h20 vnoBackupHotkey gSaveHotkeyLabel, %noBackupNoMods%
7145Gui, Hotkeys: Add, Hotkey, x490 y120 w120 h20 vpositionHotkey gSaveHotkeyLabel, %positionNoMods%
7146Gui, Hotkeys: Add, Hotkey, x490 y150 w120 h20 vfPositionHotkey gSaveHotkeyLabel, %fPositionNoMods%
7147Gui, Hotkeys: Add, Hotkey, x490 y180 w120 h20 vrPositionHotkey gSaveHotkeyLabel, %rPositionNoMods%
7148Gui, Hotkeys: Add, Hotkey, x490 y210 w120 h20 vacceptJobHotkey gSaveHotkeyLabel, %acceptJobNoMods%
7149Gui, Hotkeys: Add, Hotkey, x490 y240 w120 h20 vdoneJobHotkey gSaveHotkeyLabel, %doneJobNoMods%
7150Gui, Hotkeys: Add, Hotkey, x490 y270 w120 h20 vthanksHotkey gSaveHotkeyLabel, %thanksNoMods%
7151Gui, Hotkeys: Add, Hotkey, x490 y300 w120 h20 vsorryHotkey gSaveHotkeyLabel, %sorryNoMods%
7152Gui, Hotkeys: Add, Hotkey, x490 y330 w120 h20 vopenTrunkHotkey gSaveHotkeyLabel, %openTrunkNoMods%
7153Gui, Hotkeys: Add, Hotkey, x490 y360 w120 h20 vcheckTrunkHotkey gSaveHotkeyLabel, %checkTrunkNoMods%
7154Gui, Hotkeys: Add, Hotkey, x490 y390 w120 h20 vaskTrunkOpenHotkey gSaveHotkeyLabel, %askTrunkOpenNoMods%
7155Gui, Hotkeys: Add, Hotkey, x490 y420 w120 h20 vtempomatHotkey gSaveHotkeyLabel, %tempomatNoMods%
7156Gui, Hotkeys: Add, Hotkey, x490 y450 w120 h20 vjobexecuteHotkey gSaveHotkeyLabel, %jobexecuteNoMods%
7157Gui, Hotkeys: Add, Hotkey, x490 y510 w120 h20 vrepeatHotkey gSaveHotkeyLabel, %repeatNoMods%
7158Gui, Hotkeys: Tab, Seite 3
7159Gui, Hotkeys: Add, Text, x10 y30 w170 h20 , Einsperren (auto)
7160Gui, Hotkeys: Add, Text, x10 y60 w170 h20 , Einsperren
7161Gui, Hotkeys: Add, Text, x10 y90 w170 h20 , Verbrecherliste anzeigen
7162Gui, Hotkeys: Add, Text, x10 y120 w170 h20 , Verbr.liste zurücksetzen
7163Gui, Hotkeys: Add, Text, x10 y150 w170 h20 , Festnehmen
7164Gui, Hotkeys: Add, Text, x10 y180 w170 h20 , Freilassen (/uncuff)
7165Gui, Hotkeys: Add, Text, x10 y210 w170 h20 , Kontrollieren
7166Gui, Hotkeys: Add, Text, x10 y240 w170 h20 , Kontrolle anfordern
7167Gui, Hotkeys: Add, Text, x10 y270 w170 h20 , Scheine anfordern
7168Gui, Hotkeys: Add, Text, x10 y300 w170 h20 , Vielen Dank Koop.
7169Gui, Hotkeys: Add, Text, x10 y330 w170 h20 , Aus dem Auto aussteigen
7170Gui, Hotkeys: Add, Text, x10 y360 w170 h20 , Im Auto bleiben
7171Gui, Hotkeys: Add, Text, x10 y390 w170 h20 , Festgenommen: Fahrzeug
7172Gui, Hotkeys: Add, Text, x10 y420 w170 h20 , Festgenommen: Zellen
7173Gui, Hotkeys: Add, Text, x10 y450 w170 h20 , Waffen einstecken
7174Gui, Hotkeys: Add, Text, x10 y480 w170 h20 , /grab
7175Gui, Hotkeys: Add, Text, x10 y510 w170 h20 , /ungrab
7176Gui, Hotkeys: Add, Hotkey, x190 y30 w120 h20 vautoImprisonHotkey gSaveHotkeyLabel, %autoImprisonNoMods%
7177Gui, Hotkeys: Add, Hotkey, x190 y60 w120 h20 vimprisonHotkey gSaveHotkeyLabel, %imprisonNoMods%
7178Gui, Hotkeys: Add, Hotkey, x190 y90 w120 h20 varrestSlotsHotkey gSaveHotkeyLabel, %arrestSlotsNoMods%
7179Gui, Hotkeys: Add, Hotkey, x190 y120 w120 h20 vresetArrestSlotsHotkey gSaveHotkeyLabel, %resetArrestSlotsNoMods%
7180Gui, Hotkeys: Add, Hotkey, x190 y150 w120 h20 varrestHotkey gSaveHotkeyLabel, %arrestNoMods%
7181Gui, Hotkeys: Add, Hotkey, x190 y180 w120 h20 vuncuffHotkey gSaveHotkeyLabel, %uncuffNoMods%
7182Gui, Hotkeys: Add, Hotkey, x190 y210 w120 h20 vcheckHotkey gSaveHotkeyLabel, %checkNoMods%
7183Gui, Hotkeys: Add, Hotkey, x190 y240 w120 h20 vaskCheckHotkey gSaveHotkeyLabel, %askCheckNoMods%
7184Gui, Hotkeys: Add, Hotkey, x190 y270 w120 h20 vaskPapersHotkey gSaveHotkeyLabel, %askPapersNoMods%
7185Gui, Hotkeys: Add, Hotkey, x190 y300 w120 h20 vcooperationHotkey gSaveHotkeyLabel, %cooperationNoMods%
7186Gui, Hotkeys: Add, Hotkey, x190 y330 w120 h20 vgetOutOfCarHotkey gSaveHotkeyLabel, %getOutOfCarNoMods%
7187Gui, Hotkeys: Add, Hotkey, x190 y360 w120 h20 vstayInCarHotkey gSaveHotkeyLabel, %stayInCarNoMods%
7188Gui, Hotkeys: Add, Hotkey, x190 y390 w120 h20 varrestedCarHotkey gSaveHotkeyLabel, %arrestedCarNoMods%
7189Gui, Hotkeys: Add, Hotkey, x190 y420 w120 h20 varrestedFootHotkey gSaveHotkeyLabel, %arrestedFootNoMods%
7190Gui, Hotkeys: Add, Hotkey, x190 y450 w120 h20 vputWeaponsAwayHotkey gSaveHotkeyLabel, %putWeaponsAwayNoMods%
7191Gui, Hotkeys: Add, Hotkey, x190 y480 w120 h20 vgrabHotkey gSaveHotkeyLabel, %grabNoMods%
7192Gui, Hotkeys: Add, Hotkey, x190 y510 w120 h20 vungrabHotkey gSaveHotkeyLabel, %ungrabNoMods%
7193Gui, Hotkeys: Add, Text, x320 y60 w170 h20 , Handy an-/ausschalten
7194Gui, Hotkeys: Add, Text, x320 y90 w170 h20 , Fische essen
7195Gui, Hotkeys: Add, Text, x320 y120 w170 h20 , Erste-Hilfe-Paket ben.
7196Gui, Hotkeys: Add, Text, x320 y150 w170 h20 , Countdown starten
7197Gui, Hotkeys: Add, Text, x320 y180 w170 h20 , Stoppuhr starten
7198Gui, Hotkeys: Add, Text, x320 y210 w170 h20 , Autom. Systeme beend.
7199Gui, Hotkeys: Add, Text, x320 y240 w170 h20 , /auf
7200Gui, Hotkeys: Add, Text, x320 y270 w170 h20 , Zoll öffnen
7201Gui, Hotkeys: Add, Text, x320 y300 w170 h20 , Zollstation schließen
7202Gui, Hotkeys: Add, Text, x320 y330 w170 h20 , Zollstation öffnen
7203Gui, Hotkeys: Add, Text, x320 y360 w170 h20 , Zollst. geschl. (/gov)
7204Gui, Hotkeys: Add, Text, x320 y390 w170 h20 , Zollst. geöffnet (/gov)
7205Gui, Hotkeys: Add, Text, x320 y480 w170 h20 , /ram
7206Gui, Hotkeys: Add, Text, x320 y510 w170 h20 , Keybinder pausieren
7207Gui, Hotkeys: Add, Hotkey, x490 y60 w120 h20 vtogCellphoneHotkey gSaveHotkeyLabel, %togCellphoneNoMods%
7208Gui, Hotkeys: Add, Hotkey, x490 y90 w120 h20 veatFishHotkey gSaveHotkeyLabel, %eatFishNoMods%
7209Gui, Hotkeys: Add, Hotkey, x490 y120 w120 h20 vfirstAidHotkey gSaveHotkeyLabel, %firstAidNoMods%
7210Gui, Hotkeys: Add, Hotkey, x490 y150 w120 h20 vcountdownHotkey gSaveHotkeyLabel, %countdownNoMods%
7211Gui, Hotkeys: Add, Hotkey, x490 y180 w120 h20 vstopwatchHotkey gSaveHotkeyLabel, %stopwatchNoMods%
7212Gui, Hotkeys: Add, Hotkey, x490 y210 w120 h20 vstopAutomaticSystemsHotkey gSaveHotkeyLabel, %stopAutomaticSystemsNoMods%
7213Gui, Hotkeys: Add, Hotkey, x490 y240 w120 h20 vopenDoorHotkey gSaveHotkeyLabel, %openDoorNoMods%
7214Gui, Hotkeys: Add, Hotkey, x490 y270 w120 h20 vopenCustomsHotkey gSaveHotkeyLabel, %openCustomsNoMods%
7215Gui, Hotkeys: Add, Hotkey, x490 y300 w120 h20 vcloseCustomsControlHotkey gSaveHotkeyLabel, %closeCustomsControlNoMods%
7216Gui, Hotkeys: Add, Hotkey, x490 y330 w120 h20 vopenCustomsControlHotkey gSaveHotkeyLabel, %openCustomsControlNoMods%
7217Gui, Hotkeys: Add, Hotkey, x490 y360 w120 h20 vgovClosedCustomsHotkey gSaveHotkeyLabel, %govClosedCustomsNoMods%
7218Gui, Hotkeys: Add, Hotkey, x490 y390 w120 h20 vgovOpenedCustomsHotkey gSaveHotkeyLabel, %govOpenedCustomsNoMods%
7219Gui, Hotkeys: Add, Hotkey, x490 y480 w120 h20 vramHotkey gSaveHotkeyLabel, %ramNoMods%
7220Gui, Hotkeys: Add, Hotkey, x490 y510 w120 h20 vpauseHotkey gSaveHotkeyLabel, %pauseNoMods%
7221Menu, MenuBar, Add, &Informationen, HotkeyInformations
7222Gui, Hotkeys: Menu, MenuBar
7223Gui, Hotkeys: Show, h600 w620, %projectName% - Hotkeys - Version %version%
7224}
7225return
7226HotkeysGuiClose:
7227{
7228Gui, Hotkeys: Destroy
7229}
7230return
7231HotkeyInformations:
7232{
7233MsgBox, 64, Informationen zu Hotkeys,
7234(LTrim
7235Hier können die Hotkeys selbstständig definiert werden.
7236
7237Manche Hotkeys können nicht im GUI verändert/definiert werden, da AHK nicht die Möglichkeit dazu gibt (oder diese einfach nicht angezeigt werden können).
7238Stattdessen können diese alternativ in der Hotkeys.ini eingetragen werden.
7239Beispielsweise können so auch die Maustasten "xButton1" und "xButton2" belegt werden, was hier im GUI nicht möglich ist.
7240
7241Ein Speichern ist nicht notwendig, da dies automatisch geschieht.
7242Solltest du aber manuelle Änderungen in der Hotkeys.ini durchgeführt haben, musst du den Keybinder neustarten!
7243)
7244}
7245return
7246ResetHotkeys:
7247{
7248FileDelete, Hotkeys.ini
7249MsgBox, 64, Zurücksetzen erfolgreich, Die Hotkeys wurden erfolgreich auf die Standardbelegungen zurückgesetzt, der Keybinder startet nun neu!
7250Reload
7251}
7252return
7253SaveHotkeyLabel:
7254{
7255Gui, Hotkeys: Submit, NoHide
7256name := SubStr(A_GuiControl, 1, -6)
7257hk := %A_GuiControl%
7258if hk in +,^,!,+^,+!,^!,+^!
7259return
7260if (registeredHotkeys.HasKey(name)) {
7261oldKey := registeredHotkeys[name]
7262Hotkey, %oldKey%, %name%Label, Off
7263registeredHotkeys.Delete(name)
7264}
7265%name%NoMods := ""
7266if (hk == "") {
7267IniWrite, ---, Hotkeys.ini, Hotkeys, %name%
7268} else {
7269alreadyRegistered := false
7270for key, value in registeredHotkeys {
7271hk2 := StrReplace(hk, "~", "")
7272value2 := StrReplace(value, "~", "")
7273if (hk2 = value2 && StrLen(hk2) == StrLen(value2)) {
7274alreadyRegistered := true
7275alreadyRegisteredKey := key
7276break
7277}
7278}
7279if (!InStr(hk, "F") && !InStr(hk, "!"))
7280hk := "~" . hk
7281if (!alreadyRegistered) {
7282Hotkey, %hk%, %name%Label
7283StringReplace, %name%NoMods, hk, ~
7284IniWrite, %hk%, Hotkeys.ini, Hotkeys, %name%
7285registeredHotkeys[name] := hk
7286} else {
7287IniWrite, ---, Hotkeys.ini, Hotkeys, %name%
7288GuiControl, Hotkeys: , %A_GuiControl%,
7289if (RegExMatch(alreadyRegisteredKey, "ownHotkey(\d+)", key_)) {
7290hotkeyName := "eigenen Hotkey " . key_1
7291} else {
7292hotkeyName := "Hotkey " . alreadyRegisteredKey
7293}
7294message := "Der Hotkey für " . name . " (" . getUserFriendlyHotkeyName(hk) . ") konnte nicht aktiviert werden, da er bereits für den " . hotkeyName . " registriert ist!"
7295MsgBox, 64, Speicherung, %message%
7296}
7297}
7298}
7299return
7300OwnHotkeysGUI:
7301{
7302Gui, OwnHotkeys: Destroy
7303Gui, OwnHotkeys: Color, white
7304Gui, OwnHotkeys: Font, S10 CDefault, Verdana
7305Gui, OwnHotkeys: Add, Button, x10 y530 w130 h40 gOwnHotkeysSave, Speichern
7306Gui, OwnHotkeys: Add, Button, x870 y530 w130 h40 gOwnHotkeysGuiClose, Schließen
7307Gui, OwnHotkeys: Add, Tab, x10 y10 w990 h510, Seite 1|Seite 2|Seite 3
7308Gui, OwnHotkeys: Tab, Seite 1
7309Loop, 8 {
7310index := A_Index
7311active := ownHotkey%index%Active
7312y1 := -20 + (A_Index * 60)
7313y2 := 10 + (A_Index * 60)
7314Gui, OwnHotkeys: Add, CheckBox, x20 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
7315Gui, OwnHotkeys: Add, Hotkey, x20 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
7316Gui, OwnHotkeys: Add, Edit, x130 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
7317}
7318Loop, 8 {
7319index := A_Index + 8
7320active := ownHotkey%index%Active
7321y1 := -20 + (A_Index * 60)
7322y2 := 10 + (A_Index * 60)
7323Gui, OwnHotkeys: Add, CheckBox, x510 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
7324Gui, OwnHotkeys: Add, Hotkey, x510 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
7325Gui, OwnHotkeys: Add, Edit, x620 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
7326}
7327Gui, OwnHotkeys: Tab, Seite 2
7328Loop, 8 {
7329index := A_Index + 16
7330active := ownHotkey%index%Active
7331y1 := -20 + (A_Index * 60)
7332y2 := 10 + (A_Index * 60)
7333Gui, OwnHotkeys: Add, CheckBox, x20 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
7334Gui, OwnHotkeys: Add, Hotkey, x20 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
7335Gui, OwnHotkeys: Add, Edit, x130 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
7336}
7337Loop, 8 {
7338index := A_Index + 24
7339active := ownHotkey%index%Active
7340y1 := -20 + (A_Index * 60)
7341y2 := 10 + (A_Index * 60)
7342Gui, OwnHotkeys: Add, CheckBox, x510 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
7343Gui, OwnHotkeys: Add, Hotkey, x510 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
7344Gui, OwnHotkeys: Add, Edit, x620 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
7345}
7346Gui, OwnHotkeys: Tab, Seite 3
7347Loop, 8 {
7348index := A_Index + 32
7349active := ownHotkey%index%Active
7350y1 := -20 + (A_Index * 60)
7351y2 := 10 + (A_Index * 60)
7352Gui, OwnHotkeys: Add, CheckBox, x20 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
7353Gui, OwnHotkeys: Add, Hotkey, x20 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
7354Gui, OwnHotkeys: Add, Edit, x130 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
7355}
7356Loop, 8 {
7357index := A_Index + 40
7358active := ownHotkey%index%Active
7359y1 := -20 + (A_Index * 60)
7360y2 := 10 + (A_Index * 60)
7361Gui, OwnHotkeys: Add, CheckBox, x510 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
7362Gui, OwnHotkeys: Add, Hotkey, x510 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
7363Gui, OwnHotkeys: Add, Edit, x620 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
7364}
7365Menu, OwnHotkeysInformations, Add, &Informationen, OwnHotkeysInformations
7366Gui, OwnHotkeys: Menu, OwnHotkeysInformations
7367Gui, OwnHotkeys: Show, h580 w1010, %projectName% - Eigene Hotkeys - Version %version%
7368}
7369return
7370OwnHotkeysInformations:
7371{
7372MsgBox, 64, Informationen zu eigenen Hotkeys,
7373(LTrim
7374Hier können eigene Hotkeys definiert werden.
7375
7376Das Setzen eines Hakens an der entsprechendene Stelle aktiviert den Hotkey. Im Feld darunter kann der Hotkey eingegeben werden, welcher Ingame gedrückt werden muss, damit der Text in dem Feld daneben ausgeführt wird. Im großen Textfeld daneben kann der Text eingegeben werden, welcher beim Ausführen Ingame an den Chat gesendet wird. Jede Zeile entspricht einer Chat-Nachricht.
7377
7378Es können folgende Platzhalter verwendet werden:
7379[name] - Dein Name
7380[id] - Deine ID
7381[ping] - Dein Ping
7382[hp] - Deine HP
7383[armour] - Deine Armour
7384[zone] - Deine Zone
7385[city] - Deine Stadt
7386[location] - Dein Autenthaltsort (Zone+Stadt)
7387[money] - Dein Bargeld
7388[skin] - Deine Skin-ID
7389[weaponid] - Weapon-ID der aktuellen Waffe
7390[weapon] - Name der aktuellen Waffe
7391[freezed] - ja/nein, ob man gefreezed ist
7392[vhealth] - Fahrzeugzustand in Prozent
7393[vmodelid] - Fahrzeug-Modell-ID
7394[vmodel] - Fahrzeug-Modell-Name
7395[vspeed] - Fahrzeug-Geschwindigkeit
7396[fishtime] - Fisch-Zeit
7397
7398[motor] - Führt das Motor-System aus
7399[usepak] - Benutzt ein Erste-Hilfe-Paket (nur wenn weniger als 95 HP)
7400[eatfish] - Isst den nächsten Fisch (Nummer wird auch erhöht)
7401
7402[sleep Zeit] - Macht eine Pause, Zeitangabe in Millisekunden, [sleep 1000] = 1 Sekunde Pause
7403[local] - Führt die Nachricht dahinter lokal aus (nur die aktuelle Zeile)
7404)
7405}
7406return
7407OwnHotkeysSave:
7408{
7409Gui, OwnHotkeys: Submit, NoHide
7410saveErrors := ""
7411Loop, %ownHotkeyCount% {
7412outerIndex := A_Index
7413savedOwnHotkey%outerIndex%Text := StrReplace(ownHotkey%outerIndex%Text, "`n", "~")
7414IniWrite,% ownHotkey%outerIndex%Active, ownhotkeys.ini, %outerIndex%, Active
7415IniWrite,% savedOwnHotkey%outerIndex%Text, ownhotkeys.ini, %outerIndex%, Text
7416name := "ownHotkey" . outerIndex
7417hk := %name%
7418if hk in +,^,!,+^,+!,^!,+^!
7419return
7420if (registeredHotkeys.HasKey(name)) {
7421oldKey := registeredHotkeys[name]
7422Hotkey, %oldKey%, %name%Label, Off
7423}
7424%name%NoMods := ""
7425if (hk == "") {
7426if (registeredHotkeys.HasKey(name)) {
7427registeredHotkeys.Delete(name)
7428}
7429IniDelete, ownhotkeys.ini, %outerIndex%, Hotkey
7430} else {
7431alreadyRegistered := false
7432for key, value in registeredHotkeys {
7433hk2 := StrReplace(hk, "~", "")
7434value2 := StrReplace(value, "~", "")
7435if (hk2 = value2 && StrLen(hk2) == StrLen(value2)) {
7436if (name != key) {
7437alreadyRegistered := true
7438alreadyRegisteredKey := key
7439break
7440}
7441}
7442}
7443if (!InStr(hk, "F") && !InStr(hk, "!"))
7444hk := "~" . hk
7445StringReplace, %name%NoMods, hk, ~
7446IniWrite, %hk%, ownhotkeys.ini, %outerIndex%, Hotkey
7447if (!alreadyRegistered) {
7448if (ownHotkey%outerIndex%Active) {
7449Hotkey, %hk%, %name%Label
7450registeredHotkeys[name] := hk
7451}
7452} else {
7453if (RegExMatch(alreadyRegisteredKey, "ownHotkey(\d+)", key_)) {
7454hotkeyName := "Eigener Hotkey " . key_1
7455} else {
7456hotkeyName := alreadyRegisteredKey
7457}
7458saveErrors .= "`nEigener Hotkey " . outerIndex . " (" . getUserFriendlyHotkeyName(hk) . ") belegt bei: " . hotkeyName
7459}
7460}
7461}
7462if (saveErrors != "") {
7463message := "Die Daten wurden gespeichert, jedoch können folgende Hotkeys nicht aktiviert werden, da sie bereits belegt sind:`n" . saveErrors
7464} else {
7465message := "Alle Eingaben und Daten wurden erfolgreich gespeichert!"
7466}
7467MsgBox, 64, Speicherung, %message%
7468Gui, OwnHotkeys: Destroy
7469}
7470return
7471OwnHotkeysGuiClose:
7472{
7473Gui, OwnHotkeys: Destroy
7474}
7475return
7476ownHotkey1Label:
7477ownHotkey(1)
7478return
7479ownHotkey2Label:
7480ownHotkey(2)
7481return
7482ownHotkey3Label:
7483ownHotkey(3)
7484return
7485ownHotkey4Label:
7486ownHotkey(4)
7487return
7488ownHotkey5Label:
7489ownHotkey(5)
7490return
7491ownHotkey6Label:
7492ownHotkey(6)
7493return
7494ownHotkey7Label:
7495ownHotkey(7)
7496return
7497ownHotkey8Label:
7498ownHotkey(8)
7499return
7500ownHotkey9Label:
7501ownHotkey(9)
7502return
7503ownHotkey10Label:
7504ownHotkey(10)
7505return
7506ownHotkey11Label:
7507ownHotkey(11)
7508return
7509ownHotkey12Label:
7510ownHotkey(12)
7511return
7512ownHotkey13Label:
7513ownHotkey(13)
7514return
7515ownHotkey14Label:
7516ownHotkey(14)
7517return
7518ownHotkey15Label:
7519ownHotkey(15)
7520return
7521ownHotkey16Label:
7522ownHotkey(16)
7523return
7524ownHotkey17Label:
7525ownHotkey(17)
7526return
7527ownHotkey18Label:
7528ownHotkey(18)
7529return
7530ownHotkey19Label:
7531ownHotkey(19)
7532return
7533ownHotkey20Label:
7534ownHotkey(20)
7535return
7536ownHotkey21Label:
7537ownHotkey(21)
7538return
7539ownHotkey22Label:
7540ownHotkey(22)
7541return
7542ownHotkey23Label:
7543ownHotkey(23)
7544return
7545ownHotkey24Label:
7546ownHotkey(24)
7547return
7548ownHotkey25Label:
7549ownHotkey(25)
7550return
7551ownHotkey26Label:
7552ownHotkey(26)
7553return
7554ownHotkey27Label:
7555ownHotkey(27)
7556return
7557ownHotkey28Label:
7558ownHotkey(28)
7559return
7560ownHotkey29Label:
7561ownHotkey(29)
7562return
7563ownHotkey30Label:
7564ownHotkey(30)
7565return
7566ownHotkey31Label:
7567ownHotkey(31)
7568return
7569ownHotkey32Label:
7570ownHotkey(32)
7571return
7572ownHotkey33Label:
7573ownHotkey(33)
7574return
7575ownHotkey34Label:
7576ownHotkey(34)
7577return
7578ownHotkey35Label:
7579ownHotkey(35)
7580return
7581ownHotkey36Label:
7582ownHotkey(36)
7583return
7584ownHotkey37Label:
7585ownHotkey(37)
7586return
7587ownHotkey38Label:
7588ownHotkey(38)
7589return
7590ownHotkey39Label:
7591ownHotkey(39)
7592return
7593ownHotkey40Label:
7594ownHotkey(40)
7595return
7596ownHotkey41Label:
7597ownHotkey(41)
7598return
7599ownHotkey42Label:
7600ownHotkey(42)
7601return
7602ownHotkey43Label:
7603ownHotkey(43)
7604return
7605ownHotkey44Label:
7606ownHotkey(44)
7607return
7608ownHotkey45Label:
7609ownHotkey(45)
7610return
7611ownHotkey46Label:
7612ownHotkey(46)
7613return
7614ownHotkey47Label:
7615ownHotkey(47)
7616return
7617ownHotkey48Label:
7618ownHotkey(48)
7619return
7620HelpGUI:
7621{
7622Gui, Help: Destroy
7623cheatsheet := URLDownloadToVar(baseURL . "downloads/Cheatsheet.txt")
7624StringReplace, cheatsheet, cheatsheet, ', `r`n, All
7625Gui, Help: Color, white
7626Gui, Help: Font, S10 CDefault, Verdana
7627Gui, Help: Add, Button, x240 y450 w220 h40 gSaveCheatsheet, Speichern (Cheatsheet.txt)
7628Gui, Help: Add, Button, x470 y450 w140 h40 gHelpGuiClose, Schließen
7629Gui, Help: Add, Groupbox, x10 y10 w600 h430, Befehle und Funktionen des Keybinders (Standardkonfiguration)
7630Gui, Help: Add, Edit, x20 y30 w580 h400 ReadOnly, %cheatsheet%
7631Gui, Help: Show, w620 h500, %projectName% - Hilfe - Version: %version%
7632}
7633return
7634SaveCheatsheet:
7635{
7636IfExist, Cheatsheet.txt
7637{
7638FileDelete, Cheatsheet.txt
7639}
7640FileAppend, %cheatsheet%, Cheatsheet.txt
7641MsgBox, 0, Speichern erfolgreich, Das Cheatsheet mit den Befehlen und Hotkeys wurde erfolgreich im Ordner des Keybinders gespeichert!
7642}
7643HelpGuiClose:
7644{
7645Gui, Help: Destroy
7646}
7647return
7648NewsGUI:
7649{
7650Gui, News: Destroy
7651msg := URLDownloadToVar(baseURL . "api/getnews?username=" . username . "&password=" . password)
7652StringReplace, news, msg, ', `r`n, All
7653Gui, News: Color, white
7654Gui, News: Font, S10 CDefault, Verdana
7655Gui, News: Add, Button, x470 y450 w140 h40 gNewsGuiClose, Schließen
7656Gui, News: Add, Groupbox, x10 y10 w600 h430, Neuigkeiten und Informationen
7657Gui, News: Add, Edit, x20 y30 w580 h400 ReadOnly, %news%
7658Gui, News: Show, w620 h500, %projectName% - News - Version: %version%
7659}
7660return
7661NewsGuiClose:
7662{
7663Gui, News: Destroy
7664}
7665return
7666RPGConnect:
7667{
7668RegRead GTA_SA_EXE, HKEY_CURRENT_USER, Software\SAMP, gta_sa_exe
7669SplitPath, GTA_SA_EXE,, PFAD
7670run, %PFAD%\samp.exe server.rpg-city.de, %PFAD%
7671}
7672return
7673AntiDecompile:
7674{
7675if (WinExist("Cheat Engine") || WinExist("OllyDbg") || WinExist("Process Hacker") || WinExist("Resource Hacker") || WinExist("idapro") || WinExist("ArtMoney") || WinExist("WPE PRO") || WinExist("Ressourcenmonitor") || WinExist("Exe2ahk")) {
7676clipboard =
7677ExitApp
7678}
7679}
7680return
7681FillCustoms:
7682{
7683if (timeout) {
7684if (isPlayerInAnyVehicle() && isPlayerDriver()) {
7685if (fillSystem
7686&& (isPlayerInRangeOfPoint(700, -1930, 0, 10)
7687|| isPlayerInRangeOfPoint(1833, -2431, 14, 10)
7688|| isPlayerInRangeOfPoint(615, 1689, 7, 10)
7689|| isPlayerInRangeOfPoint(-1328, 2677, 40, 10)
7690|| isPlayerInRangeOfPoint(1596, 2199, 11, 10)
7691|| isPlayerInRangeOfPoint(2202, 2474, 11, 10)
7692|| isPlayerInRangeOfPoint(2114, 920, 11, 10)
7693|| isPlayerInRangeOfPoint(-2408, 976, 45, 10)
7694|| isPlayerInRangeOfPoint(-2029, 156, 29, 10)
7695|| isPlayerInRangeOfPoint(-1676, 414, 7, 10)
7696|| isPlayerInRangeOfPoint(1004, -939, 43, 10)
7697|| isPlayerInRangeOfPoint(1944, -1773, 14, 10)
7698|| isPlayerInRangeOfPoint(-90, -1169, 3, 10)
7699|| isPlayerInRangeOfPoint(-1605, -2714, 49, 10)
7700|| isPlayerInRangeOfPoint(-2243, -2560, 32, 10)
7701|| isPlayerInRangeOfPoint(1381, 457, 20, 10)
7702|| isPlayerInRangeOfPoint(70, 1218, 19, 10)
7703|| isPlayerInRangeOfPoint(1555, -1605, 14, 10))) {
7704SendClientMessage(PREFIX . "Du kannst dein Fahrzeug jetzt durch Drücken der Taste " . SECCOL . "X {FFFFFF}betanken!")
7705KeyWait, X, D, T10
7706if (!ErrorLevel) {
7707timeout := false
7708if (getVehicleEngineState()) {
7709SendChat("/motor")
7710}
7711SendChat("/fill")
7712Sleep, 10000
7713SendChat("/motor")
7714SendChat("/licht")
7715tankTimeout := 0
7716SetTimer, FillCustomsTimer, 5000
7717} else {
7718timeout := true
7719}
7720} else if (customsSystem
7721&& (isPlayerInRangeOfPoint(1733.47, 546.37, 26, 10)
7722|| isPlayerInRangeOfPoint(1741.11, 543.47, 26, 10)
7723|| isPlayerInRangeOfPoint(1744.03, 523.63, 27, 10)
7724|| isPlayerInRangeOfPoint(1752.71, 521.69, 27, 10)
7725|| isPlayerInRangeOfPoint(512.54, 476.62, 18, 10)
7726|| isPlayerInRangeOfPoint(529.22, 467.21, 18, 10)
7727|| isPlayerInRangeOfPoint(-159.79, 414.18, 11, 10)
7728|| isPlayerInRangeOfPoint(-157.44, 392.24, 11, 10)
7729|| isPlayerInRangeOfPoint(-1408.23, 824.19, 47, 10)
7730|| isPlayerInRangeOfPoint(-1414.77, 803.59, 47, 10)
7731|| isPlayerInRangeOfPoint(-2695.05, 1284.63, 55, 10)
7732|| isPlayerInRangeOfPoint(-2686.34, 1284.24, 55, 10)
7733|| isPlayerInRangeOfPoint(-2676.62, 1265.37, 55, 10)
7734|| isPlayerInRangeOfPoint(-2668.18, 1264.91, 55, 10)
7735|| isPlayerInRangeOfPoint(-963.08, -343.05, 36, 10)
7736|| isPlayerInRangeOfPoint(-968.00, -322.33, 36, 10)
7737|| isPlayerInRangeOfPoint(-71.76, -892.47, 15, 10)
7738|| isPlayerInRangeOfPoint(-68.74, -867.96, 15, 10)
7739|| isPlayerInRangeOfPoint(100.20, -1284.37, 14, 10)
7740|| isPlayerInRangeOfPoint(94.40, -1277.82, 14, 10)
7741|| isPlayerInRangeOfPoint(97.19, -1254.11, 14, 10)
7742|| isPlayerInRangeOfPoint(94.69, -1245.59, 14, 10)
7743|| isPlayerInRangeOfPoint(42.71, -1537.98, 5, 10)
7744|| isPlayerInRangeOfPoint(58.02, -1524.93, 5, 10))) {
7745SendClientMessage(PREFIX . "Du kannst den Zoll jetzt durch Drücken der Taste " . SECCOL . "X {FFFFFF}öffnen!")
7746KeyWait, X, D, T10
7747if (!ErrorLevel) {
7748timeout := false
7749Sleep, 100
7750SendChat("/zoll")
7751Sleep, 200
7752chat := readChatLine(0)
7753if (RegExMatch(chat, "Es ist keine Zollstation in deiner Nähe\.")) {
7754Sleep, 800
7755SendChat("/zoll")
7756}
7757tankTimeout := 0
7758SetTimer, FillCustomsTimer, 5000
7759} else {
7760timeout := true
7761}
7762}
7763}
7764}
7765}
7766return
7767FillCustomsTimer:
7768{
7769tankTimeout++
7770if (tankTimeout >= 4) {
7771SetTimer, FillCustomsTimer, off
7772timeout := true
7773}
7774}
7775return
7776TankTimer:
7777{
7778if (isPlayerInAnyVehicle() && isPlayerDriver()) {
7779if (!updateTextDraws())
7780return
7781oReplace := ["~s~", "~r~", "~w~", "~h~", "~g~", "~y~", "~n~", "~b~", " ", " "]
7782For i, o in oTextDraws
7783{
7784Loop % oReplace.MaxIndex() {
7785o := StrReplace(o, oReplace[A_Index], " ")
7786}
7787if (RegExMatch(o, "Tank: (\S+)\/(\d+) L", tank_)) {
7788if (tank_1 <= 5 && oldTank != Ceil(tank_1)) {
7789SendClientMessage(PREFIX . "Achtung! Dein Tank ist fast leer, es befinde" . (tank_1 == 1 ? "t" : "n") . " sich nur noch " . SECCOL . tank_1 . " Liter {FFFFFF}darin.")
7790oldTank := Ceil(tank_1)
7791break
7792}
7793}
7794}
7795}
7796}
7797return
7798HealTimer:
7799{
7800if (IsPlayerInRangeOfPoint(225, 121, 999, 5) || IsPlayerInRangeOfPoint(255, 77, 1003, 5) || IsPlayerInRangeOfPoint(197, 168, 1003, 5)) {
7801AddChatMessage(PREFIX . "Möchtest du dich nun healen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
7802KeyWait, X, D, T30
7803if (!ErrorLevel) {
7804SendChat("/heal")
7805}
7806Sleep, 25000
7807}
7808}
7809return
7810ChatTimer:
7811{
7812IfWinNotActive, GTA:SA:MP
7813return
7814if (chatLogFile.Length < chatLogLines.Length()) {
7815chatLogFile := FileOpen(A_MyDocuments . "\GTA San Andreas User Files\SAMP\chatlog.txt", "r")
7816chatLogLines := []
7817}
7818while (!chatLogFile.AtEOF) {
7819line := chatLogFile.ReadLine()
7820line := RegExReplace(line, "U)^\[\d{2}:\d{2}:\d{2}\] ")
7821line := StrReplace(line, "`r`n")
7822line := StrReplace(line, "`r")
7823line := RegExReplace(line, "{\S{6}}", "")
7824if (line != "") {
7825chatLogLines.Push(line)
7826if (!firstChatLogRun) {
7827handleChatMessage(line, chatLogLines.Length(), chatLogLines)
7828}
7829}
7830}
7831firstChatLogRun := false
7832if (mdc.Length() > mdcOverlayLines) {
7833mdc.RemoveAt(1)
7834}
7835}
7836return
7837handleChatMessage(message, index, arr) {
7838global
7839if (RegExMatch(message, "^WARNUNG: Hör auf zu Spamen, sonst wirst du gekickt!$")) {
7840if (antispamSystem) {
7841blockChatInput()
7842SendClientMessage(PREFIX . "Spamschutz-System {00FF00}aktiviert{FFFFFF}!")
7843SetTimer, SpamTimer, -1500
7844}
7845} else if (RegExMatch(message, "^\* Sanitäter (\S+) bietet dir ein Erste-Hilfe-Paket für \$(\d+) an\. Benutze \/accept Paket$", message_)) {
7846medicName := message_1
7847SetTimer, PaketTimer, -1
7848} else if (RegExMatch(message, "^\* \$(\d+) werden am nächsten Payday Gutgeschrieben\.$", stats_)) {
7849IniRead, pilotXP, stats.ini, Pilot, XP, 0
7850IniRead, pilotMoney, stats.ini, Pilot, Geld, 0
7851pilotXP++
7852pilotMoney += stats_1
7853paydayMoney += stats_1
7854IniWrite, %pilotXP%, stats.ini, Pilot, XP
7855IniWrite, %pilotMoney%, stats.ini, Pilot, Geld
7856SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(pilotXP) . " {FFFFFF}Runden geflogen und hast ingesamt " . SECCOL . FormatNumber(pilotMoney) . "$ {FFFFFF}(brutto) verdient.")
7857} else if (RegExMatch(message, "^Du hast (\S+) Kubikmeter Müll abgeliefert und erhälst am nächsten Payday (\d+)\$\.$", stats_)) {
7858IniRead, garbageXP, stats.ini, Müllmann, XP, 0
7859IniRead, garbageKubik, stats.ini, Müllmann, Kubik, 0
7860IniRead, garbageMoney, stats.ini, Müllmann, Geld, 0
7861garbageXP++
7862garbageKubik += stats_1
7863garbageMoney += stats_2
7864paydayMoney += stats_2
7865IniWrite, %garbageXP%, stats.ini, Müllmann, XP
7866IniWrite, %garbageKubik%, stats.ini, Müllmann, Kubik
7867IniWrite, %garbageMoney%, stats.ini, Müllmann, Geld
7868SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(garbageXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(garbageMoney) . "$ {FFFFFF}(brutto) verdient.")
7869SendClientMessage(PREFIX . "Du hast ingesamt " . SECCOL . Round(garbageKubik, 1) . " Kubik {FFFFFF}abgeliefert.")
7870} else if (RegExMatch(message, "In der Nähe vom Hafen kannst du keine Reuse auslegen\.")) {
7871playerCoords := getCoordinates()
7872distance := Round(getDistanceToPoint(-2330, 2207, 5, playerCoords[1], playerCoords[2], playerCoords[3]))
7873SendClientMessage(PREFIX . "Du bist noch zu nah am Hafen. Fahre noch " . SECCOL . (500 - distance) . "m")
7874} else if (RegExMatch(message, "Du legst Reuse (\d+) an dieser Position aus\.", message_)) {
7875fishTraps[message_1] := getCoordinates()
7876SendClientMessage(PREFIX . "Reuse " . message_1 . " wurde hier erfolgreich ausgelegt. Fahre 400m um die nächste Reuse auslegen zu können.")
7877} else if (RegExMatch(message, "Du hast bereits in der Nähe eine Reuse ausgelegt\.")) {
7878playerCoords := getCoordinates()
7879nearest := false
7880nearestDistance := 10000000
7881for index, entry in fishTraps {
7882if (entry) {
7883distance := getDistanceToPoint(playerCoords[1], playerCoords[2], playerCoords[3], entry[1], entry[2], entry[3])
7884if (distance < nearestDistance) {
7885nearest := entry
7886nearestDistance := distance
7887}
7888}
7889}
7890if (nearest) {
7891SendClientMessage(PREFIX . "Du bist noch zu nah an der letzten Reuse. Fahre noch " . SECCOL . (400 - Round(nearestDistance)) . "m")
7892}
7893} else if (RegExMatch(message, "^(.+): (\d+) \((\d+)\$\)$")) {
7894Loop, 20 {
7895fishing := arr[index - A_Index]
7896if (RegExMatch(fishing, "^Du hast deine Fische am Hafen verkauft und erhälst am nächsten Payday (\d+)\$\.$", fishing_)) {
7897IniRead, fishingXP, stats.ini, Hochseefischer, XP, 0
7898IniRead, fishingMoney, stats.ini, Hochseefischer, Geld, 0
7899fishingXP++
7900fishingMoney += fishing_1
7901paydayMoney += fishing_1
7902IniWrite, %fishingXP%, stats.ini, Hochseefischer, XP
7903IniWrite, %fishingMoney%, stats.ini, Hochseefischer, Geld
7904SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(fishingXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(fishingMoney) . "$ {FFFFFF}(brutto) verdient.")
7905fishingFull := false
7906break
7907} else if (RegExMatch(fishing, "^(\S+): (\d+) \((\d+)\$\)$", fishing_)) {
7908IniRead, fishStats, stats.ini, Hochseefischer, %fishing_1%, 0
7909fishStats += fishing_2
7910IniWrite, %fishStats%, stats.ini, Hochseefischer, %fishing_1%
7911}
7912}
7913} else if (RegExMatch(message, "^Bitte warten\.\.$")) {
7914statsLine1 := arr[index - 1]
7915if (RegExMatch(statsLine1, "^Du ziehst nun Reuse (\d+) aus dem Wasser\.$", statsLine1_)) {
7916fishTraps[statsLine1_1] := false
7917}
7918} else if (RegExMatch(message, "^Es passen keine Fische mehr in das Boot, die restlichen Fische in der Reuse wurden freigelassen\.$")) {
7919fishingFull := true
7920} else if (RegExMatch(message, "^Du hast den Auftrag (\d+) \((.+)\) abgeschlossen und erhälst am nächsten Payday (\d+)\$\.$", stats_)) {
7921IniRead, truckerXP, stats.ini, Trucker, XP, 0
7922IniRead, truckerMoney, stats.ini, Trucker, Geld, 0
7923truckerXP++
7924truckerMoney += stats_3
7925paydayMoney += stats_3
7926IniWrite, %truckerXP%, stats.ini, Trucker, XP
7927IniWrite, %truckerMoney%, stats.ini, Trucker, Geld
7928SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(truckerXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(truckerMoney) . "$ {FFFFFF}(brutto) verdient.")
7929} else if (RegExMatch(message, "^\* Du hast die Fahrt Beendet\. \$(\d+) werden am nächsten Payday Gutgeschrieben!$", stats_)) {
7930IniRead, trainXP, stats.ini, Zugfahrer, XP, 0
7931IniRead, trainMoney, stats.ini, Zugfahrer, Geld, 0
7932trainXP++
7933trainMoney += stats_1
7934paydayMoney += stats_1
7935IniWrite, %trainXP%, stats.ini, Zugfahrer, XP
7936IniWrite, %trainMoney%, stats.ini, Zugfahrer, Geld
7937SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(trainXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(trainMoney) . "$ {FFFFFF}(brutto) verdient.")
7938} else if (RegExMatch(message, "^Total: (\d+)\$$", stats_)) {
7939Loop, 10 {
7940gardener := arr[index - A_Index]
7941if (RegExMatch(gardener, "^--------------- Gärtner: Gehaltscheck ---------------$")) {
7942IniRead, gardenerXP, stats.ini, Gärtner, XP, 0
7943IniRead, gardenerMoney, stats.ini, Gärtner, Geld, 0
7944IniRead, gardenerMaxMoney, stats.ini, Gärtner, Höchstverdienst, 0
7945if (stats_1 > gardenerMaxMoney) {
7946SendClientMessage(PREFIX . "Das war bisher deine beste Tour! Neuer Höchstverdienst: " . SECCOL . FormatNumber(stats_1) . "$")
7947IniWrite, %stats_1%, stats.ini, Gärtner, Höchstverdienst
7948}
7949gardenerXP++
7950gardenerMoney += stats_1
7951paydayMoney += stats_1
7952IniWrite, %gardenerXP%, stats.ini, Gärtner, XP
7953IniWrite, %gardenerMoney%, stats.ini, Gärtner, Geld
7954SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(gardenerXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(gardenerMoney) . "$ {FFFFFF}(brutto) verdient.")
7955break
7956}
7957}
7958} else if (RegExMatch(message, "^\[Gärtner\]: Die Runde wurde beendet und du erhältst (.+) deines Fortschrittes \((\d+)\$\) am nächsten Payday ausgezahlt\.$", message_)) {
7959if (message_2 > 0) {
7960IniRead, gardenerXP, stats.ini, Gärtner, XP, 0
7961IniRead, gardenerMoney, stats.ini, Gärtner, Geld, 0
7962IniRead, gardenerMaxMoney, stats.ini, Gärtner, Höchstverdienst, 0
7963if (message_2 > gardenerMaxMoney) {
7964SendClientMessage(PREFIX . "Das war bisher deine beste Tour! Neuer Höchstverdienst: " . SECCOL . FormatNumber(message_2) . "$")
7965IniWrite, %message_2%, stats.ini, Gärtner, Höchstverdienst
7966}
7967gardenerXP++
7968gardenerMoney += message_2
7969paydayMoney += message_2
7970IniWrite, %gardenerXP%, stats.ini, Gärtner, XP
7971IniWrite, %gardenerMoney%, stats.ini, Gärtner, Geld
7972SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(gardenerXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(gardenerMoney) . "$ {FFFFFF}(brutto) verdient.")
7973}
7974} else if (RegExMatch(message, "^Gesamte XP: (\d+) \(\+(\d+) XP\)$", message_)) {
7975IniWrite, %stats_1%, stats.ini, Farmer, XP
7976farmer := arr[index - 1]
7977if (RegExMatch(farmer, "^Total: (\d+)\$\.$", farmer_)) {
7978IniRead, farmerMoney, stats.ini, Farmer, Geld, 0
7979IniRead, farmerMaxMoney, stats.ini, Farmer, Höchstverdienst, 0
7980if (farmer_1 > farmerMaxMoney) {
7981SendClientMessage(PREFIX . "Das war bisher deine beste Tour! Neuer Höchstverdienst: " . SECCOL . FormatNumber(farmer_1) . "$")
7982IniWrite, %farmer_1%, stats.ini, Farmer, Höchstverdienst
7983}
7984farmerMoney += farmer_1
7985paydayMoney += farmer_1
7986IniWrite, %farmerMoney%, stats.ini, Farmer, Geld
7987SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(message_1) . " {FFFFFF}Touren gefahren und hast ingesamt " . SECCOL . FormatNumber(farmerMoney) . "$ {FFFFFF}(brutto) verdient.")
7988}
7989} else if (RegExMatch(message, "^Du hast (\d+)g Waffenstahl für deine (\d+) Pakete erhalten\.$", chatLine0_)) {
7990IniRead, matsFarmed, stats.ini, Materialien, Waffenstahl, 0
7991matsFarmed += chatLine0_1
7992IniWrite, %matsFarmed%, stats.ini, Materialien, Waffenstahl
7993SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(matsFarmed) . "g {FFFFFF}Waffenstahl gefarmt. Du musst diese nun am Lagerhaus abliefern.")
7994} else if (RegExMatch(message, "^Fehler: Du hast keine Pakete bei dir\. Kaufe Pakete mit \/materials get\.$")) {
7995SendChat("/materials get")
7996} else if (RegExMatch(message, "^Fehler: Du transportierst keine Pakete im Fahrzeug\.$")) {
7997SendChat("/materials get")
7998} else if (RegExMatch(message, "^Du hast (\d+) Materialien-Pakete für (\d+)\$ erworben\. Du (\S+) nun (\d+) Pakete (.+)\.$", message_)) {
7999IniRead, matsBought, stats.ini, Materialien, AnzahlGekauft, 0
8000IniRead, moneySpent, stats.ini, Materialien, Ausgaben, 0
8001matsBought += message_1
8002moneySpent += message_2
8003IniWrite, %matsBought%, stats.ini, Materialien, AnzahlGekauft
8004IniWrite, %moneySpent%, stats.ini, Materialien, Ausgaben
8005SendClientMessage(PREFIX . "Du hast erfolgreich " . SECCOL . FormatNumber(message_1) . " {FFFFFF}Materialpakete für " . SECCOL . FormatNumber(message_2) . "$ {FFFFFF}gekauft.")
8006SendClientMessage(PREFIX . "Gesamte Anzahl gekaufter Materialpakete: " . SECCOL . FormatNumber(matsBought) . " {FFFFFF}Gesamtausgaben: " . SECCOL . FormatNumber(moneySpent) . "$")
8007} else if (RegExMatch(message, "^Du hast (\d+)g Waffenstahl im Crew Lager abgeliefert \(\+(\d+) XP\)\.$", message_)) {
8008IniRead, matsXP, stats.ini, Materialien, XP, 0
8009IniRead, mats, stats.ini, Materialien, Anzahl, 0
8010matsXP += message_2
8011mats += message_1
8012IniWrite, %matsXP%, stats.ini, Materialien, XP
8013IniWrite, %mats%, stats.ini, Materialien, Anzahl
8014SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(matsXP) . " EXP {FFFFFF}gesammelt und " . SECCOL . FormatNumber(mats) . "g {FFFFFF}Materialien am Crewlager abgeliefert.")
8015} else if (RegExMatch(message, "^Du hast (\d+) Produkte für (\d+)\$ gekauft\.$", message_)) {
8016IniRead, prodBought, stats.ini, Produkte, Gekauft, 0
8017IniRead, moneySpent, stats.ini, Produkte, Ausgaben, 0
8018prodBought += message_1
8019moneySpent += message_2
8020IniWrite, %prodBought%, stats.ini, Produkte, Gekauft
8021IniWrite, %moneySpent%, stats.ini, Produkte, Ausgaben
8022SendClientMessage(PREFIX . "Du hast erfolgreich " . SECCOL . FormatNumber(message_1) . " {FFFFFF}Produkte für " . SECCOL . FormatNumber(message_2) . "$ {FFFFFF}gekauft.")
8023SendClientMessage(PREFIX . "Gesamte Anzahl gekaufter Produkte: " . SECCOL . FormatNumber(prodBought) . " {FFFFFF}Gesamtausgaben: " . SECCOL . FormatNumber(moneySpent) . "$")
8024} else if (RegExMatch(message, "^Du hast (\d+) Produkte im Crew Lager abgeliefert\.$", message_)) {
8025IniRead, prods, stats.ini, Produkte, Anzahl, 0
8026prods += message_1
8027IniWrite, %prods%, stats.ini, Produkte, Anzahl
8028SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(prods) . " {FFFFFF}Produkte am Crewlager abgeliefert.")
8029} else if (RegExMatch(message, "^Du hast (\d+) L Rohöl für (\d+)\$ gekauft\.$", message_)) {
8030IniRead, oilBought, stats.ini, Oil, Gekauft, 0
8031IniRead, moneySpent, stats.ini, Oil, Ausgaben, 0
8032oilBought += message_1
8033moneySpent += message_2
8034IniWrite, %oilBought%, stats.ini, Oil, Gekauft
8035IniWrite, %moneySpent%, stats.ini, Oil, Ausgaben
8036SendClientMessage(PREFIX . "Du hast erfolgreich " . SECCOL . FormatNumber(message_1) . " Liter {FFFFFF}Rohöl für " . SECCOL . FormatNumber(message_2) . "$ {FFFFFF}gekauft.")
8037SendClientMessage(PREFIX . "Gesamte Anzahl gekauftes Rohöl: " . SECCOL . FormatNumber(oilBought) . " Liter {FFFFFF}Gesamtausgaben: " . SECCOL . FormatNumber(moneySpent) . "$")
8038} else if (RegExMatch(message, "^Du hast (\d+) L Rohöl im Crew Lager abgeliefert\.$", stats_)) {
8039IniRead, oil, stats.ini, Oil, Liter, 0
8040oil += stats_1
8041IniWrite, %oil%, stats.ini, Oil, Liter
8042SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(oil) . " Liter {FFFFFF}Rohöl am Crewlager abgeliefert.")
8043} else if (RegExMatch(message, "^Paintball: (\S+) wurde von (\S+) getötet\.$", message_)) {
8044if (message_1 == getUsername()) {
8045IniRead, pbDeaths, stats.ini, Paintball, Tode, 0
8046pbDeaths++
8047IniWrite, %pbDeaths%, stats.ini, Paintball, Tode
8048SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(pbDeaths) . "{FFFFFF}-mal im Paintball gestorben.")
8049if (pbKillStreak > 0 && paintballMessages)
8050SendChat("/l Meine Killstreak war: " . pbKillStreak)
8051pbKillStreak := 0
8052} else if (message_2 == getUsername()) {
8053IniRead, pbKills, stats.ini, Paintball, Kills, 0
8054pbKills++
8055IniWrite, %pbKills%, stats.ini, Paintball, Kills
8056SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(pbKills) . " {FFFFFF}Spieler im Paintball getötet.")
8057pbKillStreak++
8058if (paintballMessages) {
8059IniRead, pbHighestKillStreak, stats.ini, Paintball, Killstreak, 0
8060if (pbKillStreak > pbHighestKillStreak) {
8061IniWrite, %pbKillStreak%, stats.ini, Paintball, Killstreak
8062SendChat("/l Meine neue beste Killstreak: " . pbKillStreak)
8063} else {
8064SendChat("/l Meine Killstreak: " . pbKillStreak)
8065}
8066}
8067}
8068} else if (RegExMatch(message, "^\|=================\|\|============\|\|=================\|$")) {
8069Loop {
8070chat := arr[index - A_Index]
8071if (InStr(chat, "KFZ Steuer:")) {
8072RegExMatch(chat, "KFZ Steuer: -(\d*)\$", car)
8073}
8074if (InStr(chat, "Lohn: ")) {
8075RegExMatch(chat, "Lohn: (\d*)\$ \(davon (\d+\$) Bonus durch Upgrade\) Miete: -(\d*)\$ Lohnsteuer: -(\d*)\$", general)
8076}
8077if (InStr(chat, "Stromrechnung: ")) {
8078RegExMatch(chat, "Stromrechnung: -(.*)\$", electricity)
8079}
8080if (InStr(chat, "|================| Gehalts-Check |================|")) {
8081break
8082}
8083}
8084money := general1
8085money -= general3
8086money -= general4
8087money -= car1
8088money -= electricity1
8089SendClientMessage(PREFIX . "Errechneter Payday: " . SECCOL . FormatNumber(paydayMoney) . "$ {FFFFFF}(Brutto) " . SECCOL . FormatNumber(Round(paydayMoney * taxes)) . "$ {FFFFFF}(Netto)")
8090SendClientMessage(PREFIX . "Gehaltsscheck: " . SECCOL . FormatNumber(money) . "$")
8091paydayMoney := 0
8092} else if (RegExMatch(message, "^ > " . getUsername() . " beobachtet (\S+)\.$")) {
8093tv := true
8094tvName := name_1
8095SendClientMessage(PREFIX . "Beobachtungsmodus aktiviert")
8096} else if (RegExMatch(message, "^ > " . getUsername() . " hat die Beobachtung beendet\.$")) {
8097tv := false
8098SendClientMessage(PREFIX . "Beobachtungsmodus deaktiviert")
8099} else if (RegExMatch(message, "^Leerfahrt$")) {
8100start := -1
8101busLine := -1
8102SendClientMessage(PREFIX . "Du hast deine Linie abgebrochen!")
8103} else if (RegExMatch(message, "^Nächste Haltestelle: (.+)$", chat_)) {
8104if (chat_1 == "Busbahnhof Süd" || chat_1 == "Busbahnhof Ost" || chat_1 == "San Fierro Hauptbahnhof" || chat_1 == "Las Venturas Busbahnhof" || chat_1 == "Foster Valley FZ A" || chat_1 == "Foster Valley FZ B") {
8105if (start == -1) {
8106Sleep, 1000
8107start := getUnixTimestamp(A_Now)
8108tempLine := findLinie()
8109if (tempLine != 0) {
8110busLine := tempLine
8111SendClientMessage(PREFIX . "Du beginnst Linie " . busLine . "!")
8112} else {
8113busLine := -1
8114SendClientMessage(PREFIX . "Deine Linie konnte nicht korrekt erkannt werden, sie wird vorerst ignoriert!")
8115}
8116}
8117} else {
8118if (start != -1 && busLine == -1) {
8119tempLine := findLinie()
8120if (tempLine != 0) {
8121busLine := tempLine
8122SendClientMessage(PREFIX . "Deine Linie wurde soeben erkannt: Linie " . busLine)
8123}
8124}
8125}
8126} else if (RegExMatch(message, "^\* Du erhälst am nächsten Payday (\d+)\$ gutgeschrieben\. Erhaltene Exp: (\d+)$", chat_)) {
8127if (start != -1) {
8128IniRead, busRounds, stats.ini, Busfahrer, Runden, 0
8129IniRead, busMoney, stats.ini, Busfahrer, Geld, 0
8130busRounds++
8131busMoney += chat_1
8132paydayMoney += chat_1
8133IniWrite, %busRounds%, stats.ini, Busfahrer, Runden
8134IniWrite, %busMoney%, stats.ini, Busfahrer, Geld
8135end := getUnixTimestamp(A_Now)
8136diff := end - start
8137SendClientMessage(PREFIX . "Du hast Linie " . busLine . " für " . SECCOL . FormatNumber(chat_1) . "$ {FFFFFF}beendet und " . SECCOL . chat_2 . " EXP {FFFFFF}erhalten. Zeit: " . SECCOL . formatTime(diff))
8138SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(busRounds) . " Runden {FFFFFF}gefahren und hast " . SECCOL . FormatNumber(busMoney) . "$ {FFFFFF}verdient.")
8139if (busSendToJobChat) {
8140SendChat("/j Ich habe Linie " . busLine . " für " . FormatNumber(chat_1) . "$ beendet und " . chat_2 . " EXP erhalten. Zeit: " . formatTime(diff))
8141}
8142start := -1
8143if (busRestartLine) {
8144if (busLine == 4) {
8145busLine := 5
8146} else if (busLine == 5) {
8147busLine := 4
8148} else if (busLine == 8) {
8149busLine := 9
8150} else if (busLine == 9) {
8151busLine := 8
8152} else if (busLine == 13) {
8153busLine := 14
8154} else if (busLine == 14) {
8155busLine := 13
8156} else if (busLine == 16) {
8157busLine := 17
8158} else if (busLine == 17) {
8159busLine := 16
8160} else if (busLine == 19) {
8161busLine := 20
8162} else if (busLine == 20) {
8163busLine := 19
8164}
8165selectLine(busLine)
8166}
8167}
8168} else if (RegExMatch(message, "^\* Du hast (\S+) ein Ticket für (\d+)\$ gegeben, Grund: (.+)$", line0_)) {
8169if (RegExMatch(line0_3, "Wanted-Ticket \((\d+) Wanteds?\)", wanteds_)) {
8170wantedTicket := []
8171wantedTicket["name"] := line0_1
8172wantedTicket["wanteds"] := wanteds_1
8173wantedTickets.Push(wantedTicket)
8174}
8175tickets := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=tickets")
8176IniWrite, %tickets%, stats.ini, Vergaben, Tickets
8177SendClientMessage(PREFIX . "Dies war dein " . SECCOL . FormatNumber(tickets) . ". {FFFFFF}ausgestelltes Ticket.")
8178} else if (RegExMatch(message, "^\* (\S+) hat dein Ticket in Höhe von (\d+)\$ bezahlt\.$", line0_)) {
8179ticketMoney := line0_2
8180paydayMoney += ticketMoney
8181payPartnerMoney(ticketMoney, "ticket_money")
8182tickets_accepted := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=tickets_accepted")
8183IniWrite, %tickets_accepted%, stats.ini, Vergaben, TicketsAkzeptiert
8184SendClientMessage(PREFIX . "Es wurden bereits " . SECCOL . FormatNumber(tickets_accepted) . " Tickets{FFFFFF}, die du ausgestellt hast, akzeptiert.")
8185wantedTicketId := -1
8186for index, wantedTicket in wantedTickets
8187{
8188if (line0_1 == wantedTicket["name"]) {
8189wantedTicketId := index
8190if (!admin)
8191Sleep, 500
8192SendChat("/clear " . wantedTicket["name"] . " " . wantedTicket["wanteds"])
8193break
8194}
8195}
8196if (wantedTicketId != -1)
8197wantedTickets.RemoveAt(wantedTicketId)
8198} else if (RegExMatch(message, "^\* Du hast (\S+) seinen Flugschein weggenommen\.$")) {
8199fstakes := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=fstakes")
8200IniWrite, %fstakes%, stats.ini, Scheine, Flugschein
8201SendClientMessage(PREFIX . "Dies war dein " . SECCOL . FormatNumber(fstakes) . ". {FFFFFF}entzogener Flugschein.")
8202} else if (RegExMatch(message, "^\* (\S+) nimmt Geld aus seiner Tasche und gibt es " . getUsername() . "\.$", line0_)) {
8203if (RegExMatch(arr[index - 1], "^Du hast (\d+)\$ von (\S+)\((\d+)\) erhalten\.$", line1_)) {
8204playerCoords := getCoordinates()
8205if (getDistanceToPoint(playerCoords[1], playerCoords[2], playerCoords[3], 1564.5, -1694.5, 6.5) < 15) {
8206} else if (getDistanceToPoint(playerCoords[1], playerCoords[2], playerCoords[3], -1589.5, 716, -4.5) < 15) {
8207} else if (getDistanceToPoint(playerCoords[1], playerCoords[2], playerCoords[3], 2281.5, 2431, 4) < 15) {
8208} else {
8209return
8210}
8211arrested := false
8212Loop, 10 {
8213chat := arr[index - A_Index]
8214if (RegExMatch(chat, "^\[HQ\]: (.+) " . line0_1 . " hat den Verdächtigen (\S+) eingesperrt\.$", chat_)) {
8215arrested := true
8216}
8217}
8218if (arrested) {
8219arrestMoney := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=arrest_money&value=" . line1_1)
8220IniWrite, %arrestMoney%, stats.ini, Arrests, Geld
8221SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(arrestMoney) . "$ {FFFFFF}durch Verhaftungen verdient.")
8222Sleep, 100
8223arrests := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=arrests")
8224IniWrite, %arrests%, stats.ini, Arrests, Arrest
8225SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(arrests) . " {FFFFFF}Verbrecher eingesperrt.")
8226}
8227}
8228} else if (RegExMatch(message, "^\* Du hast (\S+) seinen Bootschein weggenommen\.$")) {
8229bstakes := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=bstakes")
8230IniWrite, %bstakes%, stats.ini, Scheine, Bootsschein
8231SendClientMessage(PREFIX . "Dies war dein " . SECCOL . FormatNumber(bstakes) . ". {FFFFFF}entzogener Bootsschein.")
8232} else if (RegExMatch(message, "^\* Du hast (\S+) seinen Waffenschein weggenommen\.$")) {
8233wstakes := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=wstakes")
8234IniWrite, %wstakes%, stats.ini, Scheine, Waffenschein
8235SendClientMessage(PREFIX . "Dies war dein " . SECCOL . FormatNumber(wstakes) . ". {FFFFFF}entzogener Waffenschein.")
8236} else if (RegExMatch(message, "^\* Du hast (\S+) seine (\d+)g Drogen weggenommen\.$", line0_)) {
8237for index, value in checkingPlayers {
8238if (line0_1 == value) {
8239return
8240}
8241}
8242drugs := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=drugs&value=" . line0_2)
8243IniWrite, %drugs%, stats.ini, Kontrollen, Drogen
8244SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(drugs) . "g {FFFFFF}Drogen weggenommen.")
8245} else if (RegExMatch(message, "^\* Du hast (\S+) seine (\d+) Samen weggenommen\.$", line0_)) {
8246for index, value in checkingPlayers {
8247if (line0_1 == value) {
8248return
8249}
8250}
8251seeds := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=seeds&value=" . line0_2)
8252IniWrite, %seeds%, stats.ini, Kontrollen, Samen
8253SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(seeds) . " {FFFFFF}Samen weggenommen.")
8254} else if (RegExMatch(message, "^\* Du hast (\S+) seine (\d+) Materialien weggenommen\.$", line0_)) {
8255for index, value in checkingPlayers {
8256if (line0_1 == value) {
8257return
8258}
8259}
8260mats := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=mats&value=" . line0_2)
8261IniWrite, %mats%, stats.ini, Kontrollen, Materialien
8262SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(mats) . " {FFFFFF}Materialien weggenommen.")
8263} else if (RegExMatch(message, "^\* Du hast (\S+) seine (\d+) Materialpakete weggenommen\.$", line0_)) {
8264for index, value in checkingPlayers {
8265if (line0_1 == value) {
8266return
8267}
8268}
8269matpackets := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=matpackets&value=" . line0_2)
8270IniWrite, %matpackets%, stats.ini, Kontrollen, Materialpakete
8271SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(matpackets) . " {FFFFFF}Materialpakete weggenommen.")
8272} else if (RegExMatch(message, "^Du hast (\d+) (.+) aus dem Kofferraum konfisziert\.$", message_)) {
8273if (message_2 == "Materialien") {
8274mats := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=mats&value=" . message_1)
8275IniWrite, %mats%, stats.ini, Kontrollen, Materialien
8276SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(mats) . " {FFFFFF}Materialien weggenommen.")
8277} else if (message_2 == "Gramm Drogen") {
8278drugs := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=drugs&value=" . message_1)
8279IniWrite, %drugs%, stats.ini, Kontrollen, Drogen
8280SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(drugs) . "g {FFFFFF}Drogen weggenommen.")
8281}
8282} else if (RegExMatch(message, "^\* " . getUsername() . " schießt mit seinen Elektroschocker auf (.*) und setzt ihn unter Strom\.$")) {
8283tazer := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=tazer")
8284IniWrite, %tazer%, stats.ini, Tazer, Tazer
8285SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(tazer) . " {FFFFFF}Spieler getazert.")
8286} else if (RegExMatch(message, "^\[HQ\]: Haftzeit: (\d+) Minuten, Geldstrafe: (\d+)\$\.$", line0_)) {
8287haftzeit := line0_1
8288geldstrafe := line0_2
8289if (RegExMatch(arr[index - 1], "^\[HQ\]: (.+) (\S+) hat den Verdächtigen (\S+) ?(offline)? (\S+)\.$", line1_)) {
8290copName := line1_2
8291verbrecherName := line1_3
8292offlineArrest := line1_4
8293arrestType := line1_5
8294removeFromMDC(verbrecherName)
8295if (copName == getUsername()) {
8296if (arrestType == "eingesperrt") {
8297if (geldstrafe > 0) {
8298if (offlineArrest == "offline") {
8299offlinePrison := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=oprison")
8300IniWrite, %offlinePrison%, stats.ini, Arrests, OfflinePrison
8301SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(offlinePrison) . " {FFFFFF}Verbrecher offline ins Prison gesteckt.")
8302} else if (offlineArrest == "" && deathArrested) {
8303deathArrested := false
8304deathPrison := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=dprison")
8305IniWrite, %deathPrison%, stats.ini, Arrests, DeathPrison
8306SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(deathPrison) . " {FFFFFF}Verbrecher nach dem Tod ins Prison gesteckt.")
8307}
8308} else {
8309wanteds := haftzeit / 3
8310money := wanteds * 750
8311if (money > 20000) {
8312money := 20000
8313}
8314money := Floor(money * taxes)
8315paydayMoney += money
8316totalArrestMoney += money
8317if (offlineArrest == "offline") {
8318offlineArrests := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=oarrests")
8319IniWrite, %offlineArrests%, stats.ini, Arrests, OfflineArrests
8320SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(offlineArrests) . " {FFFFFF}Verbrecher offline eingesperrt.")
8321SetTimer, PartnerMoneyTimer, -1500
8322} else if (offlineArrest == "") {
8323if (!deathArrested) {
8324arrests := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=arrests")
8325IniWrite, %arrests%, stats.ini, Arrests, Arrest
8326SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(arrests) . " {FFFFFF}Verbrecher eingesperrt.")
8327SetTimer, PartnerMoneyTimer, -1500
8328} else {
8329deathArrested := false
8330deathArrests := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=darrests")
8331IniWrite, %deathArrests%, stats.ini, Arrests, DeathArrests
8332SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(deathArrests) . " {FFFFFF}Verbrecher nach dem Tod eingesperrt.")
8333SetTimer, PartnerMoneyTimer, -1500
8334}
8335}
8336}
8337} else if (arrestType == "getötet") {
8338suspectKills := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=suspect_kills")
8339IniWrite, %suspectKills%, stats.ini, Kills, Verbrecher
8340SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(suspectKills) . " {FFFFFF}Verbrecher getötet.")
8341}
8342}
8343}
8344} else if (RegExMatch(message, "^\[HQ\]: (.+) " . getUsername() . " hat das Marihuana in (.+) gefunden und zerstört\.$", chat_)) {
8345plants := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=plants")
8346IniWrite, %plants%, stats.ini, Marihuana, Marihuana
8347SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(plants) . " {FFFFFF}Marihuana-Pflanzen zerstört.")
8348adrGTA2 := getModuleBaseAddress("gta_sa.exe", hGTA)
8349cText := readString(hGTA, adrGTA2 + 0x7AAD43, 512)
8350if (RegExMatch(cText, "Marihuana zerstoert~n~~g~(\d+)\$", cText_)) {
8351paydayMoney += cText_1
8352payPartnerMoney(cText_1, "plants_money")
8353}
8354GetPlayerPos(posX, posY, posZ)
8355zone := getPlayerZone()
8356city := getPlayerCity()
8357result := URLDownloadToVar(baseURL . "api/drugs?posX=" . posX . "&posY=" . posY . "&zone=" . zone . "&city=" . city . "&username=" . username . "&password=" . password)
8358if (result == "true") {
8359SendClientMessage(PREFIX . "Der Standort wurde erfolgreich auf der Map eingetragen!")
8360} else {
8361SendClientMessage(PREFIX . "Beim Eintragen auf der Map ist ein Fehler aufgetreten!")
8362SendClientMessage(PREFIX . "Fehler: " . SECCOL . result)
8363}
8364} else if (RegExMatch(message, "^\[WANTED\] Verdächtiger: (\S+), Zeuge: (\S+), Verbrechen: Mord in (.*)$", mdcChat_)) {
8365mdcName := mdcChat_1
8366mdcWitness := mdcChat_2
8367mdcCrime := "Mord"
8368mdcPos := mdcChat_3
8369} else if (RegExMatch(message, "^\[WANTED\] Verdächtiger: (\S+), Zeuge: (\S+), Verbrechen: Überfall GK (\d+)\.(\d+) \((\S+)\)$", mdcChat_)) {
8370gk(mdcChat_3 . "." . mdcChat_4, mdcChat_5)
8371mdcName := mdcChat_1
8372mdcCrime := "Store-Rob"
8373mdcLocation := "GK " . mdcChat_3 . "." . mdcChat_4 . " (" . mdcChat_5 . ")"
8374storerob := []
8375storerob["type"] := "storerob"
8376storerob["time"] := A_Hour . ":" . A_Min
8377storerob["name"] := mdcName
8378storerob["crime"] := mdcCrime
8379storerob["location"] := mdcLocation
8380storerob["countdown"] := 90
8381for i, key in mdc {
8382if (key["name"] == mdcName && key["crime"] == mdcCrime && key["location"] == mdcLocation) {
8383return
8384}
8385}
8386mdc.Push(storerob)
8387} else if (RegExMatch(message, "^\[WANTED\] Verdächtiger: (\S+), Zeuge: (\S+), Verbrechen: (.*)$", mdcChat_)) {
8388mdcName := mdcChat_1
8389mdcWitness := mdcChat_2
8390mdcCrime := mdcChat_3
8391mdcPos := "n/a"
8392if (RegExMatch(mdcCrime, "(.*) \[(\d+):(\d+)\]", mdcCrime_)) {
8393mdcCrime := mdcCrime_1
8394}
8395suspect := []
8396suspect["type"] := "crime"
8397suspect["time"] := A_Hour . ":" . A_Min
8398suspect["name"] := mdcName
8399suspect["witness"] := mdcWitness
8400suspect["crime"] := mdcCrime
8401suspect["countdown"] := -1
8402for i, key in mdc {
8403if (key["name"] == mdcName && key["witness"] == mdcWitness && key["crime"] == mdcCrime) {
8404return
8405}
8406}
8407mdc.Push(suspect)
8408} else if (RegExMatch(message, "^\[HQ\]: \+\+\+ Alle Einheiten \+\+\+$")) {
8409if (RegExMatch(arr[index - 2], "^\[HQ\]: \+\+\+ Alle Einheiten \+\+\+$")) {
8410mdcChat1 := arr[index - 1]
8411coup := []
8412coup["type"] := "coup"
8413coup["time"] := A_Hour . ":" . A_Min
8414coup["countdown"] := -1
8415if (RegExMatch(mdcChat1, "^\[HQ\]: Es wurde ein Coup im Verwaltungsgebäude in Commerce, Los Santos gemeldet\.$")) {
8416coup["crime"] := "Heist (Rebellen)"
8417coup["location"] := "Verwaltungsgebäude Commerce, Los Santos"
8418} else if (RegExMatch(mdcChat1, "^\[HQ\]: Es wurde ein Coup im Los Santos Police Department gemeldet\.$")) {
8419coup["crime"] := "Heist (Business)"
8420coup["location"] := "Los Santos Police Department"
8421} else if (RegExMatch(mdcChat1, "^\[HQ\]: Es wurde ein Waffentransporter Überfall in (.+) gemeldet\.$", mdcChat1_)) {
8422coup["crime"] := "Waffentransporter-Überfall"
8423coup["location"] := mdcChat1_1
8424} else if (RegExMatch(mdcChat1, "^\[HQ\]: Es wurde ein Bank Überfall in (.+) gemeldet\.$", mdcChat1_)) {
8425coup["crime"] := "Banküberfall"
8426coup["location"] := mdcChat1_1
8427} else {
8428return
8429}
8430for i, key in mdc {
8431if (key["type"] == "coup" && key["crime"] == coup["crime"] && key["location"] == coup["location"]) {
8432return
8433}
8434}
8435mdc.Push(coup)
8436}
8437} else if (RegExMatch(message, "^\[HQ\]: (.+) (\S+) \((\d+)\) benötigt Verstärkung in (.*)\.$", mdcChat_)) {
8438backup := []
8439backup["type"] := "backup"
8440backup["time"] := A_Hour . ":" . A_Min
8441backup["name"] := mdcChat_2
8442backup["location"] := mdcChat_4
8443backup["countdown"] := -1
8444toRemove := []
8445for i, key in mdc {
8446if (key["type"] == "backup" && key["name"] == mdcChat_2) {
8447toRemove.Push(i)
8448}
8449}
8450for i, id in toRemove {
8451mdc.RemoveAt(id)
8452}
8453mdc.Push(backup)
8454} else if (RegExMatch(message, "^\*\* (.+) (\S+): \[HQ\]: Ich benötige DRINGEND Verstärkung in (.+)! HP: (\d+)\/(\d+) \*\*$", mdcChat_)) {
8455backup := []
8456backup["type"] := "backup"
8457backup["time"] := A_Hour . ":" . A_Min
8458backup["name"] := mdcChat_2
8459backup["location"] := mdcChat_3
8460backup["countdown"] := -1
8461toRemove := []
8462for i, key in mdc {
8463if (key["type"] == "backup" && key["name"] == mdcChat_2) {
8464toRemove.Push(i)
8465}
8466}
8467for i, id in toRemove {
8468mdc.RemoveAt(id)
8469}
8470mdc.Push(backup)
8471} else if (RegExMatch(message, "^\*\* (.+) (\S+): \[HQ\]: Verstärkung wird NICHT mehr benötigt! \*\*$", mdcChat_)) {
8472toRemove := []
8473for i, key in mdc {
8474if (key["type"] == "backup" && key["name"] == mdcChat_2) {
8475toRemove.Push(i)
8476}
8477}
8478for i, id in toRemove {
8479mdc.RemoveAt(id)
8480}
8481} else if (RegExMatch(message, "^\*\* (.+) (\S+): \[HQ\]: Ich bin gestorben und benötige KEINE Verstärkung mehr! \*\*$", mdcChat_)) {
8482toRemove := []
8483for i, key in mdc {
8484if (key["type"] == "backup" && key["name"] == mdcChat_2) {
8485toRemove.Push(i)
8486}
8487}
8488for i, id in toRemove {
8489mdc.RemoveAt(id)
8490}
8491} else if (RegExMatch(message, "^Geschwindigkeit: (\d+) km\/h$", message_)) {
8492radar := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=radar")
8493IniWrite, %radar%, stats.ini, Radar, Radarkontrollen
8494SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(radar) . " {FFFFFF}Spieler gelasert.")
8495vehOwner := arr[index - 4]
8496vehDriver := arr[index - 3]
8497if (RegExMatch(vehOwner, "^Fahrzeughalter: (\S+)$", vehOwner_)) {
8498if (vehOwner_1 == "FBI" || vehOwner_1 == "SAFD" || vehOwner_1 == "LSPD" || vehOwner_1 == "LSPD" || vehOwner_1 == "Sanitäter" || vehOwner_1 == "Ordnungsamt") {
8499return
8500}
8501}
8502if (RegExMatch(vehDriver, "^Fahrzeugführer: (\S+) \(ID: (\d+)\)$", driver_)) {
8503kmh := maxKMH
8504if (kmh == 0) {
8505kmh := 80
8506SendClientMessage(PREFIX . "Du musst die maximal erlaubte Höchstgeschwindigkeit noch eintragen, verwende " . SECCOL . "/setkmh{FFFFFF}.")
8507}
8508if (message_1 > kmh) {
8509lastSpeed := message_1
8510lastSpeedUser := driver_1
8511Sleep, 750
8512SendChat("/m >> " . department . ", Radarkontrolle! " . driver_1 . ", halten Sie SOFORT an und fahren Sie rechts ran! <<")
8513}
8514}
8515} else if (RegExMatch(message, "^\*\* (.+?) (\S+): (.+) \*\*$", message_)) {
8516handleDChatMessage(message)
8517} else if (RegExMatch(message, "^\.\.\.(.*) \*\*$", message_)) {
8518message1 := arr[index - 1]
8519if (RegExMatch(message1, "^\*\* (.+?) (\S+): (.+)\.\.\.$", message1_)) {
8520handleDChatMessage("** " . message1_1 . " " . message1_2 . ": " . message1_3 . message_1 . " **")
8521}
8522}
8523}
8524handleDChatMessage(message) {
8525global
8526if (RegExMatch(message, "^\*\* (.+) (\S+): HQ: ID: (\d+) \[(\S+)\] Wanteds eintragen, Grund: (\S+)(.*) \*\*$", message_)) {
8527orderSuspect := message_4
8528orderWantedReason := message_5
8529SetTimer, WantedOrderTimer, -1
8530} else if (RegExMatch(message, "^\*\* (.+) (\S+): HQ: (\S+), ID: (\d+) Wanteds eintragen, Grund: (\S+)(.*) \*\*$", message_)) {
8531orderSuspect := message_3
8532orderWantedReason := message_5
8533SetTimer, WantedOrderTimer, -1
8534} else if (RegExMatch(message, "^\*\* (.+) (\S+): \[HQ\]: Bitte (\S+) \(ID (\d+)\) Wanteds eintragen\. Grund: (\S+)(.*) \*\*$", message_)) {
8535orderSuspect := message_3
8536orderWantedReason := message_5
8537SetTimer, WantedOrderTimer, -1
8538}
8539}
8540:?:/test::
8541{
8542Input, userInput, V T10, , x,y
8543if (ErrorLevel == "Match") {
8544if (userInput = "x") {
8545} else {
8546}
8547}
8548SendClientMessage(PREFIX . "Eingabe: '" . userInput . "' - ErrorLevel: '" . ErrorLevel . "'")
8549}
8550return
8551SpamTimer:
8552{
8553unBlockChatInput()
8554SendClientMessage(PREFIX . "Spamschutz-System {FF0000}deaktiviert{FFFFFF}!")
8555}
8556return
8557PaketTimer:
8558{
8559SendClientMessage(PREFIX . SECCOL . medicName . " {FFFFFF}bietet dir ein Paket an, drücke " . SECCOL . "X {FFFFFF}zum Annehmen.")
8560KeyWait, X, D, T10
8561if (!ErrorLevel) {
8562SendChat("/accept paket")
8563Sleep, 200
8564chat := readChatLine(0) . readChatLine(1) . readChatLine(2)
8565if (RegExMatch(chat, "Du hast bereits ein Erste-Hilfe-Paket\. Verwende \/erstehilfe")) {
8566if (packetMessages) {
8567SendChat("/l Vielen Dank " . medicName . ", doch ich habe bereits ein Paket!")
8568}
8569} else if (RegExMatch(chat, "\* Du hast für \$(\d+) ein Erste-Hilfe-Paket von (\S+) gekauft\.", chat_)) {
8570if (packetMessages) {
8571SendChat("/l Vielen Dank " . chat_2 . " für das Paket!")
8572}
8573}
8574}
8575}
8576return
8577WantedOrderTimer:
8578{
8579SendClientMessage(PREFIX . "Möchtest du die Wanteds ausstellen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
8580KeyWait, X, D, T10
8581if (!ErrorLevel) {
8582if (giveWanteds(orderSuspect, orderWantedReason)) {
8583SendChat("/d [HQ]: Ich habe den Auftrag ausgeführt und " . orderSuspect . " Wanteds eingetragen!")
8584}
8585}
8586}
8587return
8588PartnerMoneyTimer:
8589{
8590payPartnerMoney(totalArrestMoney, "arrest_money")
8591totalArrestMoney := 0
8592}
8593return
8594KillTimer:
8595{
8596data := getKills()
8597if (data) {
8598for index, object in data
8599{
8600if (object.victim.local) {
8601Sleep, 100
8602chat0 := readChatLine(0)
8603chat1 := readChatLine(1)
8604chat2 := readChatLine(2)
8605if (RegExMatch(chat0 . chat1 . chat2, "Paintball: (\S+) wurde von (\S+) getötet\.")) {
8606return
8607}
8608if (InStr(chat0 . chat1 . chat2, "[KillHouse]")) {
8609return
8610}
8611if (bk) {
8612SendChat("/d [HQ]: Ich bin gestorben und benötige KEINE Verstärkung mehr!")
8613bk := false
8614}
8615} else if (object.murderer.local) {
8616}
8617}
8618}
8619}
8620return
8621UncuffTimer:
8622{
8623if (IsPlayerInAnyVehicle()) {
8624if (IsPlayerDriver()) {
8625if (getVehicleHealth() < 250) {
8626if (!autoUncuff) {
8627SendClientMessage(PREFIX . "Möchtest du alle Personen im Fahrzeug entcuffen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
8628KeyWait, X, D, T5
8629if (ErrorLevel) {
8630return
8631}
8632}
8633passenger := GetSeatIDs()
8634passenger_length := passenger.MaxIndex()
8635Loop, %passenger_length% {
8636if (passenger[A_Index] != -1) {
8637SendChat("/uncuff " . passenger[A_Index])
8638}
8639}
8640Sleep, 5000
8641}
8642}
8643}
8644}
8645return
8646TaskCheckTimer:
8647{
8648IfWinNotActive, GTA:SA:MP
8649return
8650tasksResult := UrlDownloadToVar(baseURL . "api/tasks?username=" . username . "&password=" . password . "&action=get")
8651if (tasksResult == "ERROR_BAD_LINK") {
8652} else if (tasksResult == "ERROR_USER_NOT_FOUND") {
8653} else if (tasksResult == "ERROR_WRONG_PASSWORD") {
8654} else if (tasksResult == "ERROR_ACCESS_DENIED") {
8655} else if (tasksResult == "ERROR_NO_SUCH_ACTION") {
8656} else if (tasksResult == "ERROR_MYSQL_QUERY") {
8657} else if (tasksResult == "ERROR_NO_TASKS") {
8658} else if (tasksResult == "ERROR_CONNECTION") {
8659} else {
8660try {
8661tasksLoaded := JSON.Load(tasksResult)
8662} catch {
8663FormatTime, time, , dd.MM.yyyy HH:mm:ss
8664FileAppend, [%time%] Beim Laden der Tasks ist ein Fehler aufgetreten: %tasksResult%`n, log.txt
8665return
8666}
8667tasksToRemove := []
8668for newIndex, newEntry in tasksLoaded {
8669contains := false
8670for index, entry in tasks {
8671if (entry["id"] == newEntry["id"]) {
8672contains := true
8673}
8674}
8675if (!contains) {
8676tasks.Push(newEntry)
8677}
8678}
8679for index, entry in tasks {
8680contains := false
8681for newIndex, newEntry in tasksLoaded {
8682if (entry["id"] == newEntry["id"]) {
8683contains := true
8684}
8685}
8686if (!contains) {
8687tasksToRemove.Push(entry["id"])
8688}
8689}
8690tasksRemoved := 0
8691for i, id in tasksToRemove {
8692tasksRemoved += removeTask(id)
8693}
8694}
8695for index, task in tasks {
8696if (task["online"]) {
8697taskSubjectID := getPlayerIdByName(task["subject"], true)
8698if (taskSubjectID == -1) {
8699task["online"] := false
8700}
8701} else {
8702taskSubjectID := getPlayerIdByName(task["subject"], true)
8703if (taskSubjectID != -1) {
8704if (showTasks) {
8705SendClientMessage(PREFIX . "Spieler mit Task ist online: " . SECCOL . task["subject"] . " {FFFFFF}(ID: " . SECCOL . taskSubjectID . "{FFFFFF})")
8706SendClientMessage(PREFIX . "Task (ID " . SECCOL . "#" . task["id"] . "{FFFFFF}): " . SECCOL . task["task"])
8707}
8708task["online"] := true
8709}
8710}
8711}
8712}
8713return
8714ChatlogSaveTimer:
8715{
8716if (chatlogSaver) {
8717WinWait, GTA:SA:MP, , 1
8718if (ErrorLevel) {
8719return
8720}
8721WinWaitClose, GTA:SA:MP, , 1
8722if (ErrorLevel) {
8723return
8724}
8725FileCreateDir, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups
8726FormatTime, time, %A_Now%, dd.MM.yy - HH.mm
8727FileCopy, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups\chatlog %time% Uhr.txt, 0
8728MsgBox, Der Chatlog wurde gespeichert.
8729FormatTime, time, , dd.MM.yyyy HH:mm:ss
8730FileAppend, [%time%] Der Chatlog wurde gespeichert. Beginne von Vorne.`n, log.txt
8731}
8732}
8733return
8734LottoTimer:
8735{
8736if (lottoSystem) {
8737if (A_Min == 0 && A_Hour != oldHour) {
8738SendChat("/lotto")
8739SendClientMessage(PREFIX . "Möchtest du dir ein Lottoticket kaufen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
8740oldHour := A_Hour
8741KeyWait, X, D, T10
8742if (!ErrorLevel) {
8743if (lottoNumber == 0) {
8744Random, randomNumber, 1, 200
8745SendChat("/lotto " . randomNumber)
8746} else if (lottoNumber == 201) {
8747SendChat("/lotto " . getId())
8748} else {
8749SendChat("/lotto " . lottoNumber)
8750}
8751}
8752}
8753}
8754}
8755return
8756:?:/tempo::
8757{
8758tempoInput := PlayerInput("Tempo: ")
8759if (tempoInput == "")
8760return
8761if tempoInput is not number
8762return
8763tempo := tempoInput
8764SendClientMessage(PREFIX . "Du hast das Tempo auf " . SECCOL . tempo . " km/h {FFFFFF}gesetzt. Starte den Tempomat mit " . SECCOL . tempomatNoMods)
8765}
8766return
8767tempomatLabel:
8768{
8769if (IsInChat())
8770return
8771if (tempomat) {
8772SendInput, {W up}
8773tempomat := false
8774SendClientMessage(PREFIX . "Du hast den Tempomat {FF0000}deaktiviert{FFFFFF}.")
8775} else {
8776tempomat := true
8777SendClientMessage(PREFIX . "Du hast den Tempomat {00FF00}aktiviert{FFFFFF} (Tempo: " . SECCOL . tempo . " km/h{FFFFFF}).")
8778}
8779}
8780TempoTimer:
8781{
8782IfWinNotActive, GTA:SA:MP
8783return
8784if (!tempomat || tempo <= 0)
8785return
8786if (IsInChat())
8787return
8788if (IsPlayerInAnyVehicle() && IsPlayerDriver()) {
8789currentSpeed := getVehicleSpeed()
8790if (currentSpeed < tempo) {
8791SendInput, {W down}
8792} else {
8793SendInput, {W up}
8794}
8795}
8796}
8797return
8798StatsOverlayTimer:
8799{
8800IfWinNotActive, GTA:SA:MP
8801return
8802IniRead, accountMoney, stats.ini, Vermögen, Bank, 0
8803IniRead, depositMoney, stats.ini, Vermögen, Festgeld, 0
8804allMoney := accountMoney + depositMoney + getPlayerMoney()
8805IniRead, wanteds, stats.ini, Katalog, Wanteds, 0
8806IniRead, points, stats.ini, Katalog, Punkte, 0
8807IniRead, checks, stats.ini, Kontrollen, Kontrollen, 0
8808IniRead, tazer, stats.ini, Tazer, Tazer, 0
8809IniRead, radar, stats.ini, Radar, Radarkontrollen, 0
8810IniRead, suspectArrests, stats.ini, Arrests, Arrest, 0
8811IniRead, suspectKills, stats.ini, Kills, Verbrecher, 0
8812IniRead, deathArrests, stats.ini, Arrests, DeathArrests, 0
8813IniRead, deathPrison, stats.ini, Arrests, DeathPrison, 0
8814IniRead, offlineArrests, stats.ini, Arrests, OfflineArrests, 0
8815IniRead, offlinePrison, stats.ini, Arrests, OfflinePrison, 0
8816IniRead, arrestMoney, stats.ini, Arrests, Geld, 0
8817IniRead, ticketMoney, stats.ini, Vergaben, TicketGeld, 0
8818IniRead, fishMoney, stats.ini, Fischsystem, Fischgeld, 0
8819IniRead, marihuana, stats.ini, Marihuana, Marihuana, 0
8820IniRead, drugsTaken, stats.ini, Kontrollen, Drogen, 0
8821IniRead, seedsTaken, stats.ini, Kontrollen, Samen, 0
8822IniRead, garbageXP, stats.ini, Müllmann, XP, 0
8823IniRead, garbageKubik, stats.ini, Müllmann, Kubik, 0
8824IniRead, garbageMoney, stats.ini, Müllmann, Geld, 0
8825IniRead, fishingXP, stats.ini, Hochseefischer, XP, 0
8826IniRead, fishingMoney, stats.ini, Hochseefischer, Geld, 0
8827IniRead, truckerXP, stats.ini, Trucker, XP, 0
8828IniRead, truckerMoney, stats.ini, Trucker, Geld, 0
8829IniRead, trainXP, stats.ini, Zugfahrer, XP, 0
8830IniRead, trainMoney, stats.ini, Zugfahrer, Geld, 0
8831IniRead, gardenerXP, stats.ini, Gärtner, XP, 0
8832IniRead, gardenerMoney, stats.ini, Gärtner, Geld, 0
8833IniRead, gardenerMaxMoney, stats.ini, Gärtner, Höchstverdienst, 0
8834IniRead, farmerXP, stats.ini, Farmer, XP, 0
8835IniRead, farmerMoney, stats.ini, Farmer, Geld, 0
8836IniRead, farmerMaxMoney, stats.ini, Farmer, Höchstverdienst, 0
8837IniRead, busRounds, stats.ini, Busfahrer, Runden, 0
8838IniRead, busMoney, stats.ini, Busfahrer, Geld, 0
8839IniRead, matsBought, stats.ini, Materialien, AnzahlGekauft, 0
8840IniRead, matsMoney, stats.ini, Materialien, Ausgaben, 0
8841IniRead, matsXP, stats.ini, Materialien, XP, 0
8842IniRead, mats, stats.ini, Materialien, Anzahl, 0
8843IniRead, waffenstahl, stats.ini, Materialien, Waffenstahl, 0
8844totalMoney := arrestMoney + ticketMoney + fishMoney
8845motorStatus := ""
8846lockStatus := ""
8847lightStatus := ""
8848checkpointDistance := "-"
8849if (isPlayerInAnyVehicle()) {
8850if (getVehicleEngineState()) {
8851motorStatus := statsOverlayPositiveColor . "Motor an{FFFFFF}"
8852} else {
8853motorStatus := statsOverlayNegativeColor . "Motor aus{FFFFFF}"
8854}
8855}
8856if (isPlayerInAnyVehicle()) {
8857if (getVehicleLockState()) {
8858lockStatus := statsOverlayNegativeColor . "Fahrzeug abgeschlossen{FFFFFF}"
8859} else {
8860lockStatus := statsOverlayPositiveColor . "Fahrzeug aufgeschlossen{FFFFFF}"
8861}
8862}
8863if (isPlayerInAnyVehicle()) {
8864if (getVehicleLightState()) {
8865lightStatus := statsOverlayPositiveColor . "Licht angeschalten{FFFFFF}"
8866} else {
8867lightStatus := statsOverlayNegativeColor . "Licht abgeschalten{FFFFFF}"
8868}
8869}
8870if (IsMarkerCreated()) {
8871coordsFromRedmarker := CoordsFromRedmarker()
8872playerCoords := getCoordinates()
8873distance := getDistanceToPoint(coordsFromRedmarker[1], coordsFromRedmarker[2], coordsFromRedmarker[3], playerCoords[1], playerCoords[2], playerCoords[3])
8874checkpointDistance := FormatNumber(Floor(distance)) . "m"
8875}
8876ovFind := getFullName(playerToFind)
8877ovPartners := ""
8878for index, entry in partners {
8879ovPartners .= "`n" . statsOverlayPrimColor . index . "{FFFFFF}: " . entry
8880}
8881statsOverlayText := statsOverlayContent
8882statsOverlayText := StrReplace(statsOverlayText, "[name]", getUsername())
8883statsOverlayText := StrReplace(statsOverlayText, "[id]", getId())
8884statsOverlayText := StrReplace(statsOverlayText, "[ping]", getPlayerPingById(getId()))
8885statsOverlayText := StrReplace(statsOverlayText, "[zone]", getPlayerZone())
8886statsOverlayText := StrReplace(statsOverlayText, "[city]", getPlayerCity())
8887statsOverlayText := StrReplace(statsOverlayText, "[hp]", getPlayerHealth())
8888statsOverlayText := StrReplace(statsOverlayText, "[armour]", getPlayerArmor())
8889statsOverlayText := StrReplace(statsOverlayText, "[money]", FormatNumber(getPlayerMoney()))
8890statsOverlayText := StrReplace(statsOverlayText, "[bankmoney]", FormatNumber(accountMoney))
8891statsOverlayText := StrReplace(statsOverlayText, "[allmoney]", FormatNumber(allMoney))
8892statsOverlayText := StrReplace(statsOverlayText, "[skin]", getPlayerSkinId())
8893statsOverlayText := StrReplace(statsOverlayText, "[weaponid]", getPlayerWeaponId())
8894statsOverlayText := StrReplace(statsOverlayText, "[weapon]", getPlayerWeaponName())
8895statsOverlayText := StrReplace(statsOverlayText, "[freezed]", (IsPlayerFreezed() ? "ja" : "nein"))
8896statsOverlayText := StrReplace(statsOverlayText, "[vhealth]", getVehicleHealth())
8897statsOverlayText := StrReplace(statsOverlayText, "[vmodelid]", getVehicleModelId())
8898statsOverlayText := StrReplace(statsOverlayText, "[vmodel]", getVehicleModelName())
8899statsOverlayText := StrReplace(statsOverlayText, "[vspeed]", round(getVehicleSpeed()))
8900statsOverlayText := StrReplace(statsOverlayText, "[fishmoney]", FormatNumber(fishMoney))
8901statsOverlayText := StrReplace(statsOverlayText, "[fishtime]", formatTime(fishTime))
8902statsOverlayText := StrReplace(statsOverlayText, "[date]", A_DD . "." . A_MM . "." . A_Year)
8903statsOverlayText := StrReplace(statsOverlayText, "[motor]", motorStatus)
8904statsOverlayText := StrReplace(statsOverlayText, "[lock]", lockStatus)
8905statsOverlayText := StrReplace(statsOverlayText, "[light]", lightStatus)
8906statsOverlayText := StrReplace(statsOverlayText, "[checkpoint]", checkpointDistance)
8907statsOverlayText := StrReplace(statsOverlayText, "[pdmoney]", FormatNumber(paydayMoney))
8908statsOverlayText := StrReplace(statsOverlayText, "[pdmoneynetto]", FormatNumber(Round(paydayMoney * taxes)))
8909statsOverlayText := StrReplace(statsOverlayText, "[find]", (autoFindRunning || autoShowRunning ? (ovFind == "" ? "-" : ovFind) : "-"))
8910statsOverlayText := StrReplace(statsOverlayText, "[partners]", (ovPartners == "" ? "-" : ovPartners))
8911statsOverlayText := StrReplace(statsOverlayText, "[wanteds]", FormatNumber(wanteds))
8912statsOverlayText := StrReplace(statsOverlayText, "[points]", FormatNumber(points))
8913statsOverlayText := StrReplace(statsOverlayText, "[checks]", FormatNumber(checks))
8914statsOverlayText := StrReplace(statsOverlayText, "[tazer]", FormatNumber(tazer))
8915statsOverlayText := StrReplace(statsOverlayText, "[radar]", FormatNumber(radar))
8916statsOverlayText := StrReplace(statsOverlayText, "[arrests]", FormatNumber(suspectArrests))
8917statsOverlayText := StrReplace(statsOverlayText, "[kills]", FormatNumber(suspectKills))
8918statsOverlayText := StrReplace(statsOverlayText, "[deatharrests]", FormatNumber(deathArrests))
8919statsOverlayText := StrReplace(statsOverlayText, "[deathprison]", FormatNumber(deathPrison))
8920statsOverlayText := StrReplace(statsOverlayText, "[offlinearrests]", FormatNumber(offlineArrests))
8921statsOverlayText := StrReplace(statsOverlayText, "[offlineprison]", FormatNumber(offlinePrison))
8922statsOverlayText := StrReplace(statsOverlayText, "[arrestmoney]", FormatNumber(arrestMoney))
8923statsOverlayText := StrReplace(statsOverlayText, "[ticketmoney]", FormatNumber(ticketMoney))
8924statsOverlayText := StrReplace(statsOverlayText, "[fishmoney]", FormatNumber(fishMoney))
8925statsOverlayText := StrReplace(statsOverlayText, "[totalmoney]", FormatNumber(totalMoney))
8926statsOverlayText := StrReplace(statsOverlayText, "[marihuana]", FormatNumber(marihuana))
8927statsOverlayText := StrReplace(statsOverlayText, "[drugs]", FormatNumber(drugsTaken))
8928statsOverlayText := StrReplace(statsOverlayText, "[seeds]", FormatNumber(seedsTaken))
8929statsOverlayText := StrReplace(statsOverlayText, "[garbagexp]", FormatNumber(garbageXP))
8930statsOverlayText := StrReplace(statsOverlayText, "[garbagekubik]", FormatNumber(garbageKubik))
8931statsOverlayText := StrReplace(statsOverlayText, "[garbagemoney]", FormatNumber(garbageMoney))
8932statsOverlayText := StrReplace(statsOverlayText, "[fishingxp]", FormatNumber(fishingXP))
8933statsOverlayText := StrReplace(statsOverlayText, "[fishingmoney]", FormatNumber(fishingMoney))
8934statsOverlayText := StrReplace(statsOverlayText, "[truckerxp]", FormatNumber(truckerXP))
8935statsOverlayText := StrReplace(statsOverlayText, "[truckermoney]", FormatNumber(truckerMoney))
8936statsOverlayText := StrReplace(statsOverlayText, "[trainxp]", FormatNumber(trainXP))
8937statsOverlayText := StrReplace(statsOverlayText, "[trainmoney]", FormatNumber(trainMoney))
8938statsOverlayText := StrReplace(statsOverlayText, "[gardenerxp]", FormatNumber(gardenerXP))
8939statsOverlayText := StrReplace(statsOverlayText, "[gardenermoney]", FormatNumber(gardenerMoney))
8940statsOverlayText := StrReplace(statsOverlayText, "[gardenermaxmoney]", FormatNumber(gardenerMaxMoney))
8941statsOverlayText := StrReplace(statsOverlayText, "[farmerxp]", FormatNumber(farmerXP))
8942statsOverlayText := StrReplace(statsOverlayText, "[farmermoney]", FormatNumber(farmerMoney))
8943statsOverlayText := StrReplace(statsOverlayText, "[farmermaxmoney]", FormatNumber(farmerMaxMoney))
8944statsOverlayText := StrReplace(statsOverlayText, "[busrounds]", FormatNumber(busRounds))
8945statsOverlayText := StrReplace(statsOverlayText, "[busmoney]", FormatNumber(busMoney))
8946statsOverlayText := StrReplace(statsOverlayText, "[matsbought]", FormatNumber(matsBought))
8947statsOverlayText := StrReplace(statsOverlayText, "[matsmoney]", FormatNumber(matsMoney))
8948statsOverlayText := StrReplace(statsOverlayText, "[matsxp]", FormatNumber(matsXP))
8949statsOverlayText := StrReplace(statsOverlayText, "[mats]", FormatNumber(mats))
8950statsOverlayText := StrReplace(statsOverlayText, "[waffenstahl]", FormatNumber(waffenstahl))
8951statsOverlayText := StrReplace(statsOverlayText, "[primcol]", statsOverlayPrimColor)
8952statsOverlayText := StrReplace(statsOverlayText, "[seccol]", statsOverlaySecColor)
8953statsOverlayText := StrReplace(statsOverlayText, "[white]", "{FFFFFF}")
8954if (!statsOverlayColors) {
8955statsOverlayText := RegExReplace(statsOverlayText, "{\S{6}}", "")
8956}
8957TextSetString(statsOverlay, statsOverlayText)
8958}
8959return
8960MDCOverlayTimer:
8961{
8962mdcHeaderText := mdcOverlayPrimColor . fullProjectName . "`n" . mdcOverlaySecColor . "Personal Mobile Police Computer"
8963if (!mdcOverlayColors) {
8964mdcHeaderText := RegExReplace(mdcHeaderText, "{\S{6}}", "")
8965}
8966TextSetString(mdcHeader, mdcHeaderText)
8967mdcOverlayText := ""
8968mdcCopy := mdc.Clone()
8969for index, entry in mdcCopy {
8970suspectID := getPlayerIdByName(entry["name"], true)
8971if (suspectID == -1) {
8972removeFromMDC(entry["name"])
8973} else if (entry["countdown"] == 0 || entry["countdown"] < -1) {
8974removeFromMDC(entry["name"])
8975}
8976}
8977for index, suspect in mdc {
8978suspectID := getPlayerIdByName(suspect["name"], true)
8979if (suspect["type"] == "crime") {
8980mdcOverlayText .= mdcOverlaySecColor . "[" . mdcOverlayPrimColor . suspect["time"] . mdcOverlaySecColor . "] " . mdcOverlayPrimColor . suspect["name"] . mdcOverlaySecColor . "(" . suspectID . ") " . mdcOverlayPrimColor . suspect["crime"] . " " . mdcOverlaySecColor . "- " . mdcOverlayPrimColor . suspect["witness"] . "`r`n"
8981} else if (suspect["type"] == "storerob") {
8982mdcOverlayText .= mdcOverlaySecColor . "[" . mdcOverlayStoreRobColor . suspect["time"] . mdcOverlaySecColor . "] [" . mdcOverlayStoreRobColor . suspect["countdown"] . mdcOverlaySecColor . "] " . mdcOverlayStoreRobColor . suspect["name"] . mdcOverlaySecColor . "(" . suspectID . ") " . mdcOverlayStoreRobColor . suspect["crime"] . " " . mdcOverlaySecColor . "- " . mdcOverlayStoreRobColor . suspect["location"] . "`r`n"
8983suspect["countdown"]--
8984} else if (suspect["type"] == "coup") {
8985mdcOverlayText .= mdcOverlaySecColor . "[" . mdcOverlayStoreRobColor . suspect["time"] . mdcOverlaySecColor . "] " . mdcOverlayStoreRobColor . suspect["crime"] . " " . mdcOverlaySecColor . "- " . mdcOverlayStoreRobColor . suspect["location"] . "`r`n"
8986} else if (suspect["type"] == "backup") {
8987mdcOverlayText .= mdcOverlaySecColor . "[" . mdcOverlayBackupColor . suspect["time"] . mdcOverlaySecColor . "] " . mdcOverlayBackupColor . suspect["name"] . mdcOverlaySecColor . "(" . suspectID . ") " . mdcOverlayBackupColor . suspect["location"] . "`r`n"
8988}
8989}
8990if (!mdcOverlayColors) {
8991mdcOverlayText := RegExReplace(mdcOverlayText, "{\S{6}}", "")
8992}
8993TextSetString(mdcText, mdcOverlayText)
8994}
8995return
8996:?:/ov::
8997:?:/overlay::
8998{
8999SendClientMessage(PREFIX . SECCOL . "1{FFFFFF}: Statistik-Overlay " . SECCOL . "2{FFFFFF}: Gegner-Overlay")
9000overlayInput := PlayerInput("Overlay de-/aktivieren: ")
9001if (overlayInput == "1") {
9002if (statsOverlayEnabled) {
9003TextDestroy(statsOverlay)
9004statsOverlayEnabled := false
9005if (ovMoveMode == 1) {
9006ovMoveMode := 0
9007}
9008SetTimer, StatsOverlayTimer, Off
9009SendClientMessage(PREFIX . "Statistik-Overlay {FF0000}deaktiviert{FFFFFF}.")
9010} else {
9011createOverlay(1)
9012statsOverlayEnabled := true
9013SendClientMessage(PREFIX . "Statistik-Overlay {00FF00}aktiviert{FFFFFF}.")
9014}
9015} else if (overlayInput == "2") {
9016if (mdcOverlayEnabled) {
9017if (mdcOverlayBoxEnabled) {
9018BoxDestroy(mdcBox)
9019}
9020TextDestroy(mdcHeader)
9021TextDestroy(mdcText)
9022mdcOverlayEnabled := false
9023if (ovMoveMode == 2) {
9024ovMoveMode := 0
9025}
9026SetTimer, MDCOverlayTimer, Off
9027SendClientMessage(PREFIX . "Personal Mobile Police Computer {FF0000}deaktiviert{FFFFFF}.")
9028} else {
9029createOverlay(2)
9030mdcOverlayEnabled := true
9031SendClientMessage(PREFIX . "Personal Mobile Police Computer {00FF00}aktiviert{FFFFFF}.")
9032}
9033}
9034}
9035return
9036:?:/remove::
9037{
9038suspectToRemove := PlayerInput("Spieler entfernen: ")
9039fullSuspectToRemove := getFullName(suspectToRemove)
9040if (fullSuspectToRemove != "")
9041suspectToRemove := fullSuspectToRemove
9042if (removeFromMDC(suspectToRemove) > 0) {
9043SendClientMessage(PREFIX . suspectToRemove . " wurde aus dem Overlay entfernt.")
9044} else {
9045SendClientMessage(PREFIX . suspectToRemove . " wurde nicht im Overlay gefunden.")
9046}
9047}
9048return
9049:?:/removeall::
9050{
9051mdc := []
9052SendClientMessage(PREFIX . "Das MDC-Overlay wurde geleert.")
9053}
9054return
9055removeFromMDC(name) {
9056global mdc
9057indexToRemove := -1
9058for index, entry in mdc {
9059if (entry["name"] == name) {
9060indexToRemove := index
9061}
9062}
9063if (indexToRemove != -1) {
9064mdc.RemoveAt(indexToRemove)
9065return removeFromMDC(name) + 1
9066} else {
9067return 0
9068}
9069}
9070createOverlay(id) {
9071global
9072if (id == 1) {
9073statsOverlay := TextCreate(statsOverlayFont, statsOverlayFontSize, statsOverlayBold, statsOverlayItalic, statsOverlayPosX, statsOverlayPosY, 0xFFFFFFFF, "", true, true)
9074SetTimer, StatsOverlayTimer, 1000
9075} else if (id == 2) {
9076if (mdcOverlayBoxEnabled) {
9077mdcBox := BoxCreate(mdcOverlayPosX, mdcOverlayPosY, 300, 40 + (mdcOverlayLines * 10), 0x70000000, true)
9078}
9079mdcHeader := TextCreate(mdcOverlayFont, mdcOverlayFontSize + 1, mdcOverlayBold, mdcOverlayItalic, mdcOverlayPosX + 5, mdcOverlayPosY + 5, 0xFFFFFFFF, "", true, true)
9080mdcText := TextCreate(mdcOverlayFont, mdcOverlayFontSize, mdcOverlayBold, mdcOverlayItalic, mdcOverlayPosX + 5, mdcOverlayPosY + 30, 0xFFFFFFFF, "", true, true)
9081SetTimer, MDCOverlayTimer, 1000
9082}
9083}
9084updateOverlay(id) {
9085global
9086if (id == 1) {
9087if (statsOverlayEnabled) {
9088TextSetPos(statsOverlay, statsOverlayPosX, statsOverlayPosY)
9089}
9090} else if (id == 2) {
9091if (mdcOverlayEnabled) {
9092if (mdcOverlayBoxEnabled) {
9093BoxSetPos(mdcBox, mdcOverlayPosX, mdcOverlayPosY)
9094}
9095TextSetPos(mdcHeader, mdcOverlayPosX + 5, mdcOverlayPosY + 5)
9096TextSetPos(mdcText, mdcOverlayPosX + 5, mdcOverlayPosY + 30)
9097}
9098}
9099}
9100:?:/ovmove::
9101{
9102if (ovMoveMode) {
9103ovMoveMode := 0
9104SendClientMessage(PREFIX . "Der Overlay-Bearbeitungsmodus wurde {FF0000}deaktiviert{FFFFFF}!")
9105} else {
9106SendClientMessage(PREFIX . SECCOL . "1{FFFFFF}: Statistik-Overlay, " . SECCOL . "2{FFFFFF}: MDC-Overlay")
9107overlayInput := PlayerInput("Overlay verschieben: ")
9108if (overlayInput == "1") {
9109if (statsOverlayEnabled) {
9110ovMoveMode := 1
9111SendClientMessage(PREFIX . "Der Overlay-Bearbeitungsmodus wurde {00FF00}aktiviert{FFFFFF}!")
9112SendClientMessage(PREFIX . "Das Overlay kann nun mit den Pfeiltasten verschoben werden!")
9113SendClientMessage(PREFIX . "Wenn du fertig bist, tippe " . SECCOL . "/ovsave {FFFFFF}ein, um die Einstellung zu speichern!")
9114} else {
9115SendClientMessage(PREFIX . "Das Statistik-Overlay muss aktiviert sein, um es zu verschieben!")
9116}
9117} else if (overlayInput == "2") {
9118if (mdcOverlayEnabled) {
9119ovMoveMode := 2
9120SendClientMessage(PREFIX . "Der Overlay-Bearbeitungsmodus wurde {00FF00}aktiviert{FFFFFF}!")
9121SendClientMessage(PREFIX . "Das Overlay kann nun mit den Pfeiltasten verschoben werden!")
9122SendClientMessage(PREFIX . "Wenn du fertig bist, tippe " . SECCOL . "/ovsave {FFFFFF}ein, um die Einstellung zu speichern!")
9123} else {
9124SendClientMessage(PREFIX . "Das MDC-Overlay muss aktiviert sein, um es zu verschieben!")
9125}
9126}
9127}
9128}
9129return
9130:?:/ovsave::
9131{
9132if (ovMoveMode == 1) {
9133IniWrite, %statsOverlayPosX%, settings.ini, StatsOverlay, PosX
9134IniWrite, %statsOverlayPosY%, settings.ini, StatsOverlay, PosY
9135ovMoveMode := 0
9136SendClientMessage(PREFIX . "Die Overlay-Position wurde {00FF00}gespeichert {FFFFFF}und der Bearbeitungsmodus {FF0000}deaktiviert{FFFFFF}!")
9137} else if (ovMoveMode == 2) {
9138IniWrite, %mdcOverlayPosX%, settings.ini, MDCOverlay, PosX
9139IniWrite, %mdcOverlayPosY%, settings.ini, MDCOverlay, PosY
9140ovMoveMode := 0
9141SendClientMessage(PREFIX . "Die Overlay-Position wurde {00FF00}gespeichert {FFFFFF}und der Bearbeitungsmodus {FF0000}deaktiviert{FFFFFF}!")
9142} else {
9143SendClientMessage(PREFIX . "Der Overlay-Bearbeitungsmodus ist nicht aktiviert!")
9144}
9145}
9146return
9147~Up::
9148{
9149if (ovMoveMode) {
9150if (ovMoveMode == 1) {
9151statsOverlayPosY -= 3
9152} else if (ovMoveMode == 2) {
9153mdcOverlayPosY -= 3
9154}
9155updateOverlay(ovMoveMode)
9156}
9157}
9158return
9159~Down::
9160{
9161if (ovMoveMode) {
9162if (ovMoveMode == 1) {
9163statsOverlayPosY += 3
9164} else if (ovMoveMode == 2) {
9165mdcOverlayPosY += 3
9166}
9167updateOverlay(ovMoveMode)
9168}
9169}
9170return
9171~Left::
9172{
9173if (ovMoveMode) {
9174if (ovMoveMode == 1) {
9175statsOverlayPosX -= 3
9176} else if (ovMoveMode == 2) {
9177mdcOverlayPosX -= 3
9178}
9179updateOverlay(ovMoveMode)
9180}
9181}
9182return
9183~Right::
9184{
9185if (ovMoveMode) {
9186if (ovMoveMode == 1) {
9187statsOverlayPosX += 3
9188} else if (ovMoveMode == 2) {
9189mdcOverlayPosX += 3
9190}
9191updateOverlay(ovMoveMode)
9192}
9193}
9194return
9195:?:/setjob::
9196{
9197jobInput := PlayerInput("Job: ")
9198if (InStr(jobInput, "Waf")) {
9199job := 3
9200SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Waffendealer {FFFFFF}gesetzt!")
9201} else if (InStr(jobInput, "Bus")) {
9202job := 4
9203SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Busfahrer {FFFFFF}gesetzt!")
9204} else if (InStr(jobInput, "Pil")) {
9205job := 5
9206SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Pilot {FFFFFF}gesetzt!")
9207} else if (InStr(jobInput, "Fis")) {
9208job := 6
9209SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Hochseefischer {FFFFFF}gesetzt!")
9210} else if (InStr(jobInput, "Anw")) {
9211job := 7
9212SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Anwalt {FFFFFF}gesetzt!")
9213} else if (InStr(jobInput, "Det")) {
9214job := 8
9215SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Detektiv {FFFFFF}gesetzt!")
9216} else if (InStr(jobInput, "Tru")) {
9217job := 9
9218SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Trucker {FFFFFF}gesetzt!")
9219} else if (InStr(jobInput, "Far")) {
9220job := 10
9221SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Farmer {FFFFFF}gesetzt!")
9222} else if (InStr(jobInput, "Zug")) {
9223job := 11
9224SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Zugfahrer {FFFFFF}gesetzt!")
9225} else if (InStr(jobInput, "Gär") || InStr(jobInput, "Gar")) {
9226job := 12
9227SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Gärtner {FFFFFF}gesetzt!")
9228} else {
9229SendClientMessage(PREFIX . "Unbekannter Job!")
9230return
9231}
9232IniWrite, %job%, settings.ini, Job, Job
9233}
9234return
9235:?:/setline::
9236:?:/setlinie::
9237{
9238lineInput := PlayerInput("Linie: ")
9239if lineInput is number
9240{
9241if (lineInput < 1 || lineInput > 21) {
9242SendClientMessage(PREFIX . "Du musst eine Linie zwischen 1 und 21 eingeben.")
9243} else {
9244jobLine := lineInput + 1
9245IniWrite, %jobLine%, settings.ini, Job, Linie
9246SendClientMessage(PREFIX . "Du hast deine Linie auf " . SECCOL . lineInput . " {FFFFFF}gesetzt!")
9247}
9248} else {
9249SendClientMessage(PREFIX . "Bitte eine Zahl als Linie eingeben!")
9250}
9251}
9252return
9253:?:/wskill::
9254:?:/wdskill::
9255{
9256skillInput := PlayerInput("Waffendealer-Skill: ")
9257if skillInput is number
9258{
9259if (skillInput < 1 || skillInput > 5) {
9260SendClientMessage(PREFIX . "Du musst einen Skill zwischen 1 und 5 eingeben.")
9261} else {
9262jobWeapondealerSkill := skillInput + 1
9263IniWrite, %jobWeapondealerSkill%, settings.ini, Job, Waffendealerskill
9264SendClientMessage(PREFIX . "Du hast deinen Waffendealer-Skill auf " . SECCOL . skillInput . " {FFFFFF}gesetzt!")
9265}
9266} else {
9267SendClientMessage(PREFIX . "Bitte eine Zahl als Skill eingeben!")
9268}
9269}
9270return
9271:?:/dskill::
9272{
9273skillInput := PlayerInput("Detektiv-Skill: ")
9274if skillInput is number
9275{
9276if (skillInput < 1 || skillInput > 5) {
9277SendClientMessage(PREFIX . "Du musst einen Skill zwischen 1 und 5 eingeben.")
9278} else {
9279jobDetectiveSkill := skillInput + 1
9280IniWrite, %jobDetectiveSkill%, settings.ini, Job, Detektivskill
9281SendClientMessage(PREFIX . "Du hast deinen Detektiv-Skill auf " . SECCOL . skillInput . " {FFFFFF}gesetzt!")
9282}
9283} else {
9284SendClientMessage(PREFIX . "Bitte eine Zahl als Skill eingeben!")
9285}
9286}
9287return
9288jobexecuteLabel:
9289{
9290if (isInChat())
9291return
9292if ((job == "") || (job <= 1)) {
9293SendClientMessage(PREFIX . "Du hast keinen Job angegeben! Benutze /setjob.")
9294} else if (job == 3) {
9295if ((jobWeapondealerSkill == "") || (jobWeapondealerSkill <= 1)) {
9296SendClientMessage(PREFIX . "Du hast keinen Waffendealerskill angegeben! Benutze /wdskill.")
9297return
9298} else if (isPlayerInRangeOfPoint(597.0953, -1248.6184, 18.2718, 10) || isPlayerInRangeOfPoint(2789.554, -2494.1433, 14.2481, 10)) {
9299if (jobWeapondealerSkill == 2) {
9300packets := 5
9301} else if (jobWeapondealerSkill == 3) {
9302packets := 10
9303} else if (jobWeapondealerSkill == 4) {
9304packets := 15
9305} else if (jobWeapondealerSkill == 5) {
9306packets := 20
9307} else if (jobWeapondealerSkill == 6) {
9308packets := 25
9309}
9310if (GetVehicleModelId() == 482) {
9311packets := 50
9312}
9313SendChat("/materials get " . packets)
9314} else if (isPlayerInRangeOfPoint(2737, -2466, 14, 10)) {
9315SendChat("/materials warehouse")
9316Sleep, 300
9317SendChat("/prod warehouse")
9318Sleep, 300
9319SendChat("/oil warehouse")
9320} else if (isPlayerInRangeOfPoint(834.9152, -1853.8074, 7.9614, 5) || isPlayerInRangeOfPoint(-1479.4442, 324.0980, 7.1875, 5) || isPlayerInRangeOfPoint(1098.3141, 1686.8190, 6.6328, 5) || isPlayerInRangeOfPoint(1297.3389, -984.2680, 32.6953, 5) || isPlayerInRangeOfPoint(2743.5798, -2453.6897, 13.8623, 5)) {
9321SendChat("/put mats")
9322Sleep, 200
9323chatLine0 := readChatLine(0)
9324if (RegExMatch(chatLine0, "Befehl: \/put \[Mats\] \[Menge\] \(Du hast (\d+) Mats\)", chatLine0_)) {
9325SendChat("/put mats " . chatLine0_1)
9326}
9327} else if (isPlayerInRangeOfPoint(274, 1411, 11, 5)) {
9328SendChat("/oil buy")
9329} else if (isPlayerInRangeOfPoint(-1548, 124, 4, 5)) {
9330SendChat("/prod buy")
9331} else {
9332SendChat("/materials deliver")
9333}
9334} else if (job == 4) {
9335if ((jobLine == "") || (jobLine <= 1)) {
9336SendClientMessage(PREFIX . "Du hast keine Linie eingegeben! Benutze /setline.")
9337SendChat("/linie")
9338} else {
9339busLine := jobLine - 1
9340selectLine(busLine)
9341}
9342} else if (job == 5) {
9343if ((GetVehicleModelId() == 511) || (GetVehicleModelId() == 553) || (GetVehicleModelId() == 577)) {
9344SendChat("/duty")
9345} else {
9346SendClientMessage(PREFIX . "Du befindest dich in keinem Flugzeug!")
9347}
9348} else if (job == 6) {
9349if (GetVehicleModelId() == 453 || GetVehicleModelId() == 484) {
9350SendChat("/fishing")
9351Sleep, 200
9352if (getDialogCaption() == "Hochseefischer") {
9353if (fishingFull) {
9354SendInput, {down 7}{Enter}
9355} else {
9356freeTrap := false
9357highestTimeTrap := false
9358highestTime := 0
9359for index, line in getDialogLines() {
9360if (RegExMatch(line, "Reuse (\d+): Auslegen", line_)) {
9361if (!freeTrap) {
9362freeTrap := line_1
9363}
9364} else if (RegExMatch(line, "Reuse (\d+): Ausgelegt vor (\d+) Minuten", line_)) {
9365if (line_2 > highestTime) {
9366highestTimeTrap := line_1
9367highestTime := line_2
9368}
9369}
9370}
9371if (highestTimeTrap && highestTime >= 5) {
9372downCount := highestTimeTrap - 1
9373SendInput, {down %downCount%}{Enter}
9374SendClientMessage(PREFIX . "Du fährst nun zu Reuse " . highestTimeTrap . ", welche seit " . (highestTime - 5) . " Minute(n) eingeholt werden kann.")
9375} else if (freeTrap) {
9376downCount := freeTrap - 1
9377SendInput, {down %downCount%}{Enter}
9378} else {
9379SendClientMessage(PREFIX . "Es ist noch keine Reuse bereit zum Einholen.")
9380}
9381}
9382}
9383} else {
9384SendClientMessage(PREFIX . "Du befindest dich auf keinem Boot!")
9385}
9386} else if (job == 7) {
9387if (isPlayerInRangeOfPoint(253.7230, 68.9150, 1003.6406, 3)) {
9388SendChat("/freeinfo")
9389} else {
9390freeName := PlayerInput("Spielername: ")
9391freeKaution := PlayerInput("Kaution: ")
9392SendChat("/free " . freeName . " " . freeKaution)
9393}
9394} else if (job == 8) {
9395if (jobDetectiveSkill == "" || jobDetectiveSkill <= 1 || jobDetectiveSkill > 6) {
9396SendClientMessage(PREFIX . "Du hast keinen oder einen ungültigen Detektivskill angegeben! Benutze /dskill.")
9397return
9398}
9399playerToFindInput := PlayerInput("Spieler-ID: ")
9400if (playerToFindInput == "")
9401return
9402playerToFind := playerToFindInput
9403SendClientMessage(PREFIX . "Das automatische Suchen kann mit der Taste {FF0000}" . stopAutomaticSystemsNoMods . " {FFFFFF}deaktiviert werden.")
9404if (autoShowRunning) {
9405SetTimer, AutoShowPosTimer, Off
9406autoShowRunning := false
9407}
9408GoSub, AutoFindTimer
9409if (jobDetectiveSkill == 2) {
9410SetTimer, AutoFindTimer, 120500
9411} else if (jobDetectiveSkill == 3) {
9412SetTimer, AutoFindTimer, 90500
9413} else if (jobDetectiveSkill == 4) {
9414SetTimer, AutoFindTimer, 60500
9415} else if (jobDetectiveSkill == 5) {
9416SetTimer, AutoFindTimer, 30500
9417} else if (jobDetectiveSkill == 6) {
9418SetTimer, AutoFindTimer, 5500
9419} else {
9420return
9421}
9422autoFindRunning := true
9423} else if (job == 9) {
9424if (GetVehicleModelId() == 455) {
9425blockDialog()
9426SendChat("/delivery")
9427Sleep, 200
9428dialog := getDialogText()
9429newDialog := "ID`tAuftrag und Gehalt`tStrecke`tZeit"
9430unblockDialog()
9431deliveries := []
9432if (RegExMatch(dialog, "s)Du kannst einen Auftrag mit \/delivery \[Auftrag\] annehmen\.\n\nVerfügbare Aufträge:\n\n(.+)", dialog_)) {
9433Loop, parse, dialog_1, `n
9434{
9435if (RegExMatch(A_LoopField, "^Auftrag (\d+): (.+) \(von (.+) nach (.+)\), Gehalt: (\d+)\$, noch (\d+) Minuten verfügbar\.$", delivery_)) {
9436inserted := false
9437newDelivery := Object()
9438newDelivery["id"] := delivery_1
9439newDelivery["delivery"] := delivery_2
9440newDelivery["money"] := delivery_5
9441newDelivery["location"] := "von " . delivery_3 . " nach " . delivery_4
9442newDelivery["time"] := delivery_6
9443for index, delivery in deliveries {
9444money := delivery["money"]
9445if (delivery_5 > money) {
9446deliveries.InsertAt(index, newDelivery)
9447inserted := true
9448break
9449}
9450}
9451if (!inserted) {
9452deliveries.Push(newDelivery)
9453}
9454}
9455}
9456}
9457for, index, delivery in deliveries {
9458money := delivery["money"]
9459if (money > 3000) {
9460money := "{00FF00}" . money . "${FFFFFF}"
9461} else if (money > 2000) {
9462money := "{FF9900}" . money . "${FFFFFF}"
9463} else {
9464money := "{FF0000}" . money . "${FFFFFF}"
9465}
9466time := delivery["time"]
9467if (time > 30) {
9468time := "{00FF00}" . time . " Minuten"
9469} else if (time > 10) {
9470time := "{FF9900}" . time . " Minuten"
9471} else {
9472time := "{FF0000}" . time . " Minuten"
9473}
9474newDialog .= "`n" . delivery["id"] . "`t" . delivery["delivery"] . " (" . money . ")`t" . delivery["location"] . "`t" . time
9475}
9476ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Verfügbare Aufträge", newDialog, "OK")
9477} else {
9478SendClientMessage(PREFIX . "Du befindest dich nicht im Truck!")
9479}
9480} else if (job == 10) {
9481SendChat("/farmer start")
9482} else if (job == 11) {
9483SendChat("/duty")
9484} else if (job == 12) {
9485if (isPlayerInRangeOfPoint(1449, -2287, 14, 5)) {
9486SendChat("/gardener start")
9487} else {
9488if (GetVehicleModelId() == 543) {
9489if (isPlayerInRangeOfPoint(1751, -2054, 14, 10)) {
9490SendChat("/gardener sell")
9491} else {
9492SendChat("/gardener show")
9493}
9494} else {
9495SendChat("/gardener park")
9496}
9497}
9498}
9499}
9500return
9501:?:/l1::
9502selectLine(1)
9503return
9504:?:/l2::
9505selectLine(2)
9506return
9507:?:/l3::
9508selectLine(3)
9509return
9510:?:/l4::
9511selectLine(4)
9512return
9513:?:/l5::
9514selectLine(5)
9515return
9516:?:/l6::
9517selectLine(6)
9518return
9519:?:/l7::
9520selectLine(7)
9521return
9522:?:/l8::
9523selectLine(8)
9524return
9525:?:/l9::
9526selectLine(9)
9527return
9528:?:/l10::
9529selectLine(10)
9530return
9531:?:/l11::
9532selectLine(11)
9533return
9534:?:/l12::
9535selectLine(12)
9536return
9537:?:/l13::
9538selectLine(13)
9539return
9540:?:/l14::
9541selectLine(14)
9542return
9543:?:/l15::
9544selectLine(15)
9545return
9546:?:/l16::
9547selectLine(16)
9548return
9549:?:/l17::
9550selectLine(17)
9551return
9552:?:/l18::
9553selectLine(18)
9554return
9555:?:/l19::
9556selectLine(19)
9557return
9558:?:/l20::
9559selectLine(20)
9560return
9561:?:/l21::
9562selectLine(21)
9563return
9564:?:/zollhelp::
9565{
9566SendClientMessage(PREFIX . ".:: Zoll-Informationen ::.")
9567SendClientMessage(PREFIX . SECCOL . "/zollinfo [Zoll-ID]{FFFFFF} - Zollinformationen nach ID")
9568closeHotkey := closeCustomsControlNoMods
9569closeHotkey := StrReplace(closeHotkey, "!", "ALT+")
9570closeHotkey := StrReplace(closeHotkey, "^", "STRG+")
9571openHotkey := openCustomsControlNoMods
9572openHotkey := StrReplace(openHotkey, "!", "ALT+")
9573openHotkey := StrReplace(openHotkey, "^", "STRG+")
9574SendClientMessage(PREFIX . SECCOL . closeHotkey . "{FFFFFF} - Zoll schließen (lassen)")
9575SendClientMessage(PREFIX . SECCOL . openHotkey . "{FFFFFF} - Zoll öffnen (lassen)")
9576}
9577return
9578:?:/zollinfo::
9579{
9580customsID := PlayerInput("Zoll-ID: ")
9581if (customsID = "1") {
9582SendClientMessage(PREFIX . "Zollinformation (" . SECCOL . "Zollstation " . customsID . "{FFFFFF}):")
9583SendClientMessage(PREFIX . "Stadt: Los Santos - Las Venturas")
9584SendClientMessage(PREFIX . "Beschreibung: Zollstation von Red County nach Las Venturas (Nähe Hitman Base)")
9585} else if (customsID = "2") {
9586SendClientMessage(PREFIX . "Zollinformation (" . SECCOL . "Zollstation " . customsID . "{FFFFFF}):")
9587SendClientMessage(PREFIX . "Stadt: Red County - Bone County")
9588SendClientMessage(PREFIX . "Beschreibung: Zollstation von Red County nach Bone County (Nähe Hunter Quarry)")
9589} else if (customsID = "3") {
9590SendClientMessage(PREFIX . "Zollinformation (" . SECCOL . "Zollstation " . customsID . "{FFFFFF}):")
9591SendClientMessage(PREFIX . "Stadt: Blueberry - Bone County")
9592SendClientMessage(PREFIX . "Beschreibung: Zollstation auf der Martin Bridge von Blueberry nach Fort Carson")
9593} else if (customsID = "4") {
9594SendClientMessage(PREFIX . "Zollinformation (" . SECCOL . "Zollstation " . customsID . "{FFFFFF}):")
9595SendClientMessage(PREFIX . "Stadt: San Fierro - Tierra Robada")
9596SendClientMessage(PREFIX . "Beschreibung: Zollstation auf der Garver Bridge (Nähe FBI Base)")
9597} else if (customsID = "5") {
9598SendClientMessage(PREFIX . "Zollinformation (" . SECCOL . "Zollstation " . customsID . "{FFFFFF}):")
9599SendClientMessage(PREFIX . "Stadt: San Fierro - Bayside")
9600SendClientMessage(PREFIX . "Beschreibung: Zollstation bei der Gant Bride (von San Fierro nach Bayside)")
9601} else if (customsID = "6") {
9602SendClientMessage(PREFIX . "Zollinformation (" . SECCOL . "Zollstation " . customsID . "{FFFFFF}):")
9603SendClientMessage(PREFIX . "Stadt: Flint County - Red County")
9604SendClientMessage(PREFIX . "Beschreibung: Zollstation von der ehem. GmbH-Base nach The Panopticon")
9605} else if (customsID = "7") {
9606SendClientMessage(PREFIX . "Zollinformation (" . SECCOL . "Zollstation " . customsID . "{FFFFFF}):")
9607SendClientMessage(PREFIX . "Stadt: Flint County - Red County")
9608SendClientMessage(PREFIX . "Beschreibung: Zollstation von Flint County nach Red County (Richtung Blueberry)")
9609} else if (customsID = "8") {
9610SendClientMessage(PREFIX . "Zollinformation (" . SECCOL . "Zollstation " . customsID . "{FFFFFF}):")
9611SendClientMessage(PREFIX . "Stadt: Los Santos - Flint County")
9612SendClientMessage(PREFIX . "Beschreibung: Zollstation von Flint County nach Los Santos (Waffendealer Tunnel)")
9613} else if (customsID = "9") {
9614SendClientMessage(PREFIX . "Zollinformation (" . SECCOL . "Zollstation " . customsID . "{FFFFFF}):")
9615SendClientMessage(PREFIX . "Stadt: Los Santos - Flint County")
9616SendClientMessage(PREFIX . "Beschreibung: Zollstation von Flint County nach Los Santos (Flint Intersection)")
9617}
9618}
9619return
9620closeCustomsControlLabel:
9621{
9622if (IsInChat())
9623return
9624blockDialog()
9625SendChat("/stats")
9626Sleep, 200
9627unBlockDialog()
9628if (RegExMatch(getDialogText(), statsFormat, dialog_)) {
9629customsID := PlayerInput("Zoll schließen: ")
9630if (dialog_9 < 5) {
9631SendChat("/d [HQ]: Erbitte Schließung von Zollstation " . customsID . ".")
9632} else {
9633SendChat("/zollcontrol " . customsID . " zu")
9634}
9635} else {
9636SendInput, t/zollcontrol zu{left 3}
9637}
9638}
9639return
9640openCustomsControlLabel:
9641{
9642if (IsInChat())
9643return
9644blockDialog()
9645SendChat("/stats")
9646Sleep, 200
9647unBlockDialog()
9648if (RegExMatch(getDialogText(), statsFormat, dialog_)) {
9649customsID := PlayerInput("Zoll öffnen: ")
9650if (dialog_9 < 5) {
9651SendChat("/d [HQ]: Erbitte Öffnung von Zollstation " . customsID . ".")
9652} else {
9653SendChat("/zollcontrol " . customsID . " auf")
9654}
9655} else {
9656SendInput, t/zollcontrol auf{left 4}
9657}
9658}
9659return
9660govClosedCustomsLabel:
9661{
9662if (IsInChat())
9663return
9664SendInput, t/gov Die Zollstationen sind zurzeit geschlossen.{left 26}
9665}
9666return
9667govOpenedCustomsLabel:
9668{
9669if (IsInChat())
9670return
9671SendInput, t/gov Die Zollstationen sind nicht mehr geschlossen.{left 29}
9672}
9673return
9674openCustomsLabel:
9675{
9676if (IsInChat())
9677return
9678SendChat("/zoll")
9679}
9680return
9681openDoorLabel:
9682{
9683if (IsInChat())
9684return
9685SendChat("/auf")
9686}
9687return
9688:?:/tasks::
9689{
9690taskCount := tasks.Length()
9691if (taskCount == 0) {
9692SendClientMessage(PREFIX . "Es sind keine offenen Tasks vorhanden!")
9693return
9694}
9695Sleep, 200
9696pageCount := Ceil(taskCount / 15)
9697taskPageID := 0
9698page := 0
9699openTasks := "{FFFFFF}ID`t{FFFFFF}Spieler`t{FFFFFF}Aufgabe`t{FFFFFF}Auftraggeber`n"
9700for index, task in tasks {
9701if (taskPageID >= 15) {
9702ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Ausstehende Tasks", openTasks, "Weiter >>")
9703openTasks := "{FFFFFF}ID`t{FFFFFF}Spieler`t{FFFFFF}Aufgabe`t{FFFFFF}Auftraggeber`n"
9704taskPageID := 0
9705page++
9706Sleep, 500
9707Loop {
9708if (IsInChat())
9709continue
9710else
9711break
9712}
9713}
9714taskSubjectID := getPlayerIdByName(task["subject"], true)
9715if (taskSubjectID == -1) {
9716openTasks .= "{FFFFFF}" . task["id"] . "`t" . task["subject"] . "`t" . task["task"] . "`t" . task["creator"] . "`n"
9717} else {
9718openTasks .= "{FFFFFF}" . task["id"] . "`t" . task["subject"] . " (" . taskSubjectID . ")`t" . task["task"] . "`t" . task["creator"] . "`n"
9719}
9720taskPageID++
9721}
9722ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Ausstehende Tasks", openTasks, "OK")
9723}
9724return
9725:?:/ontasks::
9726{
9727if (tasks.Length() == 0) {
9728SendClientMessage(PREFIX . "Es sind keine offenen Tasks vorhanden!")
9729return
9730}
9731taskSubjectsOnline := 0
9732for index, task in tasks
9733{
9734taskSubjectID := getPlayerIdByName(task["subject"], true)
9735if (taskSubjectID != -1) {
9736SendClientMessage(PREFIX . SECCOL . task["id"] . "{FFFFFF}: " . SECCOL . task["subject"] . " {FFFFFF}(ID: " . SECCOL . taskSubjectID . "{FFFFFF}) - " . SECCOL . task["task"])
9737taskSubjectsOnline++
9738}
9739}
9740if (!taskSubjectsOnline) {
9741SendClientMessage(PREFIX . "Es ist kein Spieler online, für den ein Task existiert!")
9742}
9743}
9744return
9745:?:/addtask::
9746{
9747subject := PlayerInput("Spieler: ")
9748fullSubject := getFullName(subject)
9749if (fullSubject != "")
9750subject := fullSubject
9751newTask := PlayerInput("Aufgabe: ")
9752if (newTask == "")
9753return
9754url := baseURL . "api/tasks?username=" . username . "&password=" . password . "&action=add&subject=" . subject . "&task=" . newTask
9755addtaskResult := UrlDownloadToVar(url)
9756if (addtaskResult == "ERROR_BAD_LINK") {
9757SendClientMessage(PREFIX . "{FF0000}Fehlerhafte Parameterübergabe!")
9758} else if (addtaskResult == "ERROR_USER_NOT_FOUND") {
9759SendClientMessage(PREFIX . "{FF0000}Der Account mit dem Namen " . username . " wurde nicht gefunden!")
9760} else if (addtaskResult == "ERROR_WRONG_PASSWORD") {
9761SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert, das Passwort ist falsch!")
9762} else if (addtaskResult == "ERROR_ACCESS_DENIED") {
9763SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert!")
9764} else if (addtaskResult == "ERROR_NO_SUCH_ACTION") {
9765SendClientMessage(PREFIX . "{FF0000}Diese Aktion wird nicht unterstützt!")
9766} else if (addtaskResult == "ERROR_MYSQL_QUERY") {
9767SendClientMessage(PREFIX . "{FF0000}Es ist ein Fehler bei der MySQL-Abfrage aufgetreten!")
9768} else if (addtaskResult == "ERROR_CONNECTION") {
9769SendClientMessage(PREFIX . "{FF0000}Aktuell liegt ein Fehler in der Verbindung zum Server vor!")
9770} else if (addtaskResult == "SUCCESS") {
9771SendChat("/d [HQ]: Neuer Task - Betreffender Spieler: " . subject . ", Aufgabe: " . newTask)
9772} else {
9773SendClientMessage(PREFIX . "Es ist ein unbekannter Fehler aufgetreten: {FF0000}" . addtaskResult)
9774}
9775}
9776return
9777:?:/dtask::
9778:?:/deltask::
9779{
9780deltaskID := PlayerInput("ID des Tasks: ")
9781if (deltaskID == "")
9782return
9783url := baseURL . "api/tasks?username=" . username . "&password=" . password . "&action=delete&id=" . deltaskID
9784deltaskResult := UrlDownloadToVar(url)
9785if (deltaskResult == "ERROR_BAD_LINK") {
9786SendClientMessage(PREFIX . "{FF0000}Fehlerhafte Parameterübergabe!")
9787} else if (deltaskResult == "ERROR_USER_NOT_FOUND") {
9788SendClientMessage(PREFIX . "{FF0000}Der Account mit dem Namen " . username . " wurde nicht gefunden!")
9789} else if (deltaskResult == "ERROR_WRONG_PASSWORD") {
9790SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert, das Passwort ist falsch!")
9791} else if (deltaskResult == "ERROR_ACCESS_DENIED") {
9792SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert!")
9793} else if (deltaskResult == "ERROR_NO_SUCH_ACTION") {
9794SendClientMessage(PREFIX . "{FF0000}Diese Aktion wird nicht unterstützt!")
9795} else if (deltaskResult == "ERROR_MYSQL_QUERY") {
9796SendClientMessage(PREFIX . "{FF0000}Es ist ein Fehler bei der MySQL-Abfrage aufgetreten!")
9797} else if (deltaskResult == "ERROR_CONNECTION") {
9798SendClientMessage(PREFIX . "{FF0000}Aktuell liegt ein Fehler in der Verbindung zum Server vor!")
9799} else if (deltaskResult == "SUCCESS") {
9800SendChat("/d [HQ]: Task #" . deltaskID . " wurde bearbeitet und gelöscht.")
9801} else {
9802SendClientMessage(PREFIX . "Es ist ein unbekannter Fehler aufgetreten: {FF0000}" . deltaskResult)
9803}
9804}
9805return
9806:?:/whlist::
9807{
9808data := []
9809data["username"] := username
9810data["password"] := password
9811data["type"] := "list"
9812jsonData := JSON.Dump(data)
9813wheelmanResult := UrlDownloadToVar(baseURL . "api/wheelman?data=" . jsonData)
9814if (wheelmanResult == "ERROR_BAD_LINK") {
9815SendClientMessage(PREFIX . "{FF0000}Fehlerhafte Parameterübergabe!")
9816} else if (wheelmanResult == "ERROR_USER_NOT_FOUND") {
9817SendClientMessage(PREFIX . "{FF0000}Der Account mit dem Namen " . username . " wurde nicht gefunden!")
9818} else if (wheelmanResult == "ERROR_WRONG_PASSWORD") {
9819SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert, das Passwort ist falsch!")
9820} else if (wheelmanResult == "ERROR_ACCESS_DENIED") {
9821SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert!")
9822} else if (wheelmanResult == "ERROR_NO_SUCH_ACTION") {
9823SendClientMessage(PREFIX . "{FF0000}Diese Aktion wird nicht unterstützt!")
9824} else if (wheelmanResult == "ERROR_MYSQL_QUERY") {
9825SendClientMessage(PREFIX . "{FF0000}Es ist ein Fehler bei der MySQL-Abfrage aufgetreten!")
9826} else if (wheelmanResult == "ERROR_CONNECTION") {
9827SendClientMessage(PREFIX . "{FF0000}Aktuell liegt ein Fehler in der Verbindung zum Server vor!")
9828} else {
9829try {
9830wheelmanList := JSON.Load(wheelmanResult)
9831} catch {
9832SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
9833FormatTime, time, , dd.MM.yyyy HH:mm:ss
9834FileAppend, [%time%] Beim Laden der Wheelman-Liste ist ein Fehler aufgetreten: %wheelmanResult%`n, log.txt
9835return
9836}
9837if (wheelmanList.Length() == 0) {
9838SendClientMessage(PREFIX . "Es sind keine Wheelman eingetragen!")
9839return
9840}
9841wheelmanDialog := "Name`tID`tHinzugefügt von"
9842for index, entry in wheelmanList {
9843color := "{FF0000}"
9844id := getPlayerIdByName(entry["name"], true)
9845if (id != -1) {
9846color := "{00FF00}"
9847} else {
9848id := "-"
9849}
9850wheelmanDialog .= "`n" . color . entry["name"] . "`t" . id . "`t" . entry["added_by"]
9851}
9852ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Wheelman-Liste", wheelmanDialog, "Schließen")
9853}
9854}
9855return
9856:?:/whadd::
9857{
9858whname := PlayerInput("Name des WH: ")
9859if (whname == "")
9860return
9861fullWhname := getFullName(whname)
9862if (fullWhname != "")
9863whname := fullWhname
9864data := []
9865data["username"] := username
9866data["password"] := password
9867data["type"] := "add"
9868data["name"] := whname
9869jsonData := JSON.Dump(data)
9870wheelmanResult := UrlDownloadToVar(baseURL . "api/wheelman?data=" . jsonData)
9871if (wheelmanResult == "ERROR_BAD_LINK") {
9872SendClientMessage(PREFIX . "{FF0000}Fehlerhafte Parameterübergabe!")
9873} else if (wheelmanResult == "ERROR_USER_NOT_FOUND") {
9874SendClientMessage(PREFIX . "{FF0000}Der Account mit dem Namen " . username . " wurde nicht gefunden!")
9875} else if (wheelmanResult == "ERROR_WRONG_PASSWORD") {
9876SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert, das Passwort ist falsch!")
9877} else if (wheelmanResult == "ERROR_ACCESS_DENIED") {
9878SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert!")
9879} else if (wheelmanResult == "ERROR_NO_SUCH_ACTION") {
9880SendClientMessage(PREFIX . "{FF0000}Diese Aktion wird nicht unterstützt!")
9881} else if (wheelmanResult == "ERROR_MYSQL_QUERY") {
9882SendClientMessage(PREFIX . "{FF0000}Es ist ein Fehler bei der MySQL-Abfrage aufgetreten!")
9883} else if (wheelmanResult == "ERROR_CONNECTION") {
9884SendClientMessage(PREFIX . "{FF0000}Aktuell liegt ein Fehler in der Verbindung zum Server vor!")
9885} else if (wheelmanResult == "SUCCESS") {
9886SendClientMessage(PREFIX . "Der Wheelman " . SECCOL . whname . " {FFFFFF}wurde erfolgreich hinzugefügt!")
9887} else {
9888SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
9889}
9890}
9891return
9892:?:/whdel::
9893{
9894whname := PlayerInput("Name des WH: ")
9895if (whname == "")
9896return
9897fullWhname := getFullName(whname)
9898if (fullWhname != "")
9899whname := fullWhname
9900data := []
9901data["username"] := username
9902data["password"] := password
9903data["type"] := "remove"
9904data["name"] := whname
9905jsonData := JSON.Dump(data)
9906wheelmanResult := UrlDownloadToVar(baseURL . "api/wheelman?data=" . jsonData)
9907if (wheelmanResult == "ERROR_BAD_LINK") {
9908SendClientMessage(PREFIX . "{FF0000}Fehlerhafte Parameterübergabe!")
9909} else if (wheelmanResult == "ERROR_USER_NOT_FOUND") {
9910SendClientMessage(PREFIX . "{FF0000}Der Account mit dem Namen " . username . " wurde nicht gefunden!")
9911} else if (wheelmanResult == "ERROR_WRONG_PASSWORD") {
9912SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert, das Passwort ist falsch!")
9913} else if (wheelmanResult == "ERROR_ACCESS_DENIED") {
9914SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert!")
9915} else if (wheelmanResult == "ERROR_NO_SUCH_ACTION") {
9916SendClientMessage(PREFIX . "{FF0000}Diese Aktion wird nicht unterstützt!")
9917} else if (wheelmanResult == "ERROR_MYSQL_QUERY") {
9918SendClientMessage(PREFIX . "{FF0000}Es ist ein Fehler bei der MySQL-Abfrage aufgetreten!")
9919} else if (wheelmanResult == "ERROR_CONNECTION") {
9920SendClientMessage(PREFIX . "{FF0000}Aktuell liegt ein Fehler in der Verbindung zum Server vor!")
9921} else if (wheelmanResult == "SUCCESS") {
9922SendClientMessage(PREFIX . "Der Wheelman " . SECCOL . whname . " {FFFFFF}wurde erfolgreich entfernt!")
9923} else {
9924SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
9925}
9926}
9927return
9928:?:/agov::
9929:?:/govinfo::
9930:?:/govreport::
9931{
9932govReportsResult := UrlDownloadToVar(baseURL . "api/getgovreport?username=" . username . "&password=" . password)
9933if (govReportsResult == "ERROR_CONNECTION") {
9934SendClientMessage(PREFIX . "{FF0000}Aktuell liegt ein Fehler in der Verbindung zum Server vor!")
9935} else {
9936try {
9937govReportsArray := JSON.Load(govReportsResult)
9938} catch {
9939SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
9940FormatTime, time, , dd.MM.yyyy HH:mm:ss
9941FileAppend, [%time%] Beim Laden der Gov-Meldungen ist ein Fehler aufgetreten: %govReportsResult%`n, log.txt
9942return
9943}
9944if (govReportsArray["error"] != "") {
9945SendClientMessage(PREFIX . "{FF0000}Fehler: " . govReportsArray["error"])
9946} else {
9947govReports := govReportsArray["reports"]
9948if (govReports.Length() == 0) {
9949SendClientMessage(PREFIX . "Es sind keine Gov-Meldungen vorhanden!")
9950} else {
9951govReportsDialog := "ID`tTitel"
9952for index, entry in govReports {
9953govReportsDialog .= "`n" . entry["id"] . "`t" . entry["title"]
9954}
9955ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Gov-Meldungen", govReportsDialog, "Schließen")
9956}
9957}
9958}
9959}
9960return
9961~LButton::
9962{
9963Sleep, 200
9964if (isDialogOpen()) {
9965dialogCaption := getDialogCaption()
9966if (RegExMatch(dialogCaption, "Kofferraum von Fahrzeug (\d+) \((.+)\)")) {
9967line := getDialogLine(getDialogIndex())
9968if (RegExMatch(line, "(\S+): (\d+)", line_)) {
9969if (line_2 > 0) {
9970type := line_1
9971unit := "Munition"
9972if (type == "Drogen") {
9973type := "drugs"
9974unit := "g"
9975} else if (type == "Materialien") {
9976type := "mats"
9977unit := ""
9978}
9979SendClientMessage(PREFIX . "Möchtest du " . SECCOL line_2 . unit . " " . line_1 . " {FFFFFF}konfiszieren? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
9980KeyWait, X, D, T10
9981if (!Errorlevel) {
9982SendChat("/trunk clear " . type)
9983}
9984}
9985}
9986} else if (RegExMatch(dialogCaption, "Gov-Meldungen")) {
9987line := getDialogLine(getDialogIndex())
9988if (RegExMatch(line, "(\d+)`t(.+)", line_)) {
9989govReportResult := UrlDownloadToVar(baseURL . "api/getgovreport?username=" . username . "&password=" . password . "&id=" . line_1)
9990if (govReportResult == "ERROR_CONNECTION") {
9991SendClientMessage(PREFIX . "{FF0000}Aktuell liegt ein Fehler in der Verbindung zum Server vor!")
9992} else {
9993try {
9994govReportArray := JSON.Load(govReportResult)
9995} catch {
9996SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
9997FormatTime, time, , dd.MM.yyyy HH:mm:ss
9998FileAppend, [%time%] Beim Laden der Gov-Meldung ist ein Fehler aufgetreten: %govReportResult%`n, log.txt
9999return
10000}
10001if (govReportArray["error"] != "") {
10002SendClientMessage(PREFIX . "{FF0000}Fehler: " . govReportArray["error"])
10003} else {
10004SendInput, {ESC}
10005SendClientMessage(PREFIX . "Möchtest du die Gov-Meldung " . SECCOL . line_2 . " {FFFFFF}ankündigen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
10006for index, entry in govReportArray["text"]
10007{
10008SendClientMessage(PREFIX . entry)
10009}
10010KeyWait, X, D, T10
10011if (!Errorlevel) {
10012for index, entry in govReportArray["text"]
10013{
10014SendChat("/gov " . entry)
10015if (!admin)
10016Sleep, 750
10017}
10018}
10019}
10020}
10021}
10022} else if (RegExMatch(dialogCaption, "Ausstehende Tasks")) {
10023line := getDialogLine(getDialogIndex())
10024if (RegExMatch(line, "(\d+)`t(\S+)( \((\d+)\))?`t(.+)`t(\S+)", line_)) {
10025for index, task in tasks {
10026if (task["id"] == line_1) {
10027taskSubjectID := getPlayerIdByName(line_2, true)
10028SendClientMessage(PREFIX . "Task " . SECCOL . "#" . task["id"] . " {FFFFFF}- Spieler: " . SECCOL . task["subject"] . (taskSubjectID != -1 ? " {FFFFFF}(ID: " . SECCOL . taskSubjectID . "{FFFFFF})" : ""))
10029SendClientMessage(PREFIX . "Erstellt am: " . SECCOL . task["time"] . " {FFFFFF}- Aufgabe: " . SECCOL . task["task"])
10030}
10031}
10032}
10033} else if (RegExMatch(dialogCaption, "Übersicht der Tankstellen")) {
10034line := getDialogLine(getDialogIndex())
10035if (RegExMatch(line, "{\S+}(.+)`t(.+)`t{\S+}(\d+)\$ {\S+}- \S+ m`t{\S+}.+ {\S+}\(\S+\)", line_)) {
10036name := line_1
10037owner := line_2
10038for index, entry in gasstations {
10039if (entry["name"] == name && entry["owner"] == owner) {
10040x := entry["x"]
10041y := entry["y"]
10042z := entry["z"]
10043playerCoords := getCoordinates()
10044distance := Round(getDistanceToPoint(x, y, z, playerCoords[1], playerCoords[2], playerCoords[3]))
10045setCheckpoint(x, y, z, 3)
10046SendClientMessage(PREFIX . "Tankstelle " . SECCOL . name . " {FFFFFF}(" . SECCOL . entry["price"] . "${FFFFFF}) in " . SECCOL . FormatNumber(distance) . " m {FFFFFF}Entfernung.")
10047}
10048}
10049}
10050}
10051}
10052}
10053return
10054megaFollowLabel:
10055{
10056if (!tv) {
10057if (IsInChat())
10058return
10059if (watermode) {
10060SendChat("/m >> Küstenwache, bitte folgen Sie dem Boot <<")
10061} else if (getPlayerSkinID() == 285) {
10062SendChat("/m >> S.W.A.T., bitte folgen Sie dem Einsatzfahrzeug <<")
10063} else if (airmode) {
10064SendChat("/m >> C.A.S., bitte folgen Sie dem Helikopter! <<")
10065} else {
10066SendChat("/m >> " . department . ", bitte folgen Sie dem Einsatzfahrzeug <<")
10067}
10068}
10069}
10070return
10071megaControlLabel:
10072{
10073if (!tv) {
10074if (IsInChat())
10075return
10076if (watermode) {
10077SendChat("/m >> Küstenwache, Wasserverkehrskontrolle. Halten Sie bitte an <<")
10078} else if (getPlayerSkinID() == 285) {
10079SendChat("/m >> S.W.A.T., Straßenverkehrskontrolle. Fahren Sie SOFORT rechts ran! <<")
10080} else if (airmode) {
10081SendChat("/m >> C.A.S., Luftverkehrskontrolle. Landen Sie umgehend! <<")
10082} else {
10083SendChat("/m >> " . department . ", Straßenverkehrskontrolle. Fahren Sie bitte rechts ran <<")
10084}
10085}
10086}
10087return
10088megaStopLabel:
10089{
10090if (!tv) {
10091if (IsInChat())
10092return
10093if (watermode) {
10094SendChat("/m >> Küstenwache, stoppen Sie SOFORT Ihr Boot! <<")
10095} else if (getPlayerSkinID() == 285) {
10096SendChat("/m >> S.W.A.T., halten Sie SOFORT an!<<")
10097} else if (airmode) {
10098SendChat("/m >> C.A.S., landen Sie SOFORT! <<")
10099} else {
10100SendChat("/m >> " . department . ", halten Sie SOFORT an! <<")
10101}
10102Sleep, 3000
10103if (isPlayerInAnyVehicle()) {
10104SendClientMessage(PREFIX . "Du darfst nun das Fahrzeug beschießen, sofern der Spieler flüchtet.")
10105} else {
10106SendClientMessage(PREFIX . "Du darfst den Verbrecher nun Tazern " . SECCOL . "(Ausnahme: Kampfsituation)")
10107}
10108}
10109}
10110return
10111megaShootWarningLabel:
10112{
10113if (!tv) {
10114if (IsInChat())
10115return
10116if (watermode) {
10117dept := "Küstenwache"
10118} else if (getPlayerSkinID() == 285) {
10119dept := "S.W.A.T."
10120} else if (airmode) {
10121dept := "C.A.S."
10122} else {
10123dept := department
10124}
10125SendChat("/m >> " . dept . ", letzte Warnung, bleiben Sie stehen oder wir schießen! <<")
10126}
10127}
10128return
10129megaGetOutOfCarLabel:
10130{
10131if (!tv) {
10132if (IsInChat())
10133return
10134if (watermode) {
10135dept := "Küstenwache"
10136} else if (getPlayerSkinID() == 285) {
10137dept := "S.W.A.T."
10138} else if (airmode) {
10139dept := "C.A.S."
10140} else {
10141dept := department
10142}
10143SendChat("/m >> " . dept . ", steigen Sie SOFORT mit erhobenen Händen aus Ihrem Fahrzeug! <<")
10144}
10145}
10146return
10147megaClearLabel:
10148{
10149if (!tv) {
10150if (IsInChat())
10151return
10152if (watermode) {
10153SendChat("/m >> Küstenwache, fahren Sie SOFORT zur Seite! <<")
10154} else if (getPlayerSkinID() == 285) {
10155SendChat("/m >> S.W.A.T., räumen Sie SOFORT die Straße! <<")
10156} else if (airmode) {
10157SendChat("/m >> C.A.S., räumen Sie SOFORT den Luftraum! <<")
10158} else {
10159SendChat("/m >> " . department . ", räumen Sie SOFORT die Straße! <<")
10160}
10161}
10162}
10163return
10164megaWeaponsLabel:
10165{
10166if (!tv) {
10167if (IsInChat())
10168return
10169if (getPlayerSkinID() == 285) {
10170SendChat("/m >> S.W.A.T., legen Sie SOFORT die Waffen nieder oder wir werden Gewalt anwenden! <<")
10171} else {
10172SendChat("/m >> " . department . ", legen Sie SOFORT die Waffen nieder oder wir werden Gewalt anwenden! <<")
10173}
10174}
10175}
10176return
10177megaLeaveLabel:
10178{
10179if (!tv) {
10180if (IsInChat())
10181return
10182if (watermode) {
10183dept := "Küstenwache"
10184} else if (getPlayerSkinID() == 285) {
10185dept := "S.W.A.T."
10186} else if (airmode) {
10187dept := "C.A.S."
10188} else {
10189dept := department
10190}
10191if (getPlayerInteriorId() == 0) {
10192SendChat("/m >> " . dept . ", verlassen Sie SOFORT dieses Gelände! <<")
10193} else {
10194SendChat("/m >> " . dept . ", verlassen Sie SOFORT dieses Gebäude! <<")
10195}
10196}
10197}
10198return
10199megaStopFollowLabel:
10200{
10201if (!tv) {
10202if (IsInChat())
10203return
10204if (watermode) {
10205dept := "Küstenwache"
10206} else if (getPlayerSkinID() == 285) {
10207dept := "S.W.A.T."
10208} else if (airmode) {
10209dept := "C.A.S."
10210} else {
10211dept := department
10212}
10213SendChat("/m >> " . dept . ", unterlassen Sie umgehend die Verfolgung! <<")
10214}
10215}
10216return
10217megaRoadTrafficActLabel:
10218{
10219if (!tv) {
10220if (IsInChat())
10221return
10222if (watermode) {
10223dept := "Küstenwache"
10224} else if (getPlayerSkinID() == 285) {
10225dept := "S.W.A.T."
10226} else if (airmode) {
10227dept := "C.A.S."
10228} else {
10229dept := department
10230}
10231SendChat("/m >> " . dept . ", bitte halten Sie sich an die Straßenverkehrsordnung <<")
10232}
10233}
10234return
10235:?:/rz::
10236:?:/razzia::
10237{
10238if (!tv) {
10239if (getPlayerSkinID() == 285) {
10240SendChat("/m >> S.W.A.T., dies ist eine Razzia! <<")
10241} else {
10242SendChat("/m >> " . department . ", dies ist eine Razzia! <<")
10243}
10244SendChat("/m >> Nehmen Sie SOFORT die Hände hoch oder wir schießen! <<")
10245}
10246}
10247return
10248:?:/weiter::
10249{
10250if (!tv) {
10251if (getPlayerSkinID() == 285) {
10252SendChat("/m >> S.W.A.T., alle Personen bitte SOFORT weiterfahren! <<")
10253} else {
10254SendChat("/m >> " . department . ", alle Personen bitte SOFORT weiterfahren! <<")
10255}
10256}
10257}
10258return
10259:?:/vna::
10260{
10261name := PlayerInput("Name: ")
10262name := getFullName(name)
10263if (name == "")
10264return
10265if (getPlayerSkinID() == 285) {
10266SendChat("/m >> S.W.A.T., " . name . " halten Sie SOFORT an! <<")
10267} else {
10268SendChat("/m >> " . department . ", " . name . " halten Sie SOFORT an! <<")
10269}
10270SendChat("/m >> Letzte Warnung " . getFullName(name) . ", sollten Sie sich weigern, wenden wir härtere Maßnahmen an! <<")
10271}
10272return
10273atkWantedsLabel:
10274{
10275if (IsInChat())
10276return
10277name := PlayerInput("Angriff/Beschuss: ")
10278name := getFullName(name)
10279if (name != "") {
10280giveWanteds(name, 9)
10281}
10282}
10283return
10284escapeWantedsLabel:
10285{
10286if (IsInChat())
10287return
10288name := PlayerInput("Flucht/Fluchtversuch: ")
10289name := getFullName(name)
10290if (name != "") {
10291giveWanteds(name, 15)
10292if (autoFindLastEscapee) {
10293playerToFind := name
10294if (!autoShowRunning) {
10295autoFindRunning := true
10296GoSub, AutoFindTimer
10297SetTimer, AutoFindTimer, 5500
10298}
10299SendClientMessage(PREFIX . "Das automatische Suchen wird mit der Taste " . SECCOL . stopAutomaticSystemsNoMods . " {FFFFFF}beendet.")
10300}
10301}
10302}
10303return
10304escapeAidWantedsLabel:
10305{
10306if (IsInChat())
10307return
10308name := PlayerInput("Beihilfe zur Flucht: ")
10309name := getFullName(name)
10310if (name != "") {
10311giveWanteds(name, 16)
10312}
10313}
10314return
10315refusalWantedsLabel:
10316{
10317if (IsInChat())
10318return
10319name := PlayerInput("Verweigerung: ")
10320name := getFullName(name)
10321if (name != "") {
10322giveWanteds(name, 5)
10323}
10324}
10325return
10326obstructionWantedsLabel:
10327{
10328if (IsInChat())
10329return
10330name := PlayerInput("Behinderung der Justiz: ")
10331name := getFullName(name)
10332if (name != "") {
10333giveWanteds(name, 4)
10334}
10335}
10336return
10337possessionWantedsLabel:
10338{
10339if (IsInChat())
10340return
10341name := PlayerInput("Besitz von illegalen Gegenständen: ")
10342name := getFullName(name)
10343if (name != "") {
10344SendClientMessage(PREFIX . SECCOL . "1: {FFFFFF}Drogen/Samen - " . SECCOL . "2: {FFFFFF}Materialien")
10345wantedType := PlayerInput("Typ: ")
10346if (wantedType == "1") {
10347giveWanteds(name, 37)
10348} else if (wantedType == "2") {
10349giveWanteds(name, 38)
10350}
10351}
10352}
10353return
10354tradeWantedsLabel:
10355{
10356if (IsInChat())
10357return
10358name := PlayerInput("Handel mit illegalen Gegenständen: ")
10359name := getFullName(name)
10360if (name != "") {
10361giveWanteds(name, 11)
10362}
10363}
10364return
10365drugConsumptionWantedsLabel:
10366{
10367if (IsInChat())
10368return
10369name := PlayerInput("Drogenkonsum: ")
10370name := getFullName(name)
10371if (name != "") {
10372giveWanteds(name, 19)
10373}
10374}
10375return
10376unauthorizedEnterWantedsLabel:
10377{
10378if (IsInChat())
10379return
10380name := PlayerInput("Unbefugter Betritt: ")
10381name := getFullName(name)
10382if (name != "") {
10383giveWanteds(name, 13)
10384}
10385}
10386return
10387customsEscapeWantedsLabel:
10388{
10389if (IsInChat())
10390return
10391name := PlayerInput("Zollflucht: ")
10392name := getFullName(name)
10393if (name != "") {
10394giveWanteds(name, 12)
10395}
10396}
10397return
10398vehicleTheftWantedsLabel:
10399{
10400if (IsInChat())
10401return
10402name := PlayerInput("Diebstahl: ")
10403name := getFullName(name)
10404if (name != "") {
10405SendClientMessage(PREFIX . SECCOL . "1: {FFFFFF}Privatfahrzeug - " . SECCOL . "2: {FFFFFF}Dienstfahrzeug - " . SECCOL . "3: {FFFFFF}gep./bew. Dienstfahrzeug")
10406wantedType := PlayerInput("Typ: ")
10407if (wantedType == "1") {
10408giveWanteds(name, 18)
10409} else if (wantedType == "2") {
10410giveWanteds(name, 23)
10411} else if (wantedType == "3") {
10412giveWanteds(name, 24)
10413}
10414}
10415}
10416return
10417insultingWantedsLabel:
10418{
10419if (IsInChat())
10420return
10421name := PlayerInput("Beamtenbeleidigung: ")
10422name := getFullName(name)
10423if (name != "") {
10424giveWanteds(name, 2)
10425}
10426}
10427return
10428useOfWeaponsWantedsLabel:
10429{
10430if (IsInChat())
10431return
10432name := PlayerInput("Waffengebrauch: ")
10433name := getFullName(name)
10434if (name != "") {
10435giveWanteds(name, 6)
10436}
10437}
10438return
10439possessionOfWeaponsWantedsLabel:
10440{
10441if (IsInChat())
10442return
10443name := PlayerInput("Waffenbesitz: ")
10444name := getFullName(name)
10445if (name != "") {
10446giveWanteds(name, 7)
10447}
10448}
10449return
10450briberyWantedsLabel:
10451{
10452if (IsInChat())
10453return
10454name := PlayerInput("Beamtenbestechung: ")
10455name := getFullName(name)
10456if (name != "") {
10457giveWanteds(name, 3)
10458}
10459}
10460return
10461escWantedsLabel:
10462{
10463if (IsInChat())
10464return
10465name := PlayerInput("ESC-Flucht: ")
10466name := getFullName(name)
10467if (name != "") {
10468giveWanteds(name, 21)
10469}
10470}
10471return
10472:?:/sb::
10473{
10474name := PlayerInput("Sachbeschädigung: ")
10475name := getFullName(name)
10476if (name != "") {
10477giveWanteds(name, 14)
10478}
10479}
10480return
10481:?:/fof::
10482{
10483name := PlayerInput("Fahren ohne Führerschein: ")
10484name := getFullName(name)
10485if (name != "") {
10486giveWanteds(name, 39)
10487}
10488}
10489return
10490:?:/fob::
10491{
10492name := PlayerInput("Fahren ohne Bootsschein: ")
10493name := getFullName(name)
10494if (name != "") {
10495giveWanteds(name, 17)
10496}
10497}
10498return
10499:?:/wdl::
10500{
10501name := PlayerInput("Wilderrei: ")
10502name := getFullName(name)
10503if (name != "") {
10504giveWanteds(name, 8)
10505}
10506}
10507return
10508:?:/entf::
10509{
10510name := PlayerInput("Entführer: ")
10511name := getFullName(name)
10512if (name != "") {
10513SendClientMessage(PREFIX . SECCOL . "1: {FFFFFF}Bürger - " . SECCOL . "2: {FFFFFF}Staatsbeamter")
10514wantedType := PlayerInput("Typ: ")
10515if (wantedType == "1") {
10516giveWanteds(name, 20)
10517} else if (wantedType == "2") {
10518giveWanteds(name, 22)
10519}
10520}
10521}
10522return
10523clearWantedsLabel:
10524{
10525if (IsInChat()) {
10526return
10527}
10528SendInput, t/clear{Space}
10529}
10530return
10531:?:/rew::
10532:?:/rewtd::
10533:?:/rewanted::
10534{
10535rewtdname := PlayerInput("Spieler: ")
10536rewtdname := getFullName(rewtdname)
10537if (rewtdname == "")
10538return
10539rewtdcount := PlayerInput("Wanted-Anzahl: ")
10540if rewtdcount is not number
10541return
10542Loop %rewtdcount% {
10543SendChat("/suspect " . rewtdname . " Re-Wanted")
10544if (!admin)
10545Sleep, 500
10546}
10547}
10548return
10549secondRowPointsLabel:
10550{
10551if (IsInChat())
10552return
10553name := PlayerInput("2. Reihe: ")
10554if (name != "") {
10555givePoints(name, 27)
10556}
10557}
10558return
10559roadHazardPointsLabel:
10560{
10561if (IsInChat())
10562return
10563name := PlayerInput("SVG: ")
10564if (name != "") {
10565givePoints(name, 28)
10566}
10567}
10568return
10569wrongSitePointsLabel:
10570{
10571if (IsInChat())
10572return
10573name := PlayerInput("Falsche Seite: ")
10574if (name != "") {
10575givePoints(name, 29)
10576}
10577}
10578return
10579speedPointsLabel:
10580{
10581if (IsInChat())
10582return
10583name := PlayerInput("Höchstgeschwindigkeit: ")
10584if (name != "") {
10585givePoints(name, 34)
10586}
10587}
10588return
10589rightOfWayPointsLabel:
10590{
10591if (IsInChat())
10592return
10593name := PlayerInput("Vorfahrt: ")
10594if (name != "") {
10595givePoints(name, 30)
10596}
10597}
10598return
10599offsitePointsLabel:
10600{
10601if (IsInChat())
10602return
10603name := PlayerInput("Abseits: ")
10604if (name != "") {
10605givePoints(name, 25)
10606}
10607}
10608return
10609lightPointsLabel:
10610{
10611if (IsInChat())
10612return
10613name := PlayerInput("Licht: ")
10614if (name != "") {
10615givePoints(name, 33)
10616}
10617}
10618return
10619noParkingPointsLabel:
10620{
10621if (IsInChat())
10622return
10623name := PlayerInput("Parkverbot: ")
10624if (name != "") {
10625zone := getPlayerZone()
10626givePoints(name, 26, " [" . zone . "]")
10627}
10628}
10629return
10630influenceOfDrugsPointsLabel:
10631{
10632if (IsInChat())
10633return
10634name := PlayerInput("Alkohol-/Drogeneinfluss: ")
10635SendClientMessage(PREFIX . "1: weniger als 1,3 Promille - 2: mehr als 1,3 Promille")
10636type := PlayerInput("Typ: ")
10637if (name != "") {
10638if (type == "1") {
10639givePoints(name, 31)
10640} else if (type == "2") {
10641givePoints(name, 32)
10642}
10643}
10644}
10645return
10646clearPointsLabel:
10647if (IsInChat())
10648return
10649:?:/clearpoints::
10650:?:/tst::
10651{
10652name := PlayerInput("Name/ID des Spielers: ")
10653amount := PlayerInput("Anzahl der Punkte: ")
10654SendChat("/licunban " . name . " points " . amount)
10655}
10656return
10657:?:/nt::
10658{
10659if (currentTicketMoney > 0) {
10660giveTicket(lastTicketPlayer, currentTicketMoney, lastTicketReason)
10661} else {
10662SendClientMessage(PREFIX . "Es ist kein Ticket mehr ausstellbar.")
10663}
10664}
10665return
10666:?:/catalog::
10667:?:/katalog::
10668{
10669result := URLDownloadToVar(baseURL . "api/catalog-get?username=" . username . "&password=" . password . "&type=points")
10670try {
10671data := JSON.Load(result)
10672} catch {
10673SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
10674FormatTime, time, , dd.MM.yyyy HH:mm:ss
10675FileAppend, [%time%] Beim Laden der Katalogs ist ein Fehler aufgetreten: %result%`n, log.txt
10676return
10677}
10678dialog := "ID`tGrund`tAliase`tAnzahl Punkte"
10679for index, entry in data["catalog"] {
10680dialog .= "`n" . entry["id"] . "`t" . entry["reason"] . "`t" . (entry["aliases"] == "" ? "-" : entry["aliases"]) . "`t" . entry["amount"]
10681}
10682ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Punktekatalog", dialog, "OK")
10683}
10684return
10685:?:/wcatalog::
10686:?:/wkatalog::
10687{
10688result := URLDownloadToVar(baseURL . "api/catalog-get?username=" . username . "&password=" . password . "&type=wanteds")
10689try {
10690data := JSON.Load(result)
10691} catch {
10692SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
10693FormatTime, time, , dd.MM.yyyy HH:mm:ss
10694FileAppend, [%time%] Beim Laden der Katalogs ist ein Fehler aufgetreten: %result%`n, log.txt
10695return
10696}
10697dialog := "ID`tGrund`tAliase`tAnzahl Wanteds"
10698for index, entry in data["catalog"] {
10699dialog .= "`n" . entry["id"] . "`t" . entry["reason"] . "`t" . (entry["aliases"] == "" ? "-" : entry["aliases"]) . "`t" . entry["amount"]
10700}
10701ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Wantedkatalog", dialog, "OK")
10702}
10703return
10704:?:/stvo::
10705{
10706if (!tv) {
10707suspectName := PlayerInput("Spieler: ")
10708suspectName := getFullName(suspectName)
10709if (suspectName == "")
10710return
10711stvoReason := PlayerInput("Verstoß: ")
10712if (stvoReason == "")
10713return
10714result := URLDownloadToVar(baseURL . "api/catalog-check?username=" . username . "&password=" . password . "&type=points&id=" . stvoReason . "&suspect=" . suspectName)
10715try {
10716data := JSON.Load(result)
10717} catch {
10718SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
10719FormatTime, time, , dd.MM.yyyy HH:mm:ss
10720FileAppend, [%time%] Beim Laden des Punkte-Katalogs ist ein Fehler aufgetreten: %result%`n, log.txt
10721return
10722}
10723if (data["error"] != "") {
10724SendClientMessage(PREFIX . data["error"])
10725} else {
10726autoName := suspectName
10727autoReasonID := data["id"]
10728autoReason := data["reason"]
10729autoPoints := data["amount"]
10730autoTicket := autoPoints * 2000
10731autoSpeed := 0
10732if (!data["registered"]) {
10733SendClientMessage(PREFIX . SECCOL . suspectName . " {FFFFFF}hat bereits " . SECCOL . autoPoints . " {FFFFFF}Punkte wegen " . SECCOL . autoReason . " {FFFFFF}von " . SECCOL . data["lastoffical"] . " {FFFFFF}um " . SECCOL . data["time"] . " Uhr {FFFFFF}bekommen!")
10734SendClientMessage(PREFIX . "Drücke " . SECCOL . "X {FFFFFF}um trotzdem fortzufahren!")
10735KeyWait, X, D, T10
10736if (ErrorLevel) {
10737return
10738}
10739}
10740SendChat("/l Guten " . getDayTime() . " " . autoName . ", Sie haben gegen die StVO verstoßen.")
10741if (!admin)
10742Sleep, 500
10743SendChat("/l Ihre Vergehen: " . autoReason)
10744if (!admin)
10745Sleep, 500
10746SendChat("/l Möchten Sie ein Ticket in Höhe von " . autoTicket . "$ oder " . autoPoints . " Strafpunkte?")
10747Sleep, 100
10748SendClientMessage(PREFIX . "Verwende " . SECCOL . "/aticket {FFFFFF}um ein Ticket oder " . SECCOL . "/apunkte{FFFFFF}, um die Punkte auszustellen.")
10749}
10750}
10751}
10752return
10753:?:/speed::
10754{
10755name := PlayerInput("Name/ID des Spielers: ")
10756name := getFullName(name)
10757if (name == "") {
10758return
10759} else if (name == getUsername()) {
10760SendClientMessage(PREFIX . "Du kannst dir selbst keine Tickets ausstellen.")
10761return
10762}
10763if (lastSpeedUser = name && lastSpeed != 0) {
10764name := lastSpeedUser
10765autoSpeed := lastSpeed
10766} else {
10767autoSpeed := PlayerInput("Geschwindigkeit: ")
10768if (autoSpeed == "")
10769return
10770if (autoSpeed < 80) {
10771SendClientMessage("Die Geschwindigkeit muss 80 kmh überschreiten.")
10772return
10773}
10774}
10775reason := "geschwindigkeit"
10776result := URLDownloadToVar(baseURL . "api/catalog-check?username=" . username . "&password=" . password . "&type=points&id=" . reason . "&suspect=" . name)
10777try {
10778data := JSON.Load(result)
10779} catch {
10780SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
10781FormatTime, time, , dd.MM.yyyy HH:mm:ss
10782FileAppend, [%time%] Beim Laden der Wanted-Vergabe ist ein Fehler aufgetreten: %result%`n, log.txt
10783return false
10784}
10785if (data["error"] != "") {
10786SendClientMessage(PREFIX . data["error"])
10787} else {
10788autoName := name
10789autoReasonID := data["id"]
10790autoReason := data["reason"]
10791autoPoints := data["amount"]
10792autoTicket := autoPoints * 2000
10793if (!data["registered"]) {
10794SendClientMessage(PREFIX . SECCOL . name . " {FFFFFF}hat bereits " . SECCOL . autoPoints . " {FFFFFF}Punkte wegen " . SECCOL . autoReason . " {FFFFFF}von " . SECCOL . data["lastoffical"] . " {FFFFFF}um " . SECCOL . data["time"] . " Uhr {FFFFFF}bekommen!")
10795SendClientMessage(PREFIX . "Drücke " . SECCOL . "X {FFFFFF}um trotzdem fortzufahren!")
10796KeyWait, X, D, T10
10797if (ErrorLevel) {
10798return
10799}
10800}
10801kmh := maxKMH
10802if (kmh == 0) {
10803kmh := 80
10804SendClientMessage(PREFIX . "Du musst die maximal erlaubte Höchstgeschwindigkeit noch eintragen, verwende " . SECCOL . "/setkmh{FFFFFF}.")
10805}
10806SendChat("/l Guten " . getDayTime() . " " . autoName . ", Sie haben gegen die StVO verstoßen.")
10807if (!admin)
10808Sleep, 500
10809SendChat("/l Sie haben die erlaubte Höchstgeschwindigkeit (" . maxKMH . " km/h) mit " . autoSpeed . " km/h überschritten.")
10810if (!admin)
10811Sleep, 500
10812SendChat("/l Möchten Sie ein Ticket in Höhe von " . autoTicket . "$ oder " . autoPoints . " Strafpunkte?")
10813Sleep, 100
10814SendClientMessage(PREFIX . "Verwende " . SECCOL . "/aticket {FFFFFF}um ein Ticket oder " . SECCOL . "/apunkte{FFFFFF}, um die Punkte auszustellen.")
10815lastSpeed := 0
10816lastSpeedUser := ""
10817}
10818}
10819return
10820:?:/aticket::
10821{
10822if (autoName != "") {
10823if (autoSpeed == 0) {
10824giveTicket(autoName, autoTicket, autoReason)
10825} else {
10826giveTicket(autoName, autoTicket, autoReason . " [" . autoSpeed . " km/h]")
10827}
10828autoName := ""
10829autoSpeed := 0
10830} else {
10831SendClientMessage(PREFIX . "Du musst erst einen Verstoß mit " . SECCOL . "/stvo {FFFFFF}eintragen.")
10832}
10833}
10834return
10835:?:/apunkte::
10836{
10837if (autoName != "") {
10838if (autoSpeed == 0) {
10839givePoints(autoName, autoReasonID)
10840} else {
10841givePoints(autoName, autoReasonID, " [" . autoSpeed . " km/h]")
10842}
10843autoName := ""
10844autoSpeed := 0
10845} else {
10846SendClientMessage(PREFIX . "Du musst erst einen Verstoß mit " . SECCOL . "/stvo {FFFFFF}eintragen.")
10847}
10848}
10849return
10850:?:/top::
10851{
10852if (!tv) {
10853SendChat("/l Möchten Sie nun ein Ticket oder die Strafpunkte?")
10854}
10855}
10856return
10857:?:/tot::
10858{
10859if (!tv) {
10860SendChat("/l Möchten Sie nun ein Ticket oder einen Entzug der Lizenz?")
10861}
10862}
10863return
10864:?:/stvof::
10865{
10866if (!tv) {
10867name := PlayerInput("Flugschein: ")
10868name := getFullName(name)
10869if (name == "")
10870return
10871SendChat("/l Guten " . getDayTime() . " " . name . ", Sie haben mit Ihrem Flugobjekt gegen die StVO verstoßen.")
10872if (!admin)
10873Sleep, 500
10874SendChat("/l Entweder bezahlen Sie ein Ticket i.H.v. 12.000$ oder Ihre Lizenz wird beschlagnahmt, Ihre Entscheidung.")
10875Sleep, 100
10876SendClientMessage(PREFIX . "Tippe " . SECCOL . "/fst {FFFFFF}um ein Ticket anzubieten oder " . SECCOL . "/tfs {FFFFFF}um die Lizenz zu beschlagnahmen!")
10877}
10878}
10879return
10880:?:/stvow::
10881{
10882if (!tv) {
10883name := PlayerInput("Waffenschein: ")
10884name := getFullName(name)
10885if (name == "")
10886return
10887SendChat("/l Guten " . getDayTime() . " " . name . ", Sie haben gegen das Waffenführungsgesetz verstoßen.")
10888if (!admin)
10889Sleep, 500
10890SendChat("/l Entweder bezahlen Sie ein Ticket i.H.v. 36.000$ oder Ihre Lizenz wird beschlagnahmt, Ihre Entscheidung.")
10891Sleep, 100
10892SendClientMessage(PREFIX . "Tippe " . SECCOL . "/wst {FFFFFF}um ein Ticket anzubieten oder " . SECCOL . "/tws {FFFFFF}um die Lizenz zu beschlagnahmen!")
10893}
10894}
10895return
10896:?:/stvob::
10897{
10898if (!tv) {
10899name := PlayerInput("Waffenschein: ")
10900name := getFullName(name)
10901if (name == "")
10902return
10903SendChat("/l Guten " . getDayTime() . " " . name . ", Sie haben gegen die StVO verstoßen.")
10904if (!admin)
10905Sleep, 500
10906SendChat("/l Entweder bezahlen Sie ein Ticket i.H.v. 6.000$ oder Ihre Lizenz wird beschlagnahmt, Ihre Entscheidung.")
10907Sleep, 100
10908SendClientMessage(PREFIX . "Tippe " . SECCOL . "/bst {FFFFFF}um ein Ticket anzubieten oder " . SECCOL . "/tbs {FFFFFF}um die Lizenz zu beschlagnahmen!")
10909}
10910}
10911return
10912:?:/fst::
10913{
10914name := PlayerInput("Name/ID des Spielers: ")
10915name := getFullName(name)
10916if (name == "")
10917return
10918giveTicket(name, 12000, "Flugschein-Ticket")
10919}
10920return
10921:?:/wst::
10922{
10923name := PlayerInput("Name/ID des Spielers: ")
10924name := getFullName(name)
10925if (name == "")
10926return
10927giveTicket(name, 36000, "Waffenschein-Ticket")
10928}
10929return
10930:?:/bst::
10931{
10932name := PlayerInput("Name/ID des Spielers: ")
10933name := getFullName(name)
10934if (name == "")
10935return
10936giveTicket(name, 6000, "Bootsschein-Ticket")
10937}
10938return
10939:?:/tw::
10940{
10941SendInput, /take Waffen{space}
10942}
10943return
10944:?:/tfs::
10945:?:/tfl::
10946{
10947SendInput, /take Flugschein{space}
10948}
10949return
10950:?:/tws::
10951:?:/twl::
10952{
10953SendInput, /take Waffenschein{space}
10954}
10955return
10956:?:/tbs::
10957{
10958SendInput, /take Bootsschein{space}
10959}
10960return
10961:?:/td::
10962{
10963SendInput, /take Drogen{space}
10964}
10965return
10966:?:/tm::
10967{
10968SendInput, /take Materialien{space}
10969}
10970return
10971:?:/tall::
10972{
10973SendInput, /take Waffen{Space}
10974Input SID, V I M, {Enter}
10975SendInput, {Enter}t/take Materialien %SID%{Enter}t/take Drogen %SID%{Enter}
10976}
10977return
10978:?:/dsp::
10979{
10980SendChat("/destroyplant")
10981}
10982return
10983:?:/setkmh::
10984{
10985maxKMHinput := PlayerInput("Maximal erlaubte km/h: ")
10986if maxKMHinput is number
10987{
10988maxKMH := maxKMHinput
10989IniWrite, %maxKMH%, settings.ini, Einstellungen, MaxKMH
10990SendClientMessage(PREFIX . "Du hast die maximal erlaubte Geschwindigkeit bei Radarkontrollen auf " . SECCOL . maxKMH . " km/h {FFFFFF}gesetzt.")
10991} else {
10992SendClientMessage(PREFIX . "Gib bitte eine Zahl für die maximal erlaubte Geschwindigkeit bei Radarkontrollen ein.")
10993}
10994}
10995return
10996equipLabel:
10997{
10998if (IsInChat())
10999return
11000SendChat("/ausruesten")
11001}
11002return
11003healLabel:
11004{
11005if (IsInChat())
11006return
11007SendChat("/heal")
11008}
11009return
11010equipProfile1Label:
11011{
11012if (IsInChat())
11013return
11014equipment := ""
11015Loop, 6 {
11016if (profile1_%A_Index% != "") {
11017equipment .= " " . profile1_%A_Index%
11018}
11019}
11020SendChat("/ausruesten" . equipment)
11021Sleep, 200
11022chat := readChatLine(0) . readChatLine(1)
11023if (RegExMatch(chat, "Du hast dich ausgerüstet, es wurden (\d+) Materialien benötigt\. \(Verbleibend: (\d*) Materialien\)", chat_)) {
11024SendClientMessage(PREFIX . "Ausrüstungsprofil " . SECCOL . "1 {FFFFFF}genutzt, es wurden " . chat_1 . " Materialien verbraucht.")
11025}
11026SendChat("/heal")
11027}
11028return
11029equipProfile2Label:
11030{
11031if (IsInChat())
11032return
11033equipment := ""
11034Loop, 6 {
11035if (profile2_%A_Index% != "") {
11036equipment .= " " . profile2_%A_Index%
11037}
11038}
11039SendChat("/ausruesten" . equipment)
11040Sleep, 200
11041chat := readChatLine(0) . readChatLine(1)
11042if (RegExMatch(chat, "Du hast dich ausgerüstet, es wurden (\d+) Materialien benötigt\. \(Verbleibend: (\d*) Materialien\)", chat_)) {
11043SendClientMessage(PREFIX . "Ausrüstungsprofil " . SECCOL . "2 {FFFFFF}genutzt, es wurden " . chat_1 . " Materialien verbraucht.")
11044}
11045SendChat("/heal")
11046}
11047return
11048equipProfile3Label:
11049{
11050if (IsInChat())
11051return
11052equipment := ""
11053Loop, 6 {
11054if (profile3_%A_Index% != "") {
11055equipment .= " " . profile3_%A_Index%
11056}
11057}
11058SendChat("/ausruesten" . equipment)
11059Sleep, 200
11060chat := readChatLine(0) . readChatLine(1)
11061if (RegExMatch(chat, "Du hast dich ausgerüstet, es wurden (\d+) Materialien benötigt\. \(Verbleibend: (\d*) Materialien\)", chat_)) {
11062SendClientMessage(PREFIX . "Ausrüstungsprofil " . SECCOL . "3 {FFFFFF}(UC) genutzt, es wurden " . chat_1 . " Materialien verbraucht.")
11063}
11064if (armour) {
11065SendChat("/undercover " . ucSkin)
11066if (!admin)
11067Sleep, 500
11068SendChat("/heal")
11069} else {
11070SendChat("/heal")
11071if (!admin)
11072Sleep, 500
11073SendChat("/undercover " . ucSkin)
11074}
11075}
11076return
11077backupLabel:
11078{
11079if (IsInChat())
11080return
11081if (!bk) {
11082SendChat("/bk")
11083bk := true
11084} else {
11085SendChat("/d [HQ]: Ich benötige DRINGEND Verstärkung in " . getLocation() . "! HP: " . getPlayerHealth() . "/" . getPlayerArmor())
11086}
11087}
11088return
11089backupWhLabel:
11090{
11091if (IsInChat())
11092return
11093if (!bk) {
11094SendChat("/bk")
11095bk := true
11096}
11097SendChat("/d [HQ]: Ich benötige DRIGEND Verstärkung in " . getLocation() . ", verfolge Wheelman!")
11098}
11099return
11100noBackupLabel:
11101{
11102if (bk) {
11103bk := false
11104SendChat("/bk")
11105if (!admin)
11106Sleep, 750
11107SendChat("/d [HQ]: Verstärkung wird NICHT mehr benötigt!")
11108} else {
11109SendClientMessage(PREFIX . "Du hast keine Verstärkung angefordert!")
11110}
11111}
11112return
11113:?:/pd::
11114:?:/payday::
11115{
11116if (taxes == 1) {
11117SendClientMessage(PREFIX . "Es wurde noch kein Steuersatz eingetragen, gib bitte " . SECCOL . "/settax {FFFFFF}ein!")
11118}
11119SendClientMessage(PREFIX . "Geld am nächsten Payday: " . SECCOL . FormatNumber(paydayMoney) . "$ {FFFFFF}(Brutto) " . SECCOL . FormatNumber(Round(paydayMoney * taxes)) . "$ {FFFFFF}(Netto)")
11120blockDialog()
11121SendChat("/stats")
11122Sleep, 200
11123unBlockDialog()
11124if (RegExMatch(getDialogText(), statsFormat, dialog_)) {
11125paydayTime := dialog_7 - dialog_6
11126SendClientMessage(PREFIX . "Du hast in " . SECCOL . paydayTime . " Minute" . (paydayTime == 1 ? "" : "n") . " {FFFFFF}Payday.")
11127}
11128}
11129return
11130:?:/resetpd::
11131:?:/resetpayday::
11132{
11133SendClientMessage(PREFIX . "Geld am nächsten Payday: " . SECCOL . FormatNumber(paydayMoney) . "$ {FFFFFF}(Brutto) " . SECCOL . FormatNumber(Round(paydayMoney * taxes)) . "$ {FFFFFF}(Netto)")
11134paydayMoney := 0
11135SendClientMessage(PREFIX . "Du hast das Geld für den nächsten Payday auf 0$ zurückgesetzt!")
11136}
11137return
11138:?:/settax::
11139{
11140blockDialog()
11141SendChat("/stats")
11142Sleep, 200
11143unBlockDialog()
11144if (RegExMatch(getDialogText(), statsFormat, dialog_)) {
11145spouse := dialog_2
11146statsJob := dialog_10
11147if (spouse == "Niemand" && statsJob == "Arbeitslos") {
11148taxClass := 1
11149} else if (spouse == "Niemand" && statsJob != "Arbeitslos") {
11150taxClass := 2
11151} else if (spouse != "Niemand" && statsJob == "Arbeitslos") {
11152taxClass := 3
11153} else if (spouse != "Niemand" && statsJob != "Arbeitslos") {
11154taxClass := 4
11155} else {
11156SendClientMessage(PREFIX . "Deine Steuerklasse konnte nicht korrekt erkannt werden.")
11157return
11158}
11159SendChat("/tax")
11160Sleep, 250
11161chat := readChatLine(4 - taxClass)
11162if (RegExMatch(chat, "^Steuerklasse " . taxClass . ": (\d+) Prozent$", chat_)) {
11163taxes := (100 - chat_1) / 100
11164IniWrite, %taxes%, settings.ini, Steuern, Steuersatz
11165SendClientMessage(PREFIX . "Dein Steuersatz (Steuerklasse " . SECCOL . taxClass . "{FFFFFF}) wurde auf " . SECCOL . chat_1 . " {FFFFFF}Prozent gesetzt.")
11166} else {
11167SendClientMessage(PREFIX . "Deine Steuerklasse konnte nicht korrekt erkannt werden.")
11168}
11169} else {
11170SendClientMessage(PREFIX . "Deine Steuerklasse konnte nicht korrekt erkannt werden.")
11171}
11172}
11173return
11174:?:/partner::
11175{
11176partnerID := PlayerInput("Partner-Nr.: ")
11177if partnerID is number
11178{
11179if (partnerID >= 1) {
11180if (partners.HasKey(partnerID)) {
11181partnerName := partners.Delete(partnerID)
11182SendClientMessage(PREFIX . "Der Dienstpartner " . SECCOL . partnerName . " {FFFFFF}wurde entfernt! " . SECCOL . "#" . partnerID)
11183if (partnerMessages)
11184SendChat("/d [HQ]: Der Streifendienst mit " . partnerName . " wurde beendet.")
11185} else {
11186partnerName := PlayerInput("Partner-ID/Name: ")
11187partnerName := getFullName(partnerName)
11188if (partnerName == "") {
11189SendClientMessage(PREFIX . "Dieser Spieler ist nicht online!")
11190return
11191}
11192partners[partnerID] := partnerName
11193SendClientMessage(PREFIX . SECCOL . partnerName . " {FFFFFF}wurde als Dienstpartner eingetragen! " . SECCOL . "#" . partnerID)
11194if (partnerMessages) {
11195SendChat("/d [HQ]: Der Streifendienst mit " . partnerName . " wurde begonnen.")
11196Sleep, 200
11197}
11198if (taxes == 1) {
11199SendClientMessage(PREFIX . "Es wurde noch kein Steuersatz eingetragen, gib bitte " . SECCOL . "/settax {FFFFFF}ein!")
11200}
11201}
11202}
11203}
11204}
11205return
11206:?:/partners::
11207{
11208partnerCount := 0
11209for index, partner in partners {
11210partnerPlayerID := getPlayerIdByName(partner, true)
11211SendClientMessage(PREFIX . index . ". Streifenpartner: " . SECCOL . partner . " {FFFFFF}[ID: " . SECCOL . partnerPlayerID . "{FFFFFF}]")
11212partnerCount++
11213}
11214SendClientMessage(PREFIX . "Streifenpartner eingetragen: " . SECCOL . partnerCount)
11215}
11216return
11217:?:/rpartners::
11218:?:/delpartners::
11219:?:/rempartners::
11220:?:/resetpartners::
11221{
11222partners := []
11223SendClientMessage(PREFIX . "Du hast deine Streifenpartner zurückgesetzt.")
11224}
11225return
11226autoImprisonLabel:
11227{
11228if (IsInChat())
11229return
11230toRemove := []
11231for index, arrestName in arrestList {
11232toRemove.Push(index)
11233suspectID := getPlayerIdByName(arrestName, true)
11234if (suspectID != -1) {
11235SendChat("/arrest " . arrestName)
11236if (!admin)
11237Sleep, 900
11238}
11239}
11240for i, id in toRemove {
11241arrestList.RemoveAt(id)
11242}
11243}
11244return
11245imprisonLabel:
11246{
11247if (IsInChat())
11248return
11249name := PlayerInput("Einsperren: ")
11250name := getFullName(name)
11251if (name != "") {
11252SendChat("/arrest " . name)
11253toRemove := []
11254for index, arrestName in arrestList {
11255if (arrestName = name) {
11256toRemove.Push(index)
11257}
11258}
11259for i, id in toRemove {
11260arrestList.RemoveAt(id)
11261}
11262}
11263}
11264return
11265:?:/oa::
11266:?:/offlinearrest::
11267{
11268if (!updateTextLabelData()) {
11269SendInput, /offlinearrest 0{left 2}
11270return
11271}
11272found := false
11273for i, o in oTextLabelData {
11274if (o.PLAYERID == 65535 && o.VEHICLEID == 65535) {
11275if (RegExMatch(o.TEXT, "(\S+)\n\((\S+)\)\n(\d+):(\d+):(\d+)", label_)) {
11276SendChat("/offlinearrest " . label_1 . " 0")
11277found := true
11278}
11279}
11280}
11281if (!found) {
11282SendClientMessage(PREFIX . "Es konnten keine Offline-Pickups gefunden werden!")
11283}
11284}
11285return
11286:?:/op::
11287:?:/offlineprison::
11288{
11289if (!updateTextLabelData()) {
11290SendInput, /offlinearrest 1{left 2}
11291return
11292}
11293found := false
11294for i, o in oTextLabelData {
11295if (o.PLAYERID == 65535 && o.VEHICLEID == 65535) {
11296if (RegExMatch(o.TEXT, "(\S+)\n\((\S+)\)\n(\d+):(\d+):(\d+)", label_)) {
11297SendChat("/offlinearrest " . label_1 . " 1")
11298found := true
11299}
11300}
11301}
11302if (!found) {
11303SendClientMessage(PREFIX . "Es konnten keine Offline-Pickups gefunden werden!")
11304}
11305}
11306return
11307:?:/da::
11308:?:/deatharrest::
11309{
11310if (!updateTextLabelData()) {
11311SendInput, /deatharrest 0{left 2}
11312return
11313}
11314found := false
11315for i, o in oTextLabelData {
11316if (o.PLAYERID == 65535 && o.VEHICLEID == 65535) {
11317if (RegExMatch(o.TEXT, "(\S+)\n\((\S+)\)\n(\d+):(\d+):(\d+)", label_)) {
11318SendChat("/deatharrest " . label_1 . " 0")
11319found := true
11320}
11321}
11322}
11323if (!found) {
11324SendClientMessage(PREFIX . "Es konnten keine Death-Pickups gefunden werden!")
11325} else {
11326deathArrested := true
11327SetTimer, DeathArrestTimer, -2000
11328}
11329}
11330return
11331:?:/dp::
11332:?:/deathprison::
11333{
11334if (!updateTextLabelData()) {
11335SendInput, /deatharrest 1{left 2}
11336return
11337}
11338found := false
11339for i, o in oTextLabelData {
11340if (o.PLAYERID == 65535 && o.VEHICLEID == 65535) {
11341if (RegExMatch(o.TEXT, "(\S+)\n\((\S+)\)\n(\d+):(\d+):(\d+)", label_)) {
11342SendChat("/deatharrest " . label_1 . " 1")
11343found := true
11344}
11345}
11346}
11347if (!found) {
11348SendClientMessage(PREFIX . "Es konnten keine Death-Pickups gefunden werden!")
11349} else {
11350deathArrested := true
11351SetTimer, DeathArrestTimer, -2000
11352}
11353}
11354return
11355DeathArrestTimer:
11356{
11357deathArrested := false
11358}
11359return
11360arrestLabel:
11361{
11362if (IsInChat())
11363return
11364name := PlayerInput("Verhaften: ")
11365name := getFullName(name)
11366if (name != "") {
11367SendChat("/waffen " . name)
11368if (!admin)
11369Sleep, 500
11370SendChat("/cuff " . name)
11371if (!admin)
11372Sleep, 850
11373checkResult := check(name)
11374if (checkResult != -1 && autoWanteds) {
11375if (checkResult[1] || checkResult[2]) {
11376if (!admin)
11377Sleep, 500
11378giveWanteds(name, 37)
11379}
11380if (checkResult[3] || checkResult[4]) {
11381if (!admin)
11382Sleep, 500
11383giveWanteds(name, 38)
11384}
11385}
11386arrestList.Push(name)
11387}
11388}
11389return
11390uncuffLabel:
11391{
11392if (IsInChat())
11393return
11394name := PlayerInput("Uncuff-ID: ")
11395name := getFullName(name)
11396if (name != "") {
11397SendChat("/uncuff " . name)
11398toRemove := []
11399for index, arrestName in arrestList {
11400if (arrestName = name) {
11401toRemove.Push(index)
11402}
11403}
11404for i, id in toRemove {
11405arrestList.RemoveAt(id)
11406}
11407}
11408}
11409return
11410arrestSlotsLabel:
11411{
11412if (IsInChat())
11413return
11414SendClientMessage(PREFIX . "Verbrecher in der Arrestliste:")
11415for index, arrestName in arrestList {
11416SendClientMessage(PREFIX . SECCOL . index . ": {FFFFFF}" . arrestName)
11417}
11418}
11419return
11420resetArrestSlotsLabel:
11421{
11422if (IsInChat())
11423return
11424arrestList := []
11425SendClientMessage(PREFIX . "Arrestslots zurückgesetzt.")
11426}
11427return
11428checkLabel:
11429{
11430if (IsInChat())
11431return
11432name := PlayerInput("Kontrolle: ")
11433if (name != "") {
11434checkResult := check(name)
11435if (checkResult == -1)
11436return
11437if (!admin)
11438Sleep, 1000
11439SendChat("/waffen " . name)
11440if (!admin)
11441Sleep, 1000
11442SendChat("/alktest " . name)
11443Sleep, 500
11444controls := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=controls&value=" . chat_1)
11445IniWrite, %controls%, stats.ini, Kontrollen, Kontrollen
11446SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(controls) . " {FFFFFF}Kontrollen durchgeführt.")
11447if (autoWanteds) {
11448if (checkResult[1] || checkResult[2]) {
11449if (!admin)
11450Sleep, 500
11451giveWanteds(name, 37)
11452}
11453if (checkResult[3] || checkResult[4]) {
11454if (!admin)
11455Sleep, 500
11456giveWanteds(name, 38)
11457}
11458}
11459}
11460}
11461return
11462:?:/fahrt::
11463{
11464if (!tv) {
11465SendChat("/l Die allgemeine Kontrolle ist nun beendet. Ich danke für Ihre Kooperation!")
11466SendChat("/l Ich wünsche Ihnen nun eine schöne und angenehme Weiterfahrt! Auf Wiedersehen!")
11467}
11468}
11469return
11470askCheckLabel:
11471{
11472if (!tv) {
11473if (IsInChat())
11474return
11475SendClientMessage(PREFIX . "Personenkontrolle: " . SECCOL . "1 {FFFFFF}- Verkehrskontrolle (Personen + Kofferraumkontrolle): " . SECCOL . "2")
11476auswahl := PlayerInput("Auswahl: ")
11477if (auswahl == "1") {
11478kontrolle := "Personenkontrolle"
11479} else if (auswahl == "2") {
11480kontrolle := "Verkehrskontrolle"
11481} else {
11482return
11483}
11484FormatTime, time,, HH
11485if (time >= 0 && time < 12 ) {
11486SendChat("/l Guten Morgen, dies ist eine allgemeine " . kontrolle . ".")
11487} else if (time >= 12 && time < 18) {
11488SendChat("/l Guten Tag, dies ist eine allgemeine " . kontrolle . ".")
11489} else if (time >= 18 && time < 24) {
11490SendChat("/l Guten Abend, dies ist eine allgemeine " . kontrolle . ".")
11491}
11492if (!admin)
11493Sleep, 500
11494if (auswahl == "1") {
11495SendChat("/l Dürfte ich Sie auf illegale Gegenstände und Waffen kontrollieren?")
11496} else if (auswahl == "2") {
11497SendChat("/l Dürfte ich Sie, sowie Ihren Kofferraum auf illegale Gegenstände und Waffen kontrollieren?")
11498}
11499if (!admin)
11500Sleep, 500
11501SendChat("/l Falls Sie verweigern sollten, erhalten Sie Wantedstufen in Höhe von einem Wanted.")
11502if (!admin)
11503Sleep, 500
11504SendChat("/l Bitte antworten Sie mir mit 'Ja' oder 'Nein'.")
11505}
11506}
11507return
11508askPapersLabel:
11509{
11510if (!tv) {
11511if (IsInChat())
11512return
11513id := getId()
11514SendChat("/l Bitte zeigen Sie mir Ihre Papiere mit '/scheine " . id . "'.")
11515}
11516}
11517return
11518cooperationLabel:
11519{
11520if (!tv) {
11521if (IsInChat())
11522return
11523SendChat("/l Vielen Dank für Ihre Kooperation.")
11524}
11525}
11526return
11527getOutOfCarLabel:
11528{
11529if (!tv) {
11530if (IsInChat())
11531return
11532SendChat("/l Steigen Sie bitte aus Ihrem Fahrzeug.")
11533}
11534}
11535return
11536stayInCarLabel:
11537{
11538if (!tv) {
11539if (IsInChat())
11540return
11541SendChat("/l Bleiben Sie bitte in Ihrem Fahrzeug.")
11542}
11543}
11544return
11545:?:/tp::
11546if (admin) {
11547SendChat("/tp")
11548return
11549}
11550:?:/tput::
11551{
11552SendInput, /trunk put{Space}
11553}
11554return
11555:?:/tdm::
11556:?:/tcm::
11557{
11558SendChat("/trunk clear mats")
11559}
11560return
11561:?:/tdd::
11562:?:/tcd::
11563{
11564SendChat("/trunk clear drugs")
11565}
11566return
11567openTrunkLabel:
11568if (IsInChat())
11569return
11570:?:/to::
11571{
11572if (!tv) {
11573SendChat("/trunk open")
11574}
11575}
11576return
11577checkTrunkLabel:
11578if (IsInChat())
11579return
11580:?:/tc::
11581{
11582if (!tv) {
11583blockDialog()
11584SendChat("/trunk check")
11585Sleep, 200
11586unblockDialog()
11587chat0 := readChatLine(0)
11588chat1 := readChatLine(1)
11589if (InStr(chat0 . chat1, "Fehler:")) {
11590if (InStr(chat0 . chat1, "Der Kofferraum ist nicht offen")) {
11591SendChat("/trunk open")
11592blockDialog()
11593SendChat("/trunk check")
11594Sleep, 200
11595unblockDialog()
11596chat0 := readChatLine(0)
11597chat1 := readChatLine(1)
11598if (InStr(chat0 . chat1, "Fehler:")) {
11599return
11600}
11601} else {
11602return
11603}
11604}
11605if (RegExMatch(getDialogCaption(), "Kofferraum von Fahrzeug (\S+) \((.*)\)", result_)) {
11606if (RegExMatch(getDialogText(), "Drogen: (\d+)\nMaterialien: (\d+)\nDeagle: (\d+)\nShotgun: (\d+)\nMP5: (\d+)\nAK47: (\d+)\nM4: (\d+)\nRifle: (\d+)\nSniper: (\d+)", dialog_)) {
11607foundSomething := false
11608SendClientMessage(PREFIX . "Gegenstände aus dem Fahrzeug " . SECCOL . result_1 . " {FFFFFF}(" . SECCOL . result_2 . "{FFFFFF}):")
11609if (dialog_1 > 0) {
11610SendClientMessage(PREFIX . "Du hast {CC0000}" . dialog_1 . "g Drogen {FFFFFF}gefunden.")
11611foundSomething := true
11612}
11613if (dialog_2 > 0) {
11614SendClientMessage(PREFIX . "Du hast {CC0000}" . dialog_2 . " Materialien {FFFFFF}gefunden.")
11615foundSomething := true
11616}
11617if (dialog_3 > 0) {
11618SendClientMessage(PREFIX . "Du hast " . SECCOL . dialog_3 . " Schuss Deagle {FFFFFF}gefunden.")
11619foundSomething := true
11620}
11621if (dialog_4 > 0) {
11622SendClientMessage(PREFIX . "Du hast " . SECCOL . dialog_4 . " Schuss Shotgun {FFFFFF}gefunden.")
11623foundSomething := true
11624}
11625if (dialog_5 > 0) {
11626SendClientMessage(PREFIX . "Du hast " . SECCOL . dialog_5 . " Schuss MP5 {FFFFFF}gefunden.")
11627foundSomething := true
11628}
11629if (dialog_6 > 0) {
11630SendClientMessage(PREFIX . "Du hast " . SECCOL . dialog_6 . " Schuss AK-47 {FFFFFF}gefunden.")
11631foundSomething := true
11632}
11633if (dialog_7 > 0) {
11634SendClientMessage(PREFIX . "Du hast " . SECCOL . dialog_7 . " Schuss M4 {FFFFFF}gefunden.")
11635foundSomething := true
11636}
11637if (dialog_8 > 0) {
11638SendClientMessage(PREFIX . "Du hast " . SECCOL . dialog_8 . " Schuss Rifle {FFFFFF}gefunden.")
11639foundSomething := true
11640}
11641if (dialog_9 > 0) {
11642SendClientMessage(PREFIX . "Du hast " . SECCOL . dialog_9 . " Schuss Sniper {FFFFFF}gefunden.")
11643foundSomething := true
11644}
11645if (!foundSomething) {
11646SendClientMessage(PREFIX . "Du hast nichts gefunden.")
11647} else if (dialog_1 > 0 || dialog_2 > 0) {
11648SendChat("/trunk check")
11649}
11650trunkControls := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=trunkcontrols")
11651IniWrite, %trunkControls%, stats.ini, Kontrollen, Kofferraum
11652SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(trunkControls) . " {FFFFFF}Kofferäume durchsucht.")
11653return
11654}
11655}
11656SendClientMessage(PREFIX . "Der Kofferraum konnte nicht durchsucht werden!")
11657}
11658}
11659return
11660askTrunkOpenLabel:
11661{
11662if (!tv) {
11663if (IsInChat())
11664return
11665SendChat("/l Bitte halten Sie Abstand, ich werde Ihren Kofferraum nun durchsuchen!")
11666}
11667}
11668return
11669arrestedCarLabel:
11670{
11671if (!tv) {
11672if (IsInChat())
11673return
11674if (getPlayerInteriorId() != 0) {
11675SendChat("/l Sie sind vorläufig festgenommen, verlassen Sie das Gebäude und steigen Sie in das Dienstfahrzeug.")
11676} else {
11677SendChat("/l Sie sind vorläufig festgenommen, steigen Sie in das Dienstfahrzeug.")
11678Sleep, 3000
11679if (isPlayerInAnyVehicle()) {
11680SendClientMessage(PREFIX . "Du darfst nun das Fahrzeug beschießen, sofern der Spieler flüchtet.")
11681} else {
11682SendClientMessage(PREFIX . "Du darfst den Verbrecher nun Tazern " . SECCOL . "(Ausnahme: Kampfsituation)")
11683}
11684}
11685}
11686}
11687return
11688arrestedFootLabel:
11689{
11690if (!tv) {
11691if (IsInChat())
11692return
11693SendChat("/l Sie sind vorläufig festgenommen, bitte laufen Sie zu den Zellen des Police Departments.")
11694Sleep, 3000
11695if (isPlayerInAnyVehicle()) {
11696SendClientMessage(PREFIX . "Du darfst nun das Fahrzeug beschießen, sofern der Spieler flüchtet.")
11697} else {
11698SendClientMessage(PREFIX . "Du darfst den Verbrecher nun Tazern " . SECCOL . "(Ausnahme: Kampfsituation)")
11699}
11700}
11701}
11702return
11703:?:/twd::
11704{
11705wtdTicketResult := URLDownloadToVar(baseURL . "api/getsetting?key=wantedtickets")
11706if (wtdTicketResult) {
11707playerForTicket := PlayerInput("Spieler: ")
11708playerForTicket := getFullName(playerForTicket)
11709if (playerForTicket != "") {
11710if (playerForTicket == getUsername()) {
11711SendClientMessage(PREFIX . "Du kannst dir selbst kein Ticket anbieten.")
11712} else {
11713isOnTicketBlacklist := UrlDownloadToVar(baseURL . "api/isonticketblacklist?player=" . playerForTicket)
11714if (isOnTicketBlacklist) {
11715SendChat("/l Guten Tag " . playerForTicket . ",")
11716SendChat("/l Sie sind auf der Ticket-Blacklist und können sich deshalb leider nicht freikaufen.")
11717return
11718}
11719wantedCount := PlayerInput("Wanteds: ")
11720if (wantedCount is not number) {
11721SendClientMessage(PREFIX . "Du kannst nun Zahlen eingeben.")
11722} else if (wantedCount < 1 || wantedCount > 2) {
11723SendClientMessage(PREFIX . "Du kannst nur 1-2 Wanteds entfernen.")
11724} else {
11725SendChat("/l Guten Tag " . playerForTicket . ",")
11726if (!admin)
11727Sleep, 500
11728SendChat("/l Hiermit biete ich Ihnen einen Freikauf für Ihr" . (wantedCount == 1 ? " Wanted" : "e zwei Wanteds") . " an.")
11729if (!admin)
11730Sleep, 500
11731SendChat("/l Sollten Sie dieses Ticket (" . FormatNumber(wantedCount * 750) . "$) nicht zahlen können,")
11732SendChat("/l werden wir Sie leider verhaften müssen.")
11733if (!admin)
11734Sleep, 700
11735SendChat("/ticket " . playerForTicket . " " . (wantedCount * 750) " Wanted-Ticket (" . wantedCount . " Wanted" . (wantedCount == 1 ? "" : "s") . ")")
11736}
11737}
11738}
11739} else {
11740SendChat("/l Tut mir leid, es gibt leider keine Tickets zum Freikauf von Wanteds mehr!")
11741}
11742}
11743return
11744ramLabel:
11745{
11746if (!tv) {
11747if (IsInChat())
11748return
11749SendChat("/ram")
11750}
11751}
11752return
11753grabLabel:
11754{
11755if (!tv) {
11756if (IsInChat())
11757return
11758SendClientMessage(PREFIX . SECCOL . "1{FFFFFF}: Beifahrer | " . SECCOL . "2{FFFFFF}: hinten links | " . SECCOL . "3{FFFFFF}: hinten rechts")
11759SendInput, t/grab{space}
11760}
11761}
11762return
11763ungrabLabel:
11764{
11765if (!tv) {
11766if (IsInChat())
11767return
11768SendInput, t/ungrab{space}
11769}
11770}
11771return
11772:?:/ci::
11773{
11774if (IsInChat()) {
11775SendInput, /dl{enter}
11776} else {
11777SendInput, t/dl{enter}
11778}
11779carID := PlayerInput("Fahrzeug-ID: ")
11780if (carID != "") {
11781SendClientMessage(PREFIX . "Fahrzeuginformationen werden gespeichert, bitte warte einen Moment...")
11782Sleep, 250
11783SendChat("/carinfo " . carID)
11784Sleep, 250
11785readCarInfos()
11786Sleep, 500
11787SendInput, {F8}
11788Sleep, 2000
11789SendInput, {Escape}
11790SendClientMessage(PREFIX . "Fahrzeuginformationen wurden gespeichert!")
11791}
11792SendInput, t/dl{enter}
11793}
11794return
11795motorSystemLabel:
11796{
11797if (IsInChat())
11798return
11799if (IsPlayerInAnyVehicle()) {
11800if (IsPlayerDriver()) {
11801if (getVehicleEngineState()) {
11802SendChat("/motor")
11803} else {
11804if (lockSystem) {
11805if (!getVehicleLockState()) {
11806SendChat("/lock")
11807}
11808}
11809SendChat("/motor")
11810Sleep, 200
11811SendChat("/licht")
11812}
11813} else {
11814SendClientMessage(PREFIX . "Du bist nicht der Fahrer eines Fahrzeuges.")
11815}
11816} else {
11817SendClientMessage(PREFIX . "Du bist in keinem Fahrzeug.")
11818}
11819}
11820return
11821~F::
11822{
11823if (IsInChat())
11824return
11825if (IsPlayerInAnyVehicle()) {
11826if (motorSystem) {
11827if (IsPlayerDriver() && getVehicleEngineState()) {
11828SendChat("/motor")
11829Sleep, 500
11830}
11831}
11832} else {
11833if (lockSystem) {
11834Loop {
11835if (IsPlayerDriver() && !getVehicleLockState()) {
11836Sleep, 200
11837if (!getVehicleLockState())
11838SendChat("/lock")
11839break
11840}
11841}
11842}
11843}
11844}
11845return
11846lockLabel:
11847{
11848if (IsInChat())
11849return
11850if (IsPlayerInAnyVehicle()) {
11851if (IsPlayerDriver()) {
11852SendChat("/lock")
11853} else {
11854SendClientMessage(PREFIX . "Du bist nicht der Fahrer eines Fahrzeuges.")
11855}
11856} else {
11857SendClientMessage(PREFIX . "Du bist in keinem Fahrzeug.")
11858}
11859}
11860return
11861lightLabel:
11862{
11863if (IsInChat())
11864return
11865if (IsPlayerInAnyVehicle()) {
11866if (IsPlayerDriver()) {
11867SendChat("/licht")
11868} else {
11869SendClientMessage(PREFIX . "Du bist nicht der Fahrer eines Fahrzeuges.")
11870}
11871} else {
11872SendClientMessage(PREFIX . "Du bist in keinem Fahrzeug.")
11873}
11874}
11875return
11876uclightLabel:
11877{
11878if (IsInChat())
11879return
11880if (IsPlayerInAnyVehicle()) {
11881SendChat("/uclight")
11882} else {
11883SendClientMessage(PREFIX . "Du bist in keinem Fahrzeug.")
11884}
11885}
11886return
11887ucaLabel:
11888{
11889if (IsInChat())
11890return
11891if (IsPlayerInAnyVehicle()) {
11892SendChat("/uca")
11893} else {
11894SendClientMessage(PREFIX . "Du bist in keinem Fahrzeug.")
11895}
11896}
11897return
11898stopAutomaticSystemsLabel:
11899{
11900if (IsInChat())
11901return
11902stoppedAnything := false
11903if (countdownRunning) {
11904SetTimer, CountdownTimer, Off
11905stoppedAnything := true
11906countdownRunning := false
11907SendChat("/" . cdChat . " Der Countdown wurde abgebrochen!")
11908}
11909if (autoFindRunning) {
11910SetTimer, AutoFindTimer, Off
11911stoppedAnything := true
11912autoFindRunning := false
11913SendClientMessage(PREFIX . "Das automatische Suchen wurde deaktiviert.")
11914}
11915if (autoShowRunning) {
11916SetTimer, AutoShowPosTimer, Off
11917stoppedAnything := true
11918autoShowRunning := false
11919SendChat("/l Das automatische Zeigen wurde deaktiviert.")
11920}
11921if (!stoppedAnything) {
11922SendClientMessage(PREFIX . "Es wurde kein laufender Timer gefunden, der gestoppt werden konnte.")
11923}
11924}
11925return
11926:?:/af::
11927:?:/afind::
11928{
11929playerToFindInput := PlayerInput("Spieler: ")
11930if (playerToFindInput == "")
11931return
11932playerToFind := playerToFindInput
11933autoFindRunning := true
11934if (autoShowRunning) {
11935SetTimer, AutoShowPosTimer, Off
11936autoShowRunning := false
11937}
11938GoSub, AutoFindTimer
11939SetTimer, AutoFindTimer, 5500
11940SendClientMessage(PREFIX . "Das automatische Suchen wird mit der Taste " . SECCOL . stopAutomaticSystemsNoMods . " {FFFFFF}beendet.")
11941}
11942return
11943AutoFindTimer:
11944{
11945IfWinNotActive, GTA:SA:MP
11946return
11947SendChat("/find " . playerToFind)
11948Sleep, 200
11949adrGTA2 := getModuleBaseAddress("gta_sa.exe", hGTA)
11950cText := readString(hGTA, adrGTA2 + 0x7AAD43, 512)
11951if (InStr(cText, "Handy aus"))
11952return
11953if (getDistanceBetween(CoordsFromRedmarker()[1], CoordsFromRedmarker()[2], CoordsFromRedmarker()[3], 1163.2358, -1323.2552, 15.3945, 5)) {
11954SendClientMessage(PREFIX . "Der Spieler befindet sich im Krankenhaus!")
11955}
11956}
11957return
11958:?:/as::
11959:?:/asp::
11960{
11961playerToShowTo := PlayerInput("Spieler, dem gezeigt werden soll: ")
11962if (playerToShowTo == "")
11963return
11964playerToFindInput := PlayerInput("Gesuchter Spieler: ")
11965if (playerToFindInput == "")
11966return
11967playerToFind := playerToFindInput
11968autoShowRunning := true
11969if (autoFindRunning) {
11970SetTimer, AutoFindTimer, Off
11971autoFindRunning := false
11972}
11973GoSub, AutoShowPosTimer
11974SetTimer, AutoShowPosTimer, 5500
11975SendClientMessage(PREFIX . "Das automatische Zeigen wird mit der Taste " . SECCOL . stopAutomaticSystemsNoMods . " {FFFFFF}beendet.")
11976}
11977return
11978AutoShowPosTimer:
11979{
11980IfWinNotActive, GTA:SA:MP
11981return
11982SendChat("/showpos " . playerToShowTo . " " . playerToFind)
11983Sleep, 200
11984adrGTA2 := getModuleBaseAddress("gta_sa.exe", hGTA)
11985cText := readString(hGTA, adrGTA2 + 0x7AAD43, 512)
11986if (InStr(cText, "Handy aus"))
11987return
11988if (getDistanceBetween(CoordsFromRedmarker()[1], CoordsFromRedmarker()[2], CoordsFromRedmarker()[3], 1163.2358, -1323.2552, 15.3945, 5)) {
11989SendChat("/l Der Spieler befindet sich im Krankenhaus!")
11990}
11991}
11992return
11993positionLabel:
11994{
11995sendPosition("d")
11996}
11997return
11998fPositionLabel:
11999{
12000sendPosition("f")
12001}
12002return
12003rPositionLabel:
12004{
12005sendPosition("r")
12006}
12007return
12008acceptJobLabel:
12009{
12010if (IsInChat())
12011return
12012if (isPlayerInAnyVehicle()) {
12013if (isPlayerDriver()) {
12014SendChat("/d [HQ]: Wagen " . getVehicleID() . " übernimmt den Auftrag.")
12015} else {
12016SendChat("/d [HQ]: Wagen " . getVehicleModelId() . " übernimmt den Auftrag.")
12017}
12018} else {
12019SendChat("/d [HQ]: Beamter " . getUsername() . " übernimmt den Auftrag.")
12020}
12021}
12022return
12023doneJobLabel:
12024{
12025if (IsInChat())
12026return
12027if (isPlayerInAnyVehicle()) {
12028if (isPlayerDriver()) {
12029SendChat("/d [HQ]: Wagen " . getVehicleID() . " hat den Auftrag ausgeführt.")
12030} else {
12031SendChat("/d [HQ]: Wagen " . getVehicleModelId() . " hat den Auftrag ausgeführt.")
12032}
12033} else {
12034SendChat("/d [HQ]: Beamter " . getUsername() . " hat den Auftrag ausgeführt.")
12035}
12036}
12037return
12038:?:/wo::
12039{
12040SendChat("/d [HQ]: Wo befindet ihr euch und was ist das Problem?")
12041}
12042return
12043:?:/ver::
12044{
12045SendChat("/d [HQ]: Verstanden und bestätigt!")
12046}
12047return
12048:?:/fver::
12049{
12050SendChat("/f [HQ]: Verstanden und bestätigt!")
12051}
12052return
12053:?:/rver::
12054{
12055SendChat("/r [HQ]: Verstanden und bestätigt!")
12056}
12057return
12058:?:/nbk::
12059:?:/needbk::
12060{
12061SendChat("/d [HQ]: Wird Verstärkung weiterhin benötigt?")
12062}
12063return
12064:?:/einsatz::
12065{
12066time := PlayerInput("Uhrzeit (HH.MM): ")
12067if (time == "")
12068return
12069location := PlayerInput("Aufstellort: ")
12070if (location == "")
12071return
12072SendClientMessage(PREFIX . SECCOL . "1 {FFFFFF}- Normal, " . SECCOL . "2 {FFFFFF}- Undercover, " . SECCOL . "3 {FFFFFF}- SWAT")
12073duty := PlayerInput("Dienst: ")
12074if (duty == "1") {
12075duty := "Normal"
12076} else if (duty == "2") {
12077duty := "Undercover"
12078} else if (duty == "3") {
12079duty := "S.W.A.T"
12080} else {
12081return
12082}
12083SendChat("/f [HQ]: +++ EINSATZ +++")
12084SendChat("/f [HQ]: Bitte ALLE bis " . time . " Uhr aufstellen.")
12085SendChat("/f [HQ]: Aufstellort: " . location . ", Ausrüstung: " . duty)
12086}
12087return
12088:?:/mt::
12089:?:/mats::
12090{
12091SendChat("/f [HQ]: Es findet ein Matstransport statt! ALLE EINHEITEN SOFORT ANRÜCKEN!")
12092SendChat("/f [HQ]: Derzeitige Position: " . getLocation())
12093}
12094return
12095:?:/mrob::
12096{
12097SendChat("/d [HQ]: Es findet aktuell ein Überfall auf einen Matstransport statt!")
12098SendChat("/d [HQ]: ALLE EINHEITEN SOFORT ANRÜCKEN! Aktuelle Position: " . getLocation())
12099if (!bk) {
12100bk := true
12101SendChat("/bk")
12102}
12103}
12104return
12105:?:/go::
12106{
12107SendChat("/d [HQ]: Einsatzleiter erlaubt Zugriff, GOGOGO!")
12108}
12109return
12110:?:/fgo::
12111{
12112SendChat("/f [HQ]: Einsatzleiter erlaubt Zugriff, GOGOGO!")
12113}
12114return
12115:?:/rgo::
12116{
12117SendChat("/r [HQ]: Einsatzleiter erlaubt Zugriff, GOGOGO!")
12118}
12119return
12120:?:/abholung::
12121{
12122abholungChat := PlayerInput("Chat: ")
12123if (abholungChat != "") {
12124SendChat("/" . abholungChat . " [HQ]: Erbitte Abholung in " . getLocation() . "!")
12125}
12126}
12127return
12128:?:/kabholung::
12129{
12130if (abholungChat != "") {
12131SendChat("/" . abholungChat . " [HQ]: Eine Abholung wird nicht mehr benötigt.")
12132abholungChat := ""
12133} else {
12134SendClientMessage(PREFIX . "Du hast keine Abholung angefordert!")
12135}
12136}
12137return
12138:?:/stw::
12139{
12140SendChat("/d [HQ]: Ich benötige einen Streifenwagen in " . getLocation() . "!")
12141}
12142return
12143:?:/vf::
12144:?:/verf::
12145:?:/verfolgung::
12146{
12147name := PlayerInput("Verbrecher: ")
12148name := getFullName(name)
12149if (name == "")
12150return
12151id := getPlayerIdByName(name, true)
12152SendChat("/d [HQ]: Erbitte Unterstützung bei der Verfolgung von " . name . " (ID: " . id . ")!")
12153}
12154return
12155:?:/ort::
12156{
12157position := PlayerInput("Letzter bekannter Aufenthaltsort: ")
12158if (position == "")
12159return
12160SendChat("/d [HQ]: Letzter bekannter Aufenthaltsort: " . position)
12161}
12162return
12163:?:/luft::
12164{
12165SendChat("/d [HQ]: Fordere Luftüberwachung im Sektor " . getLocation() . " an!")
12166}
12167return
12168:?:/off::
12169{
12170SendChat("/d [HQ]: " . getUsername() . " meldet sich vom Dienst ab!")
12171}
12172return
12173:?:/on::
12174{
12175SendChat("/d [HQ]: " . getUsername() . " meldet sich zum Dienst!")
12176}
12177return
12178:?:/swat::
12179{
12180if (A_IsSuspended) {
12181SendChat("/swat")
12182} else {
12183if (IsPlayerInRangeOfPoint(225.6339, 121.3084, 999.0673, 2.2)
12184|| IsPlayerInRangeOfPoint(255.3859, 77.3740, 1003.6406, 2.2)
12185|| IsPlayerInRangeOfPoint(197.76, 168.06, 1003.62, 2.2)) {
12186SendChat("/swat")
12187Sleep, 200
12188if (getPlayerSkinID() == 285) {
12189airmode := false
12190watermode := false
12191SendClientMessage(PREFIX . "S.W.A.T. Modus {33CC00}aktiviert.")
12192} else {
12193SendClientMessage(PREFIX . "S.W.A.T. Modus {FF0000}deaktiviert.")
12194}
12195} else {
12196SendClientMessage(PREFIX . "Du kannst den S.W.A.T. Modus hier nicht (de-)aktivieren.")
12197}
12198}
12199}
12200return
12201:?:/wassermodus::
12202{
12203if (watermode) {
12204watermode := false
12205SendClientMessage(PREFIX . "Wassermodus {FF0000}deaktiviert.")
12206} else {
12207watermode := true
12208airmode := false
12209SendClientMessage(PREFIX . "Wassermodus {33CC00}aktiviert.")
12210}
12211}
12212return
12213:?:/luftmodus::
12214{
12215if (airmode) {
12216airmode := false
12217SendClientMessage(PREFIX . "Luftmodus {FF0000}deaktiviert.")
12218} else {
12219airmode := true
12220watermode := false
12221SendClientMessage(PREFIX . "Luftmodus {33CC00}aktiviert.")
12222}
12223}
12224return
12225:?:/sperrzone::
12226{
12227exclusionZoneInput := PlayerInput("Sperrzone: ")
12228if (exclusionZoneInput != "") {
12229if (StrLen(exclusionZoneInput) < 5) {
12230SendClientMessage(PREFIX . "Um eine Fehl-Meldung zu vermeiden, wurde der Vorgang abgebrochen. Gib mindestens 5 Zeichen für die Sperrzone ein!")
12231} else {
12232exclusionZone := exclusionZoneInput
12233SendChat("/gov Das Gebiet " . exclusionZone . " wird hiermit zur Sperrzone ernannt.")
12234if (!admin)
12235Sleep, 500
12236SendChat("/gov Personen, die sich widerrechtlich dort aufhalten, müssen mit Konsequenzen rechnen!")
12237}
12238}
12239}
12240return
12241:?:/ksperrzone::
12242{
12243if (exclusionZone == "") {
12244lineCount := chatLogLines.Length()
12245Loop, %lineCount% {
12246currentLine := chatLogLines[lineCount - A_Index - 1]
12247if (RegExMatch(currentLine, "^<< (.+) (\S+): Das Gebiet (.+) wird hiermit zur Sperrzone ernannt\. >>$", currentLine_)) {
12248SendChat("/gov Die Sperrzone " . currentLine_3 . " wird hiermit aufgehoben.")
12249return
12250}
12251}
12252SendChat("/gov Die Sperrzone wird hiermit aufgehoben.")
12253} else {
12254SendChat("/gov Die Sperrzone " . exclusionZone . " wird hiermit aufgehoben.")
12255exclusionZone := ""
12256}
12257}
12258return
12259putWeaponsAwayLabel:
12260{
12261if (!tv) {
12262if (IsInChat())
12263return
12264SendChat("/l Bitte stecken Sie umgehend Ihre Waffen ein.")
12265}
12266}
12267return
12268repeatLabel:
12269{
12270if (IsInChat())
12271return
12272SendInput, t{up}{enter}
12273}
12274return
12275autoAcceptEmergencyLabel:
12276{
12277if (IsInChat())
12278return
12279i := 0
12280SendClientMessage(PREFIX . "Starte automatische Notruf-Annahme...")
12281Loop
12282{
12283if (i > 75) {
12284SendClientMessage(PREFIX . "Keinen freien Notruf gefunden!")
12285break
12286}
12287chat := readChatLine(i)
12288if (RegExMatch(chat, "Anrufer: (\S+) \(\/notruf (\d+)\), Nummer: (\d+)", emergency)) {
12289acceptedByPlayer := false
12290j := i
12291Loop
12292{
12293j--
12294if (j < 0)
12295break
12296acceptedChat := readChatLine(j)
12297if (RegExMatch(acceptedChat, "\[HQ\]: (.+) (\S+) übernimmt den Notruf von (\S+)\.", accepted)) {
12298if (accepted3 == emergency1) {
12299acceptedByPlayer := true
12300}
12301}
12302}
12303if (!acceptedByPlayer) {
12304SendChat("/notruf " . emergency2)
12305Sleep, 200
12306chat := readChatLine(0)
12307if (!RegExMatch(chat, "^Der Spieler benötigt kein Streifenwagen\.$")) {
12308SendChat("/d [HQ]: Ich übernehme den Notruf von " . emergency1 . "! [ID: " . emergency2 . "]")
12309services := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=services")
12310IniWrite, %services%, stats.ini, Übernahmen, Notrufe
12311SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(services) . " {FFFFFF}Notrufe übernommen.")
12312break
12313}
12314}
12315} else if (RegExMatch(chat, "\[WANTED\] Verdächtiger: (\S+), Zeuge: (\S+), Verbrechen: Überfall GK (\S+) \((\S+)\)", emergency)) {
12316SendChat("/d [HQ]: Ich übernehme den Ladenüberfall von " . emergency1 . " (ID: " . getPlayerIdByName(emergency1, true) . ") im GK " . emergency3 . " (" . emergency4 . ")")
12317gk(emergency3, emergency4, true)
12318storerobs := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=storerobs")
12319IniWrite, %storerobs%, stats.ini, Übernahmen, StoreRobs
12320SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(storerobs) . " {FFFFFF}Ladenüberfälle übernommen.")
12321if (autoFindLastEscapee) {
12322SendClientMessage(PREFIX . "Möchtest du den Verbrecher nun automatisch suchen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
12323KeyWait, X, D, T10
12324if (!ErrorLevel) {
12325playerToFind := emergency1
12326if (!autoShowRunning) {
12327autoFindRunning := true
12328GoSub, AutoFindTimer
12329SetTimer, AutoFindTimer, 5500
12330}
12331SendClientMessage(PREFIX . "Das automatische Suchen wird mit der Taste " . SECCOL . stopAutomaticSystemsNoMods . " {FFFFFF}beendet.")
12332}
12333}
12334break
12335}
12336i++
12337}
12338}
12339return
12340acceptEmergencyLabel:
12341{
12342if (IsInChat())
12343return
12344name := PlayerInput("Notruf-ID: ")
12345name := getFullName(name)
12346if (name != "") {
12347SendChat("/notruf " . name)
12348Sleep, 200
12349chat := readChatLine(0)
12350if (!RegExMatch(chat, "^Der Spieler benötigt kein Streifenwagen\.$")) {
12351SendChat("/d [HQ]: Ich übernehme den Notruf von " . name . "! [ID: " . getPlayerIdByName(name, true) . "]")
12352services := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=services")
12353IniWrite, %services%, stats.ini, Übernahmen, Notrufe
12354SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(services) . " {FFFFFF}Notrufe übernommen.")
12355}
12356}
12357}
12358return
12359stopwatchLabel:
12360{
12361if (IsInChat())
12362return
12363SendChat("/l Stoppuhr gestartet!")
12364SendClientMessage(PREFIX . "Um die Stoppuhr zu beenden, drücke " . SECCOL . "Punkt (.){FFFFFF}!")
12365stopwatch := 0
12366Loop {
12367stopwatch++
12368KeyWait, ., D T1
12369if (!ErrorLevel) {
12370minutes := Floor(stopwatch / 60)
12371seconds := stopwatch - (minutes * 60)
12372SendChat("/l Stoppuhr gestoppt: " . minutes . " Minuten, " . seconds . " Sekunden")
12373SendChat("/l Gesamt: " . stopwatch . " Sekunden")
12374break
12375}
12376}
12377}
12378return
12379eatFishLabel:
12380{
12381if (IsInChat())
12382return
12383SendChat("/eat " . currentFish)
12384currentFish++
12385if (currentFish == 6) {
12386currentFish := 1
12387}
12388}
12389return
12390:?:/fischtyp::
12391:?:/fishtype::
12392:?:/fishtyp::
12393{
12394SendClientMessage(PREFIX . SECCOL . "1: {FFFFFF}geringste LBS/HP - " . SECCOL . "2: {FFFFFF}geringster Geldwert")
12395fishType := PlayerInput("Typ: ")
12396if (fishType == "1") {
12397fishMode := 0
12398SendClientMessage(PREFIX . "Du wirfst nun den Fisch mit dem geringsten " . SECCOL . "LBS/HP-Wert {FFFFFF}weg.")
12399IniWrite, %fishMode%, settings.ini, Einstellungen, FischModus
12400} else if (fishType == "2") {
12401fishMode := 1
12402SendClientMessage(PREFIX . "Du wirfst nun den Fisch mit dem geringsten " . SECCOL . "Geldwert {FFFFFF}weg.")
12403IniWrite, %fishMode%, settings.ini, Einstellungen, FischModus
12404}
12405}
12406return
12407:?:/afish::
12408{
12409fishNumber := 0
12410aFishMoney := 0
12411aFishHP := 0
12412cheapestFish := -1
12413cheapestFishName := ""
12414cheapestFishValue := 100000
12415cheapestFishMoney := 100000
12416cheapestFishHP := 100000
12417thrownAway := false
12418attempt := 1
12419Loop {
12420SendChat("/fish")
12421Sleep, 200
12422fishing := readChatLine(0)
12423if (RegExMatch(fishing, "Du hast ein\/e (.+) mit (\d+) LBS gefangen.", fishing_)) {
12424fishNumber++
12425currentFishMoney := getFishValue(fishing_1, fishing_2)
12426if (fishMode) {
12427fishValue := currentFishMoney
12428} else {
12429fishValue := fishing_2
12430}
12431setChatLine(0, PREFIX . "Fisch Nr. " . fishNumber . ": " . SECCOL . fishing_1 . "{FFFFFF} mit " . SECCOL . fishing_2 . " LBS{FFFFFF} - Wert: " . SECCOL . FormatNumber(currentFishMoney) . "$")
12432aFishMoney += currentFishMoney
12433aFishHP += fishing_2
12434if (cheapestFishValue > fishValue) {
12435cheapestFish := fishNumber
12436cheapestFishName := fishing_1
12437cheapestFishValue := fishValue
12438cheapestFishMoney := currentFishMoney
12439cheapestFishHP := fishing_2
12440}
12441} else if (RegExMatch(fishing, "Du kannst nur 5 Fische bei dir tragen.")) {
12442if (cheapestFish == -1) {
12443SendClientMessage(PREFIX . "Du musst deine Fische erst verkaufen!")
12444break
12445}
12446if (thrownAway)
12447break
12448aFishMoney -= cheapestFishMoney
12449aFishHP -= cheapestFishHP
12450SendChat("/releasefish " . cheapestFish)
12451Sleep, 200
12452if (fishMode) {
12453setChatLine(0, PREFIX . "Fisch Nr. " . cheapestFish . ": " . SECCOL . cheapestFishName . " {FFFFFF}mit einem Wert von " . SECCOL . FormatNumber(cheapestFishValue) . "$ {FFFFFF}wurde weggeworfen!")
12454} else {
12455setChatLine(0, PREFIX . "Fisch Nr. " . cheapestFish . ": " . SECCOL . cheapestFishName . " {FFFFFF}mit " . SECCOL . FormatNumber(cheapestFishValue) . " LBS {FFFFFF}wurde weggeworfen!")
12456}
12457thrownAway := true
12458} else if (RegExMatch(fishing, "Du bist an keinem Angelplatz \(Big Wheel Rods\) oder an einem Fischerboot!")) {
12459if (attempt == 3) {
12460SendClientMessage(PREFIX . "Du kannst hier nicht angeln!")
12461break
12462}
12463attempt++
12464} else if (RegExMatch(fishing, "Du kannst erst in (\d+) (\S+) wieder angeln\.")) {
12465if (aFishMoney + aFishHP > 0) {
12466SendClientMessage(PREFIX . "Gesamtwert: " . SECCOL . FormatNumber(aFishMoney) . "$ {FFFFFF}- " . SECCOL . FormatNumber(aFishHP) . " LBS {FFFFFF}- " . SECCOL . Floor(aFishHP / 3) . " HP")
12467fishTime := 900
12468SetTimer, FishTimer, 1000
12469break
12470} else {
12471SendClientMessage(PREFIX . "Du kannst noch nicht angeln!")
12472break
12473}
12474}
12475if (!admin)
12476Sleep, 650
12477}
12478}
12479return
12480FishTimer:
12481{
12482if (fishTime == 60) {
12483SendClientMessage(PREFIX . "Du kannst in einer Minute wieder zum Angeln gehen!")
12484} else if (fishTime <= 0) {
12485SendClientMessage(PREFIX . "Du kannst nun wieder zum Angeln gehen!")
12486SetTimer, FishTimer, Off
12487fishTime := 0
12488return
12489}
12490fishTime--
12491}
12492return
12493:?:/asell::
12494{
12495if (IsPlayerInRangeOfPoint(2.3247, -28.8923, 1003.5494, 10)) {
12496SendClientMessage(PREFIX . "Deine Fische werden nun verkauft!")
12497sellFishMoney := 0
12498Loop, 5 {
12499SendChat("/sell fish " . A_Index)
12500Sleep, 200
12501chat := readChatLine(0)
12502if (RegExMatch(chat, "Du hast deinen (.+) \((\d+) LBS\) für (\d+)\$ verkauft.", chat_)) {
12503sellFishMoney += chat_3
12504}
12505if (!admin)
12506Sleep, 550
12507}
12508totalFishMoney := UrlDownloadToVar(baseURL . "api/stats?username=" . username . "&password=" . password . "&action=add&stat=fish_money&value=" . sellFishMoney)
12509IniWrite, %totalFishMoney%, stats.ini, Fischsystem, Fischgeld
12510SendClientMessage(PREFIX . "Verdienst: " . SECCOL . FormatNumber(sellFishMoney) . "$ {FFFFFF}Gesamter Verdienst: " . SECCOL . FormatNumber(totalFishMoney) . "$")
12511} else {
12512IniRead, totalFishMoney, stats.ini, Fischsystem, Fischgeld, 0
12513SendClientMessage(PREFIX . "Du kannst deine Fische hier nicht verkaufen! (Gesamter Verdienst: " . SECCOL . FormatNumber(totalFishMoney) . "${FFFFFF})")
12514}
12515}
12516return
12517:?:/acook::
12518{
12519Loop, 5 {
12520SendChat("/cook fish " . A_Index)
12521if (!admin)
12522Sleep, 750
12523}
12524}
12525return
12526:?:/fische::
12527{
12528SendChat("/fishes")
12529Sleep, 250
12530fishNumber := 5
12531fishMoney := 0
12532totalHP := 0
12533Loop, 5 {
12534fish := readChatLine(fishNumber)
12535RegExMatch(fish, "\*\* \((\d)\) Fisch: (.+) \((\d+) LBS\)", fish_)
12536fishValue := getFishValue(fish_2, fish_3)
12537fishMoney += fishValue
12538hp := Floor(fish_3 / 3)
12539totalHP += hp
12540message%A_Index% := PREFIX . "(" . fish_1 . ") " . fish_2 . " (" . fish_3 . " LBS) - " . SECCOL . fishValue . "$ {FFFFFF}- " . SECCOL . hp . " HP"
12541fishNumber -= 1
12542}
12543fishNumber := 5
12544Loop, 5 {
12545setChatLine(fishNumber, message%A_Index%)
12546fishNumber -= 1
12547}
12548SendClientMessage(PREFIX . "Gesamt: " . SECCOL . FormatNumber(fishMoney) . "$ {FFFFFF}- " . SECCOL . FormatNumber(totalHP) . " HP")
12549}
12550return
12551:?:/hp::
12552{
12553SendChat("/cooked")
12554Sleep, 250
12555fishNumber := 5
12556totalHP := 0
12557Loop, 5 {
12558fish := readChatLine(fishNumber)
12559if (RegExMatch(fish, "\*\* \((\d)\) Hergestellt: gekochten (.+) \((\d+) LBS\)", fish_)) {
12560HP := Floor(fish_3 / 3)
12561totalHP += HP
12562message%A_Index% := PREFIX . "(" . fish_1 . ") " . fish_2 . " (" . fish_3 . " LBS) - " . SECCOL . HP . " HP"
12563} else if (RegExMatch(fish, "\*\* \((\d)\) Hergestellt: Nichts \(0 LBS\)", fish_)) {
12564message%A_Index% := PREFIX . "(" . fish_1 . ") Nichts"
12565}
12566fishNumber -= 1
12567}
12568fishNumber := 5
12569Loop, 5 {
12570setChatLine(fishNumber, message%A_Index%)
12571fishNumber -= 1
12572}
12573SendClientMessage(PREFIX . "Gesamt: " . SECCOL . FormatNumber(totalHP) . " HP")
12574}
12575return
12576:?:/fstreife::
12577{
12578SendChat("/f Suche Streifenpartner, bei Interesse melden!")
12579}
12580return
12581:?:/rb::
12582{
12583SendChat("/roadblock create")
12584}
12585return
12586:?:/db::
12587{
12588SendChat("/roadblock delete")
12589}
12590return
12591:?:/dba::
12592{
12593SendChat("/roadblock deleteall")
12594}
12595return
12596:?:/rs::
12597:?:/rr::
12598{
12599SendChat("/robres")
12600}
12601return
12602:?:/sr::
12603{
12604SendChat("/showres")
12605}
12606return
12607:?:/stats::
12608{
12609if (statsFormatted) {
12610showStats()
12611} else {
12612if (tv) {
12613SendChat("/check " . tvName)
12614} else {
12615SendChat("/stats")
12616}
12617}
12618}
12619return
12620togCellphoneLabel:
12621{
12622if (IsInChat())
12623return
12624SendChat("/tog")
12625Sleep, 200
12626SendInput, {enter}
12627}
12628return
12629firstAidLabel:
12630{
12631if (!tv) {
12632if (IsInChat())
12633return
12634hp := getPlayerHealth()
12635if (hp > 95) {
12636SendClientMessage(PREFIX . "Du kannst aktuell kein Erste-Hilfe-Paket benutzen, da du mehr als " . SECCOL . "95 HP {FFFFFF}hast!")
12637} else {
12638SendChat("/erstehilfe")
12639}
12640}
12641}
12642return
12643countdownLabel:
12644{
12645if (!tv) {
12646if (IsInChat())
12647return
12648if (countdownRunning) {
12649SetTimer, CountdownTimer, Off
12650countdownRunning := false
12651SendChat("/" . cdChat . " Der Countdown wurde abgebrochen!")
12652} else {
12653cdTime := 5
12654cdChat := "l"
12655cdGoMessage := "Letzte Warnung!"
12656SendClientMessage(PREFIX . "Du kannst den Countdown mit " . SECCOL . stopAutomaticSystemsNoMods . " {FFFFFF}abbrechen.")
12657SendChat("/" . cdChat . " Es folgt ein Countdown, sollten Sie sich weigern, wenden wir härte Maßnahmen an!")
12658SetTimer, CountdownTimer, 1000
12659countdownRunning := true
12660}
12661}
12662}
12663return
12664:?:/cd::
12665{
12666if (countdownRunning) {
12667SetTimer, CountdownTimer, Off
12668countdownRunning := false
12669SendChat("/" . cdChat . " Der Countdown wurde abgebrochen!")
12670} else {
12671cdTime := PlayerInput("Sekunden: ")
12672if (cdTime == "")
12673cdTime := 3
12674if cdTime is not number
12675return
12676cdChat := PlayerInput("Chat: ")
12677if (cdChat == "")
12678cdChat := "l"
12679SendChat("/" . cdChat . " Countdown:")
12680cdGoMessage := "Go Go Go!"
12681SendClientMessage(PREFIX . "Du kannst den Countdown mit " . SECCOL . stopAutomaticSystemsNoMods . " {FFFFFF}abbrechen.")
12682SetTimer, CountdownTimer, 1000
12683countdownRunning := true
12684}
12685}
12686return
12687CountdownTimer:
12688{
12689if (cdTime == 0) {
12690SendChat("/" . cdChat . " " . cdGoMessage)
12691SetTimer, CountdownTimer, Off
12692countdownRunning := false
12693if (cdGoMessage == "Letzte Warnung!") {
12694Sleep, 3000
12695SendClientMessage(PREFIX . "Der Spieler ist freigegeben!")
12696}
12697return
12698}
12699SendChat("/" . cdChat . " >>> " . cdTime . " <<<")
12700cdTime--
12701}
12702return
12703:?:/taxi::
12704{
12705if (!tv) {
12706SendChat("/l Wir sind kein Taxiunternehmen, wir sind Beamte.")
12707}
12708}
12709return
12710:?:/gf::
12711:?:/gfs::
12712{
12713SendChat("/gangfights")
12714}
12715return
12716thanksLabel:
12717if (IsInChat())
12718return
12719:?:/thx::
12720{
12721Random, rand, 1, 3
12722if (rand == 1) {
12723SendChat("Vielen Dank!")
12724} else if (rand == 2) {
12725SendChat("Dankeschön!")
12726} else if (rand == 3) {
12727SendChat("Merci!")
12728}
12729}
12730return
12731sorryLabel:
12732if (IsInChat())
12733return
12734:?:/sry::
12735{
12736Random, rand, 1, 3
12737if (rand == 1) {
12738SendChat("Entschuldigung!")
12739} else if (rand == 2) {
12740SendChat("Sorry!")
12741} else if (rand == 3) {
12742SendChat("Tut mir leid!")
12743}
12744}
12745return
12746:?:/np::
12747{
12748Random, rand, 1, 3
12749if (rand == 1) {
12750SendChat("Kein Problem!")
12751} else if (rand == 2) {
12752SendChat("Gerne!")
12753} else if (rand == 3) {
12754SendChat("Bitteschön!")
12755}
12756}
12757return
12758:?:/beweise::
12759{
12760SendChat("Haben Sie dafür Beweise? (Screenshots, Video, o.ä.)")
12761}
12762return
12763:?:/zeuge::
12764{
12765SendChat("Zeugen zählen nicht und werden nicht weiter beachtet.")
12766}
12767return
12768:?:/warte::
12769{
12770SendChat("Einen Moment bitte, der Fall wird überprüft.")
12771}
12772return
12773:?:/antrag::
12774{
12775SendChat("Haben Sie schon einen Antrag im Forum erstellt?")
12776SendChat("Dies geht unter im Forum unter (LSPD | Unberechtigte Fahndungsstufen)")
12777}
12778return
12779:?:/beschwerde::
12780{
12781SendChat("/l Sie haben das Recht, eine Beschwerde im Forum zu erstellen.")
12782SendChat("/l Wir bitten Sie hierbei, die Beschwerdeninformationen zu beachten.")
12783}
12784return
12785:?:/rechte::
12786{
12787SendChat("/l Sie haben das Recht zu schweigen. Alles was Sie sagen, kann und wird vor Gericht gegen Sie verwendet werden.")
12788if (!admin)
12789Sleep, 1000
12790SendChat("/l Sie haben das Recht auf einen Anwalt. Können Sie sich keinen leisten wird Ihnen einer gestellt.")
12791if (!admin)
12792Sleep, 1000
12793SendChat("/l Haben Sie Ihre Rechte verstanden, welche ich Ihnen vorgelesen hab?")
12794}
12795return
12796:?:/warten::
12797{
12798SendChat("/l Bitte warten Sie einen Moment, ich überprüfe die Gültigkeit Ihrer Dokumente.")
12799}
12800return
12801:?:/passieren::
12802{
12803SendChat("/l Sie dürfen passieren.")
12804SendChat("/l Ich wünsche Ihnen eine gute Weiterfahrt. Auf Wiedersehen!")
12805}
12806return
12807:?:/runter::
12808{
12809SendChat("/l Steigen Sie bitte umgehend vom Fahrzeug.")
12810SendChat("/l Ansonsten sind wir gezwungen Sie wegen Verweigerung zu verhaften.")
12811}
12812return
12813:?:/hdf::
12814:?:/ruhe::
12815{
12816SendChat("/l Sein Sie bitte still.")
12817}
12818return
12819:?:/afk::
12820{
12821afk := UrlDownloadToVar(baseURL . "api/isafk?username=" . username . "&password=" . password)
12822StringSplit, afk_, afk, ~
12823if (afk_1 == "error") {
12824SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten: {FF0000}" . afk_2)
12825return
12826} else if (afk_1) {
12827SendChat("/f Ich bin nun nicht mehr AFK und melde mich zurück!")
12828} else {
12829afkTime := PlayerInput("Zeit: ")
12830if (afkTime != "") {
12831if afkTime is number
12832{
12833if (afkTime > 20) {
12834SendClientMessage(PREFIX . "Du darfst dich nicht länger als 20 Minuten AFK melden!")
12835return
12836} else {
12837SendChat("/f Ich melde mich AFK, Zeit: " . afkTime . " Minuten")
12838}
12839} else {
12840SendClientMessage(PREFIX . "Du musst eine Zeit angeben!")
12841return
12842}
12843}
12844}
12845Sleep, 250
12846afk := UrlDownloadToVar(baseURL . "api/afk?username=" . username . "&password=" . password . "&time=" . afkTime)
12847StringSplit, afk_, afk, ~
12848if (afk_1 == "error") {
12849SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten: {FF0000}" . afk_2)
12850} else {
12851SendClientMessage(PREFIX . afk_2)
12852}
12853}
12854return
12855:?:/afklist::
12856{
12857result := UrlDownloadToVar(baseURL . "api/afklist?username=" . username . "&password=" . password)
12858if (result == "ERROR_BAD_LINK") {
12859SendClientMessage(PREFIX . "{FF0000}Fehlerhafte Parameterübergabe!")
12860} else if (result == "ERROR_USER_NOT_FOUND") {
12861SendClientMessage(PREFIX . "{FF0000}Der Account mit dem Namen " . username . " wurde nicht gefunden!")
12862} else if (result == "ERROR_WRONG_PASSWORD") {
12863SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert, das Passwort ist falsch!")
12864} else if (result == "ERROR_ACCESS_DENIED") {
12865SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert!")
12866} else if (result == "ERROR_MYSQL_QUERY") {
12867SendClientMessage(PREFIX . "{FF0000}Es ist ein Fehler bei der MySQL-Abfrage aufgetreten!")
12868} else if (result == "ERROR_CONNECTION") {
12869SendClientMessage(PREFIX . "{FF0000}Aktuell liegt ein Fehler in der Verbindung zum Server vor!")
12870} else if (result == "ERROR_NOBODY_AFK") {
12871SendClientMessage(PREFIX . "Es hat sich niemand AFK gemeldet!")
12872} else {
12873Loop, Parse, result, `n
12874{
12875StringSplit, result_, A_LoopField, ~
12876SendClientMessage(PREFIX . SECCOL . result_1 . " {FFFFFF}- AFK gemeldet um: " . SECCOL . result_2 . " Uhr {FFFFFF}Bis: " . SECCOL . result_3 . " Uhr")
12877}
12878}
12879}
12880return
12881:?:/time::
12882{
12883SendChat("/time")
12884Sleep, 100
12885adrGTA2 := getModuleBaseAddress("gta_sa.exe", hGTA)
12886cText := readString(hGTA, adrGTA2 + 0x7AAD43, 512)
12887if (RegExMatch(cText, "(.+)In Behandlung: (\d+)", cText_)) {
12888time := formatTime(cText_2)
12889writeString(hGTA, adrGTA2 + 0x7AAD43, cText_1 . "Noch " . time . " im KH")
12890SendClientMessage(PREFIX . "Du bist noch " . SECCOL . time . " {FFFFFF}im Krankenhaus.")
12891} else if (RegExMatch(cText, "(.+)Knastzeit: (\d+)", cText_)) {
12892time := formatTime(cText_2)
12893if (getPlayerInteriorId() == 1) {
12894writeString(hGTA, adrGTA2 + 0x7AAD43, cText_1 . "Noch " . time . " im Prison")
12895SendClientMessage(PREFIX . "Du bist noch " . SECCOL . time . " {FFFFFF}im Prison.")
12896} else {
12897writeString(hGTA, adrGTA2 + 0x7AAD43, cText_1 . "Noch " . time . " im Knast")
12898SendClientMessage(PREFIX . "Du bist noch " . SECCOL . time . " {FFFFFF}im Knast, die Kaution beträgt " . SECCOL . FormatNumber(Floor(cText_2 / 60) * 500) . "${FFFFFF}.")
12899}
12900}
12901}
12902return
12903:?:/pi::
12904{
12905name := PlayerInput("Spielerinformationen: ")
12906SendChat("/id " . name)
12907SendChat("/number " . name)
12908SendChat("/mdc " . name)
12909}
12910return
12911:?:/alotto::
12912{
12913if (lottoNumber == 0) {
12914Random, randomNumber, 1, 200
12915SendChat("/lotto " . randomNumber)
12916} else if (lottoNumber == 201) {
12917SendChat("/lotto " . getId())
12918} else {
12919SendChat("/lotto " . lottoNumber)
12920}
12921}
12922return
12923:?:/re::
12924:?:/resms::
12925{
12926distanceSMS := 0
12927Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
12928{
12929if (RegExMatch(A_LoopReadLine, "SMS: (.+), Sender: (\S+) \((\d+)\)", preSMS_)) {
12930if (preSMS_2 != getUsername()) {
12931RegExMatch(A_LoopReadLine, "SMS: (.+), Sender: (\S+) \((\d+)\)", sms_)
12932}
12933} else if (RegExMatch(A_LoopReadLine, "SMS: (.+)\.\.\.", preSMS_1_)) {
12934distanceSMS := 0
12935RegExMatch(A_LoopReadLine, "SMS: (.+)\.\.\.", sms_)
12936} else if (RegExMatch(A_LoopReadLine, "\.\.\.(.*), Sender: (\S+) \((\d+)\)", preSMS_2_)) {
12937if (distanceSMS == 2) {
12938if (preSMS_2_2 != getUsername()) {
12939sms_2 := preSMS_2_2
12940sms_3 := preSMS_2_3
12941}
12942}
12943}
12944distanceSMS++
12945}
12946if (sms_2 != "") {
12947SendClientMessage(PREFIX . "Letzte SMS (von " . SECCOL . sms_2 . "{FFFFFF}):")
12948SendClientMessage(PREFIX . SECCOL . sms_1)
12949SendInput, /sms %sms_3%{space}
12950} else {
12951SendClientMessage(PREFIX . "Keiner hat dich angeschrieben!")
12952}
12953}
12954return
12955:?:/readv::
12956{
12957Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
12958{
12959if (RegExMatch(A_LoopReadLine, "\[Werbung\] (.+), (\S+) \((\d+)\)")) {
12960RegExMatch(A_LoopReadLine, "\[Werbung\] (.+), (\S+) \((\d+)\)", ad_)
12961}
12962}
12963if (ad_2 != "") {
12964SendClientMessage(PREFIX . "Letzte Werbung (von " . ad_2 . "):")
12965SendClientMessage(PREFIX . ad_1)
12966SendInput, /sms %ad_3%{space}
12967} else {
12968SendClientMessage(PREFIX . "Keine letzte Werbung gefunden!")
12969}
12970}
12971return
12972:?:/fan::
12973{
12974name := PlayerInput("Fan: ")
12975name := getFullName(name)
12976if (name != "") {
12977SendChat("/me gibt " . name . " ein Autogramm.")
12978SendChat("/showbadge " . name)
12979}
12980}
12981return
12982:?:/pb::
12983:?:/paintball::
12984{
12985SendChat("/paintball")
12986Sleep, 200
12987players := 0
12988Loop, 100 {
12989chat := readChatLine(players)
12990if (InStr(chat, "Punkte")) {
12991players++
12992} else {
12993SendClientMessage(PREFIX . "Spieler im Paintball: " . SECCOL . players)
12994return
12995}
12996}
12997}
12998return
12999:?:/savestats::
13000{
13001FormatTime, time,, dd.MM.yyyy HH:mm
13002SendClientMessage(PREFIX . "Statistiken werden gespeichert! Datum: " . SECCOL . time)
13003SendChat("/time")
13004Sleep, 250
13005SendChat("/stats")
13006Sleep, 250
13007SendInput, {F8}
13008Sleep, 250
13009SendInput, {ESC}
13010}
13011return
13012:?:/uc::
13013{
13014SendInput, /undercover{space}
13015}
13016return
13017:?:/auc::
13018{
13019Random, number, 1, 39
13020SendChat("/undercover " . number)
13021}
13022return
13023membersLabel:
13024{
13025if (IsInChat())
13026return
13027SendChat("/members")
13028}
13029return
13030crewmembersLabel:
13031{
13032if (IsInChat())
13033return
13034SendChat("/crewmembers")
13035}
13036return
13037:?:/jas::
13038{
13039SendChat("Ja Sir, was kann ich für Sie tun?")
13040}
13041return
13042:?:/jam::
13043{
13044SendChat("Ja Madam, was kann ich für Sie tun?")
13045}
13046return
13047:?:/ja::
13048{
13049SendChat("Ja, was kann ich für Sie tun?")
13050}
13051return
13052:?:/kcall::
13053{
13054name := PlayerInput("Name: ")
13055if (name != "") {
13056SendChat("/number " . name)
13057Sleep, 200
13058chat := readChatLine(0)
13059if (RegExMatch(chat, "Name: (\S*), Ph: (\d*)", number_)) {
13060SendChat("/call " . number_2)
13061} else {
13062SendClientMessage(PREFIX . "Anruf fehlgeschlagen!")
13063}
13064}
13065}
13066return
13067:?:/ksms::
13068{
13069name := PlayerInput("Name: ")
13070if (name != "") {
13071SendChat("/number " . name)
13072Sleep, 200
13073chat := readChatLine(0)
13074if (RegExMatch(chat, "Name: (\S*), Ph: (\d*)", number_)) {
13075SendInput, t/sms %number_2%{space}
13076} else {
13077SendClientMessage(PREFIX . "Senden der SMS fehlgeschlagen!")
13078}
13079}
13080}
13081return
13082:?:/p::
13083{
13084called := false
13085Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
13086{
13087if (RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)")) {
13088RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)", caller_)
13089called := true
13090} else if (RegExMatch(A_LoopReadLine, "Der Gesprächspartner hat aufgelegt\.") || RegExMatch(A_LoopReadLine, "Du hast aufgelegt\.") || RegExMatch(A_LoopReadLine, "Die Verbindung zu deinem Gesprächspartner wurde unterbrochen\.")) {
13091called := false
13092}
13093}
13094if (called && caller_1 != "") {
13095name := getUsername()
13096SendChat("/pickup")
13097SendChat("Guten " . getDayTime() . " " . caller_1 . ", Sie sprechen mit " . name . ".")
13098SendChat("Wie kann ich Ihnen helfen?")
13099} else {
13100SendClientMessage(PREFIX . "Niemand hat dich angerufen!")
13101}
13102}
13103return
13104:?:/h::
13105{
13106called := false
13107pickedup := false
13108Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
13109{
13110if (RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)") || RegExMatch(A_LoopReadLine, "Der Spieler hat abgehoben\.")) {
13111RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)", caller_)
13112called := true
13113pickedup := true
13114} else if (RegExMatch(A_LoopReadLine, "Bitte Warte bis der Spieler annimmt\.")) {
13115called := true
13116pickedup := false
13117} else if (RegExMatch(A_LoopReadLine, "Der Gesprächspartner hat aufgelegt\.") || RegExMatch(A_LoopReadLine, "Du hast aufgelegt\.") || RegExMatch(A_LoopReadLine, "Die Verbindung zu deinem Gesprächspartner wurde unterbrochen\.")) {
13118called := false
13119pickedup := false
13120}
13121}
13122if (called) {
13123if (pickedup) {
13124if (caller_1 != "") {
13125SendChat("Vielen Dank für Ihren Anruf, " . caller_1 . ".")
13126} else {
13127SendChat("Vielen Dank für Ihren Anruf.")
13128}
13129SendChat("Ich wünsche Ihnen noch einen schönen " . getDayTime() . ".")
13130}
13131SendChat("/hangup")
13132} else {
13133SendClientMessage(PREFIX . "Niemand hat dich angerufen!")
13134}
13135}
13136return
13137:?:/ab::
13138{
13139called := false
13140Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
13141{
13142if (RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)")) {
13143RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)", caller_)
13144called := true
13145} else if (RegExMatch(A_LoopReadLine, "Der Gesprächspartner hat aufgelegt\.") || RegExMatch(A_LoopReadLine, "Du hast aufgelegt\.") || RegExMatch(A_LoopReadLine, "Die Verbindung zu deinem Gesprächspartner wurde unterbrochen\.")) {
13146called := false
13147}
13148}
13149if (called) {
13150SendChat("/pickup")
13151Sleep, 500
13152SendChat("Guten " . getDayTime() . " " . caller_1 . ",")
13153SendChat("Sie sind verbunden mit dem Anrufbeantworter von " . getUsername() . ".")
13154Sleep, 500
13155SendChat("Ich bin leider beschäftigt, bitte rufen Sie später erneut an!")
13156Sleep, 500
13157SendChat("/hangup")
13158} else {
13159SendClientMessage(PREFIX . "Niemand hat dich angerufen!")
13160}
13161}
13162return
13163:?:/tag::
13164{
13165SendChat("Guten " . getDayTime() . ", wie kann ich Ihnen behilflich sein?")
13166}
13167return
13168:?:/bye::
13169{
13170SendChat("Ich wünsche Ihnen noch einen schönen " . getDayTime() . ". Auf Wiedersehen!")
13171}
13172return
13173:?:/ac::
13174{
13175SendChat("/activity")
13176}
13177return
13178:?:/fg::
13179{
13180blockDialog()
13181SendChat("/stats")
13182Sleep, 200
13183unBlockDialog()
13184if (RegExMatch(getDialogText(), statsFormat, dialog_)) {
13185deposit := dialog_14
13186account := dialog_13
13187if (deposit == 0) {
13188if (getPlayerInteriorId() == 20) {
13189if (IsPlayerInRangeOfPoint(1429.6781, -997.2040, 1639.7843, 5)) {
13190if (account >= 1250000) {
13191SendChat("/festgeld 1250000")
13192} else if (account >= 50000 && account < 1250000) {
13193SendClientMessage(PREFIX . "Du hast aktuell nur " . SECCOL . formatNumber(account) . "$ {FFFFFF}auf dem Konto.")
13194SendClientMessage(PREFIX . "Möchtest du diesen Betrag als Festgeld anlegen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
13195KeyWait, X, D, T10
13196if (!ErrorLevel) {
13197SendChat("/festgeld " . account)
13198}
13199} else {
13200SendClientMessage(PREFIX . "Du hast nicht genügend Geld auf deinem Konto, um Festgeld anzulegen.")
13201}
13202} else {
13203SendClientMessage(PREFIX . "Du befindest dich nicht am Bankschalter.")
13204}
13205} else {
13206SendClientMessage(PREFIX . "Du hast derzeit kein Festgeld angelegt.")
13207SendClientMessage(PREFIX . "Begebe dich in die Bank, um Festgeld anzulegen.")
13208}
13209} else {
13210if (getPlayerInteriorId() == 20) {
13211if (IsPlayerInRangeOfPoint(1429.6781, -997.2040, 1639.7843, 5)) {
13212SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . formatNumber(deposit) . "$ {FFFFFF}Festgeld angelegt. Möchtest du es abbrechen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
13213KeyWait, X, D, T10
13214if (!ErrorLevel) {
13215SendChat("/cancelfestgeld")
13216}
13217} else {
13218if (account >= 1) {
13219SendChat("/festgeld 1")
13220} else {
13221SendClientMessage(PREFIX . "Du hast aktuell " . SECCOL . formatNumber(deposit) . "$ {FFFFFF}Festgeld angelegt. Um zu sehen, wie lange es noch dauert, brauchst du mind. 1$ auf deinem Konto.")
13222}
13223}
13224} else {
13225if (account >= 1) {
13226SendChat("/festgeld 1")
13227} else {
13228SendClientMessage(PREFIX . "Du hast aktuell " . SECCOL . formatNumber(deposit) . "$ {FFFFFF}Festgeld angelegt. Um zu sehen, wie lange es noch dauert, brauchst du mind. 1$ auf deinem Konto.")
13229}
13230}
13231}
13232}
13233}
13234return
13235:?:/ap::
13236{
13237SendChat("/accept paket")
13238}
13239return
13240:?:/tanken::
13241{
13242if (isPlayerInAnyVehicle()) {
13243if (getVehicleEngineState()) {
13244SendChat("/motor")
13245}
13246SendChat("/fill")
13247Sleep, 10000
13248SendChat("/motor")
13249SendChat("/licht")
13250} else {
13251SendClientMessage(PREFIX . "Du bist in keinem Fahrzeug!")
13252}
13253}
13254return
13255:?:/sbd::
13256{
13257SendInput, /showbadge{space}
13258}
13259return
13260:?:/minuten::
13261{
13262seconds := PlayerInput("Sekunden: ")
13263if (seconds != "") {
13264minutes := Floor(seconds / 60)
13265SendClientMessage(PREFIX . SECCOL . FormatNumber(seconds) . " {FFFFFF}Sekunden sind " . SECCOL . FormatNumber(minutes) " {FFFFFF}Minuten.")
13266}
13267}
13268return
13269:?:/link::
13270{
13271Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
13272{
13273if (RegExMatch(A_LoopReadLine, "(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})(\S*)")) {
13274RegExMatch(A_LoopReadLine, "(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})(\S*)", url_)
13275}
13276if (RegExMatch(A_LoopReadLine, "http:\/\/(\S+)")) {
13277RegExMatch(A_LoopReadLine, "http\:\/\/(\S+)", url_)
13278url := "http://" . url_1
13279} else if (RegExMatch(A_LoopReadLine, "https:\/\/(\S+)")) {
13280RegExMatch(A_LoopReadLine, "https\:\/\/(\S+)", url_)
13281url := "https://" . url_1
13282} else if (RegExMatch(A_LoopReadLine, "www.(\S+)")) {
13283RegExMatch(A_LoopReadLine, "www.(\S+)", url_)
13284url := "www." . url_1
13285}
13286}
13287clipboard := url
13288SendClientMessage(PREFIX . "Der folgende Link wurde in die Zwischenablage kopiert:")
13289SendClientMessage(PREFIX . SECCOL . url)
13290}
13291return
13292:?:/savechat::
13293{
13294FileCreateDir, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups
13295FormatTime, zeit, %A_Now%,dd.MM.yy - HH.mm
13296FileCopy, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups\chatlog %zeit% Uhr.txt, 0
13297SendClientMessage(PREFIX . "Es wurde ein Backup des aktuellen Chatlogs erstellt!")
13298}
13299return
13300:?:/cc::
13301:?:/chatclear::
13302{
13303Loop, 100 {
13304SendClientMessage("")
13305}
13306SendClientMessage(PREFIX . "Der Chat wurde erfolgreich geleert!")
13307}
13308return
13309:?:/sani::
13310{
13311SendChat("/d [HQ]: Ich benötige dringend einen Rettungswagen, aktuelle Position: " . getLocation())
13312SendChat("/service")
13313Sleep, 250
13314SendInput, {enter}
13315}
13316return
13317:?:/abschlepp::
13318{
13319SendChat("/d [HQ]: Ich benötige dringend einen Abschleppwagen, aktuelle Position: " . getLocation())
13320SendChat("/service")
13321Sleep, 250
13322SendInput, {down 4}{enter}
13323}
13324return
13325:?:/gk::
13326{
13327id := PlayerInput("Gebäudekomplex: ")
13328if (id == "")
13329return
13330if (RegExMatch(id, "^(\d+)\.(\d+)$")) {
13331gk(id)
13332}
13333}
13334return
13335:?:/sgk::
13336{
13337i := 0
13338Loop
13339{
13340if (i > 75) {
13341SendClientMessage(PREFIX . "Keinen Store-Rob gefunden!")
13342break
13343}
13344chat := readChatLine(i)
13345if (RegExMatch(chat, "\[WANTED\] Verdächtiger: (\S+), Zeuge: (\S+), Verbrechen: Überfall GK (\S+) \((\S+)\)", emergency)) {
13346SendClientMessage(PREFIX . "Ladenüberfall von " . SECCOL . emergency1 . " {FFFFFF}(ID: " . getPlayerIdByName(emergency1, true) . ") im GK " . SECCOL . emergency3 . " {FFFFFF}(" . emergency4 . ")")
13347gk(emergency3, emergency4, true)
13348if (autoFindLastEscapee) {
13349SendClientMessage(PREFIX . "Möchtest du den Verbrecher nun automatisch suchen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
13350KeyWait, X, D, T10
13351if (!ErrorLevel) {
13352playerToFind := emergency1
13353if (!autoShowRunning) {
13354autoFindRunning := true
13355GoSub, AutoFindTimer
13356SetTimer, AutoFindTimer, 5500
13357}
13358SendClientMessage(PREFIX . "Das automatische Suchen wird mit der Taste " . SECCOL . stopAutomaticSystemsNoMods . " {FFFFFF}beendet.")
13359}
13360}
13361break
13362}
13363i++
13364}
13365}
13366return
13367:?:/showgk::
13368{
13369id := PlayerInput("Gebäudekomplex-ID: ")
13370showGK(id)
13371}
13372return
13373:?:/checkpoint::
13374{
13375x := PlayerInput("x: ")
13376y := PlayerInput("y: ")
13377z := PlayerInput("z: ")
13378if (x != "" && y != "" && z != "") {
13379if (IsMarkerCreated()) {
13380SendClientMessage(PREFIX . "Es ist bereits ein Checkpoint gesetzt, wenn du diesen überschreiben willst, drücke " . SECCOL . "X{FFFFFF}!")
13381KeyWait, X, D, T10
13382if (ErrorLevel) {
13383return
13384}
13385}
13386if (setCheckpoint(x, y, z, 0.5)) {
13387SendClientMessage(PREFIX . "ERFOLG!")
13388} else {
13389SendClientMessage(PREFIX . "FEHLER!")
13390}
13391}
13392}
13393return
13394:?:/sanis::
13395{
13396result := UrlDownloadToVar("https://comniemeer.de/api/fractionmembers.php?id=4")
13397sanis := "Name`tRang`tID"
13398Loop, Parse, result, ~
13399{
13400if (RegExMatch(A_LoopField, "(\S+),(\d+)", member_)) {
13401id := getPlayerIdByName(member_1, true)
13402if (id != -1) {
13403sanis .= "`n{00FF00}" . member_1 . "`t{FF8000}" . member_2 . "`t" . id
13404} else {
13405sanis .= "`n{FF0000}" . member_1 . "`t{FF8000}" . member_2 . "`t-"
13406}
13407}
13408}
13409ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "LSMD Mitgliederliste", sanis, "OK")
13410}
13411return
13412:?:/oamt::
13413{
13414result := UrlDownloadToVar("https://comniemeer.de/api/fractionmembers.php?id=13")
13415oamt := "Name`tRang`tID"
13416Loop, Parse, result, ~
13417{
13418if (RegExMatch(A_LoopField, "(\S+),(\d+)", member_)) {
13419id := getPlayerIdByName(member_1, true)
13420if (id != -1) {
13421oamt .= "`n{00FF00}" . member_1 . "`t{FF8000}" . member_2 . "`t" . id
13422} else {
13423oamt .= "`n{FF0000}" . member_1 . "`t{FF8000}" . member_2 . "`t-"
13424}
13425}
13426}
13427ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Ordnungsamt Mitgliederliste", oamt, "OK")
13428}
13429return
13430:?:/gmbh::
13431{
13432result := UrlDownloadToVar("https://comniemeer.de/api/fractionmembers.php?id=14")
13433gmbh := "Name`tRang`tID"
13434Loop, Parse, result, ~
13435{
13436if (RegExMatch(A_LoopField, "(\S+),(\d+)", member_)) {
13437id := getPlayerIdByName(member_1, true)
13438if (id != -1) {
13439gmbh .= "`n{00FF00}" . member_1 . "`t{FF8000}" . member_2 . "`t" . id
13440} else {
13441gmbh .= "`n{FF0000}" . member_1 . "`t{FF8000}" . member_2 . "`t-"
13442}
13443}
13444}
13445ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Transport GmbH Mitgliederliste", gmbh, "OK")
13446}
13447return
13448:?:/ongmbh::
13449{
13450result := UrlDownloadToVar("https://comniemeer.de/api/fractionmembers.php?id=14")
13451gmbh := "{FFFFFF}Name `t`t`tRang`t`tID`n"
13452SendClientMessage(PREFIX . "Es werden nur Mitglieder der Transport GmbH angezeigt, die online sind.")
13453Loop, Parse, result, ~
13454{
13455RegExMatch(A_LoopField, "(\S+),(\d+)", member)
13456id := getPlayerIdByName(member1, true)
13457if (member1 != "") {
13458if (id != -1) {
13459SendClientMessage(PREFIX . member1 . " " . SECCOL . "[ID: " . id "] {FFFFFF}Rang: " . SECCOL . member2)
13460}
13461}
13462}
13463}
13464return
13465:?:/sanis::
13466{
13467result := UrlDownloadToVar("https://comniemeer.de/api/fractionmembers.php?id=4")
13468sanis := "Name`tRang`tID"
13469Loop, Parse, result, ~
13470{
13471if (RegExMatch(A_LoopField, "(\S+),(\d+)", member_)) {
13472id := getPlayerIdByName(member_1, true)
13473if (id != -1) {
13474sanis .= "`n{00FF00}" . member_1 . "`t{FF8000}" . member_2 . "`t" . id
13475} else {
13476sanis .= "`n{FF0000}" . member_1 . "`t{FF8000}" . member_2 . "`t-"
13477}
13478}
13479}
13480ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "LSMD Mitgliederliste", sanis, "OK")
13481}
13482return
13483:?:/onsanis::
13484{
13485result := UrlDownloadToVar("https://comniemeer.de/api/fractionmembers.php?id=4")
13486sanis := "{FFFFFF}Name `t`t`tRang`t`tID`n"
13487SendClientMessage(PREFIX . "Es werden nur Mitglieder des LSMD angezeigt, die online sind.")
13488Loop, Parse, result, ~
13489{
13490RegExMatch(A_LoopField, "(\S+),(\d+)", member)
13491id := getPlayerIdByName(member1, true)
13492if (member1 != "") {
13493if (id != -1) {
13494SendClientMessage(PREFIX . member1 . " " . SECCOL . "[ID: " . id "] {FFFFFF}Rang: " . SECCOL . member2)
13495}
13496}
13497}
13498}
13499return
13500:?:/coords::
13501{
13502GetPlayerPos(posX, posY, posZ)
13503SendClientMessage(PREFIX . "x: " . SECCOL . posX . " {FFFFFF}y: " . SECCOL . posY . " {FFFFFF}z: " . SECCOL . posZ)
13504}
13505return
13506:?:/relog::
13507{
13508SendClientMessage(PREFIX . "Du verbindest nun neu...")
13509restart()
13510}
13511return
13512:?:/addfreund::
13513:?:/addfriend::
13514{
13515friendNameInput := PlayerInput("Name/ID des Freundes: ")
13516if (friendNameInput == "")
13517return
13518friendName := getFullName(friendNameInput)
13519if (friendName == "") {
13520friendName := friendNameInput
13521}
13522if (!SQLiteDB.Query("SELECT name FROM friends WHERE name LIKE '" . friendName . "';", recordSet)) {
13523FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
13524SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten! Schau bitte in die log.txt und melde den Fehler bei Martin!")
13525}
13526if (!recordSet.HasRows) {
13527if (SQLiteDB.exec("INSERT INTO friends (name, added) VALUES ('" . friendName . "', '" . getUnixTimestamp(A_Now) . "');")) {
13528SendClientMessage(PREFIX . SECCOL . friendName . " {FFFFFF}wurde in die Freundesliste aufgenommen!")
13529} else {
13530FileAppend, % "SQLite Error: Query - Msg: '" . SQLiteDB.ErrorMsg . "' - Code: " . SQLiteDB.ErrorCode, log.txt
13531SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten! Schau bitte in die log.txt und melde den Fehler bei Martin!")
13532}
13533} else {
13534if (recordSet.Next(row)) {
13535if (SQLiteDB.exec("UPDATE friends SET name = '" . friendName . "', updated = '" . getUnixTimestamp(A_Now) . "' WHERE name = '" . friendName . "';")) {
13536SendClientMessage(PREFIX . SECCOL . friendName . " {FFFFFF}wurde in der Freundesliste aktualisiert!")
13537} else {
13538FileAppend, % "SQLite Error: Query - Msg: '" . SQLiteDB.ErrorMsg . "' - Code: " . SQLiteDB.ErrorCode, log.txt
13539SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten! Schau bitte in die log.txt und melde den Fehler bei Martin!")
13540}
13541}
13542}
13543recordSet.Free()
13544}
13545return
13546:?:/remfreund::
13547:?:/delfreund::
13548:?:/remfriend::
13549:?:/delfriend::
13550{
13551friendNameInput := PlayerInput("Name/ID des Freundes: ")
13552if (friendNameInput == "")
13553return
13554friendName := getFullName(friendNameInput)
13555if (friendName == "") {
13556friendName := friendNameInput
13557}
13558if (SQLiteDB.exec("DELETE FROM friends WHERE name = '" . friendName . "';")) {
13559SendClientMessage(PREFIX . SECCOL . friendName . " {FFFFFF}wurde aus der Freundesliste entfernt!")
13560if (onlineFriends.HasKey(friendName)) {
13561textLabelID := onlineFriends.Delete(friendName)
13562if (textLabelID != -1) {
13563deleteTextLabel(textLabelID)
13564}
13565}
13566}
13567}
13568return
13569:?:/freunde::
13570:?:/friends::
13571{
13572if (!SQLiteDB.Query("SELECT name FROM friends ORDER BY name ASC;", recordSet)) {
13573SendClientMessage(PREFIX . "Es ist ein SQLite-Fehler aufgetreten! Sieh' bitte in der log.txt nach und informiere Martin im Forum.")
13574FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
13575return
13576}
13577if (recordSet.HasRows) {
13578dialog := "Name`tID`tStatus"
13579playerCount := 0
13580while (recordSet.Next(row) >= 1) {
13581playerName := row[1]
13582playerID := getPlayerIdByName(playerName, true)
13583dialog .= "`n" . playerName . "`t" . (playerID == -1 ? "-" : playerID) . "`t" . (playerID == -1 ? "{FF0000}offline" : "{00FF00}online")
13584if (playerID != -1) {
13585playerCount++
13586}
13587}
13588Sleep, 100
13589ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Freunde online: " . SECCOL . playerCount, dialog, "OK")
13590} else {
13591SendClientMessage(PREFIX . "Du hast noch keine Freunde eingespeichert! Benutze " . SECCOL . "/addfriend")
13592}
13593recordSet.Free()
13594}
13595return
13596:?:/freundelabel::
13597:?:/friendslabel::
13598:?:/friendlabels::
13599:?:/friendslabels::
13600:?:/freundlabels::
13601:?:/freundelabels::
13602{
13603if (showFriendLabels) {
13604showFriendLabels := false
13605for friendName, textLabelID in onlineFriends {
13606if (textLabelID != -1) {
13607deleteTextLabel(textLabelID)
13608onlineFriends[friendName] := -1
13609}
13610}
13611SendClientMessage(PREFIX . "TextLabel über den Köpfen von Freunden {FF0000}deaktiviert{FFFFFF}.")
13612} else {
13613showFriendLabels := true
13614for friendName, textLabelID in onlineFriends {
13615if (textLabelID == -1) {
13616playerID := getPlayerIdByName(friendName)
13617if (playerID != -1) {
13618textLabelID := createTextLabel("[Freund]", 0xFF0000FF, 0, 0, 0.5, 20.0, 1, playerID)
13619onlineFriends[friendName] := textLabelID
13620}
13621}
13622}
13623SendClientMessage(PREFIX . "TextLabel über den Köpfen von Freunden {00FF00}aktiviert{FFFFFF}.")
13624}
13625}
13626return
13627FriendsTimer:
13628{
13629IfWinNotActive, GTA:SA:MP
13630return
13631if (!SQLiteDB.Query("SELECT name FROM friends ORDER BY name ASC;", recordSet)) {
13632FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
13633return
13634}
13635if (recordSet.HasRows) {
13636while (recordSet.Next(row) >= 1) {
13637friendName := row[1]
13638playerID := getPlayerIdByName(friendName, true)
13639if (ErrorLevel && debug) {
13640SendClientMessage(PREFIX . "Fehler beim Auslesen der ID von " . friendName . ": " . ErrorLevel)
13641continue
13642}
13643if (playerID != -1) {
13644if (!onlineFriends.HasKey(friendName)) {
13645textLabelID := -1
13646if (showFriendLabels) {
13647textLabelID := createTextLabel("[Freund]", 0xFF0000FF, 0, 0, 0.5, 20.0, 1, playerID)
13648}
13649onlineFriends[friendName] := textLabelID
13650if (!firstFriendsTimerRun && friendMessages) {
13651SendClientMessage(PREFIX . "Dein Freund " . SECCOL . friendName . " {FFFFFF}ist {00FF00}online {FFFFFF}gekommen.")
13652}
13653}
13654} else {
13655if (onlineFriends.HasKey(friendName)) {
13656textLabelID := onlineFriends.Delete(friendName)
13657if (textLabelID != -1) {
13658deleteTextLabel(textLabelID)
13659}
13660if (!firstFriendsTimerRun && friendMessages) {
13661SendClientMessage(PREFIX . "Dein Freund " . SECCOL . friendName . " {FFFFFF}ist {FF0000}offline {FFFFFF}gegangen.")
13662}
13663}
13664}
13665}
13666}
13667recordSet.Free()
13668if (firstFriendsTimerRun) {
13669firstFriendsTimerRun := false
13670}
13671}
13672return
13673:?:/whois::
13674{
13675newName := PlayerInput("Name: ")
13676newNameFull := getFullName(newName)
13677if (newNameFull != "")
13678newName := newNameFull
13679result := UrlDownloadToVar("https://comniemeer.de/api/namechange.php?name=" . newName, true)
13680if (result == "ERROR_CONNECTION")
13681return
13682try {
13683data := JSON.Load(result)
13684} catch {
13685AddChatMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
13686FormatTime, time, , dd.MM.yyyy HH:mm:ss
13687FileAppend, [%time%] Beim Laden des alten Namen ist ein Fehler aufgetreten: %result%`n, log.txt
13688return
13689}
13690if (data["error"] != "") {
13691AddChatMessage(PREFIX . "{FF0000}" . data["error"])
13692return
13693}
13694if (data["namechanges"].Length() == 0) {
13695AddChatMessage(PREFIX . "Es wurden keine Namensänderungen zu dem angegebenen Spieler gefunden!")
13696return
13697}
13698for i, namechange in data["namechanges"] {
13699if (InStr(newName, namechange["old_name"])) {
13700newName := namechange["old_name"]
13701break
13702} else if (InStr(newName, namechange["new_name"])) {
13703newName := namechange["new_name"]
13704break
13705}
13706}
13707AddChatMessage(PREFIX . "Namechange-Verlauf von " . SECCOL . newName . "{FFFFFF}:")
13708for i, namechange in data["namechanges"] {
13709AddChatMessage(PREFIX . SECCOL . namechange["old_name"] . " {FFFFFF}-> " . SECCOL . namechange["new_name"] . " {FFFFFF}(" . namechange["date"] . ")")
13710}
13711}
13712return
13713:?:/namechanges::
13714{
13715if (showNamechanges) {
13716SetTimer, NamechangeTimer, Off
13717showNamechanges := false
13718toRemove := []
13719for playerName, textLabelID in onlinePlayers {
13720if (textLabelID != -1) {
13721deleteTextLabel(textLabelID)
13722toRemove.Push(playerName)
13723}
13724}
13725for i, playerName in toRemove {
13726onlinePlayers.Delete(playerName)
13727}
13728SendClientMessage(PREFIX . "Namechange-Informationen über den Köpfen der Spieler {FF0000}deaktiviert{FFFFFF}.")
13729} else {
13730GoSub, NamechangeTimer
13731SetTimer, NamechangeTimer, 5000
13732showNamechanges := true
13733SendClientMessage(PREFIX . "Namechange-Informationen über den Köpfen der Spieler {00FF00}aktiviert{FFFFFF}.")
13734}
13735}
13736return
13737NamechangeTimer:
13738{
13739IfWinNotActive, GTA:SA:MP
13740return
13741toRemove := []
13742for playerName, textLabelID in onlinePlayers {
13743playerID := getPlayerIdByName(playerName, true)
13744if (playerID == -1) {
13745if (textLabelID != -1) {
13746deleteTextLabel(textLabelID)
13747}
13748toRemove.Push(playerName)
13749}
13750}
13751for i, playerName in toRemove {
13752onlinePlayers.Delete(playerName)
13753}
13754players := getStreamedInPlayersInfo()
13755for i, o in players {
13756playerID := o.ID
13757playerName := getPlayerNameByID(playerID)
13758if (playerName != "") {
13759if (!onlinePlayers.HasKey(playerName)) {
13760result := UrlDownloadToVar("https://comniemeer.de/api/namechange.php?name=" . playerName)
13761if (result == "ERROR_CONNECTION")
13762continue
13763try {
13764data := JSON.Load(result)
13765} catch {
13766FormatTime, time, , dd.MM.yyyy HH:mm:ss
13767FileAppend, [%time%] Beim Laden der Namechange-History ist ein Fehler aufgetreten: %result%`n, log.txt
13768continue
13769}
13770if (data["error"] != "") {
13771continue
13772}
13773textLabelID := -1
13774if (data["namechanges"].Length() == 0) {
13775onlinePlayers[playerName] := textLabelID
13776continue
13777}
13778namechanges := ""
13779nLines := 0
13780for i, namechange in data["namechanges"] {
13781namechanges .= SECCOL . namechange["old_name"] . " {FFFFFF}-> " . SECCOL . namechange["new_name"] . "`n"
13782nLines++
13783}
13784textLabelID := -1
13785if (namechanges != "") {
13786textLabelID := createTextLabel(namechanges, 0xFFFFFFFF, 0, 0, 0.65 + (nLines * 0.05), 20.0, 1, playerID)
13787}
13788onlinePlayers[playerName] := textLabelID
13789}
13790}
13791}
13792}
13793return
13794:?:/tankstelle::
13795:?:/tankstellen::
13796{
13797coords := getCoordinates()
13798result := URLDownloadToVar("https://comniemeer.de/api/tankstellen.php?x=" . coords[1] . "&y=" . coords[2] . "&z=" . coords[3])
13799try {
13800data := JSON.Load(result)
13801} catch {
13802SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
13803FormatTime, time, , dd.MM.yyyy HH:mm:ss
13804FileAppend, [%time%] Beim Laden der Tankstellen ist ein Fehler aufgetreten: %result%`n, log.txt
13805return
13806}
13807if (data["error"]) {
13808SendClientMessage(PREFIX . "{FF0000}" . data["error"])
13809} else {
13810gasstations := data["gasstations"]
13811dialog := "Tankstelle`tBesitzer`tTankpreis & Entfernung`tZuletzt geupdated"
13812for i, entry in gasstations {
13813name := entry["name"]
13814owner := entry["owner"]
13815price := entry["price"]
13816x := entry["x"]
13817y := entry["y"]
13818z := entry["z"]
13819distance := entry["distance"]
13820lastupdated := entry["lastupdated"]
13821updatedby := entry["updatedby"]
13822if (price <= 20) {
13823price := "{00FF00}" . price
13824} else if (price >= 50) {
13825price := "{FF0000}" . price
13826} else {
13827price := "{FFFF00}" . price
13828}
13829dialog .= "`n" . SECCOL . name . "`t" . owner . "`t" . price . "$ {FFFFFF}- " . FormatNumber(distance) . " m`t" . SECCOL . lastupdated . " {FFFFFF}(" . updatedby . ")"
13830}
13831showDialog(DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Übersicht der Tankstellen", dialog, "Schließen")
13832}
13833}
13834return
13835GasstationsTimer:
13836{
13837IfWinNotActive, GTA:SA:MP
13838return
13839if (!updateTextLabelData()) {
13840return
13841}
13842coords := getCoordinates()
13843data := []
13844data["name"] := getUsername()
13845data["gasstations"] := []
13846for i, o in oTextLabelData {
13847if (o.PLAYERID == 65535 && o.VEHICLEID == 65535) {
13848if (RegExMatch(o.TEXT, "(.+)\n\nBesitzer: (.+)\nTeilhaber: (\S+)\nLiterpreis: (\d+)\$\nBenötigte Liter: (\d+)\nBezugspreis: (\d+)\$\n\nFahrzeug mit \/fill betanken", label_)) {
13849gasstation := []
13850gasstation["owner"] := StrReplace(StrReplace(label_2, "]", "%5D"), "[", "%5B")
13851gasstation["partner"] := StrReplace(StrReplace(label_3, "]", "%5D"), "[", "%5B")
13852gasstation["description"] := StrReplace(StrReplace(StrReplace(label_2, "&", "%26"), "]", "%5D"), "[", "%5B")
13853gasstation["price"] := label_4
13854gasstation["x"] := o.XPOS
13855gasstation["y"] := o.YPOS
13856gasstation["z"] := o.ZPOS
13857data["gasstations"].Push(gasstation)
13858}
13859}
13860}
13861if (data["gasstations"].Length() > 0) {
13862jsonData := JSON.Dump(data)
13863result := URLDownloadToVar("https://comniemeer.de/api/updatetankstelle.php?data=" . jsonData)
13864Sleep, 30000
13865}
13866}
13867return
13868pauseLabel:
13869Suspend, permit
13870Suspend
13871if (A_IsSuspended) {
13872SendClientMessage(PREFIX . "Keybinder & Timer {FF0000}pausiert{FFFFFF}.")
13873SetTimer, ChatTimer, Off
13874SetTimer, TankTimer, Off
13875SetTimer, UncuffTimer, Off
13876SetTimer, FillCustoms, Off
13877SetTimer, HealTimer, Off
13878SetTimer, LottoTimer, Off
13879SetTimer, TempoTimer, Off
13880SetTimer, KillTimer, Off
13881SetTimer, TaskCheckTimer, Off
13882SetTimer, FriendsTimer, Off
13883SetTimer, GasstationsTimer, Off
13884} else {
13885SendClientMessage(PREFIX . "Keybinder & Timer {00FF00}aktiviert{FFFFFF}.")
13886SetTimer, ChatTimer, 100
13887SetTimer, TankTimer, 100
13888SetTimer, UncuffTimer, 100
13889SetTimer, FillCustoms, 500
13890SetTimer, HealTimer, 500
13891SetTimer, LottoTimer, 1000
13892SetTimer, TempoTimer, 100
13893SetTimer, KillTimer, 100
13894SetTimer, TaskCheckTimer, 5000
13895SetTimer, FriendsTimer, 1000
13896SetTimer, GasstationsTimer, 500
13897}
13898return