· 8 years ago · Jan 22, 2018, 06:12 PM
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}
4420SetWorkingDir, %A_ScriptDir%
4421SetTimer, AntiDecompile, 100
4422IfExist, update.bat
4423{
4424FileDelete, update.bat
4425}
4426global baseURL := "https://comniemeer.de/projects/8bitbinder/"
4427global robBaseURL := "https://comniemeer.de/projects/robbinder/"
4428global gkBaseURL := "https://lsmd.comniemeer.de/"
4429projectName := "GCT-Binder"
4430version := "0.1.0"
4431IniRead, kVersion, settings.ini, Info, Version, %A_Space%
4432if (kVersion != version) {
4433IniWrite, %version%, settings.ini, Info, Version
4434if (version == "1.0.1") {
4435FileDelete, images\Banner.jpg
4436}
4437}
4438errorMessage := "Es ist ein unbekannter Fehler aufgetreten!"
4439Start:
4440{
4441Sleep, 100
4442if (InStr(getServerName(), "German - Crimetime << Dein CnR >>") && getServerIP() == "95.156.228.73" && getServerPort() == "7777"){
4443 pName := GetUsername()
4444 userName := pName
4445 url = http://imperator.square7.ch/Keybinder/whitelist.txt
4446 testvar := UrlDownloadToVar(url)
4447 Sleep, 100
4448 if(inStr(testvar,"true"))
4449 {
4450 Loggedin := 1
4451 progress, Off
4452 }
4453 if(inStr(testvar,"false"))
4454 {
4455 progress, Off
4456 AddChatMessage(PREFIX . "Du stehst nicht auf der Whitelist! Der Keybinder wird nun beendet!")
4457 MsgBox, 16, Fehler, Du stehst nicht auf der Whitelist!`, Der Keybinder wird nun beendet!, 2
4458 ExitApp
4459 }
4460 Sleep, 100
4461}
4462else
4463{
4464 Progress, Off
4465 MsgBox, 16, Fehler, Bitte zuerst auf GCT einloggen`, dann den Keybinder starten!, 3
4466 ExitApp
4467}
4468newver := URLDownloadToVar("http://imperator.square7.ch/Keybinder/version2.txt")
4469if (version < newver){
4470MsgBox, 52, Keybinder - Version %version%, Es wurde von Imperator eine neue Keybinderversion veröffentlicht!`nMöchtest du diese nun herunterladen?
4471IfMsgBox, Yes
4472{
4473MsgBox, 64, Update, Das Update wird nun heruntergeladen.`nDieser Vorgang kann bis zu 20 Sekunden dauern., 3
4474FileMove, GCT-Binder.exe, GCT-Binder_%version%.exe
4475Sleep, 1000
4476URLDownloadToFile, http://imperator.square7.ch/Keybinder/GCT-Binder.exe, GCT-Binder.exe
4477FileDelete, GCT-Binder_%version%.exe
4478if (ErrorLevel){
4479MsgBox, 48, Information, Die GCT-Binder_%version%.exe konnte nicht gelöscht werden. Bitte lösche diese manuell!
4480}
4481ExitApp
4482}
4483else{
4484IfMsgBox, No
4485{
4486MsgBox, 64, Update, Ohne Update Kann der Keybinder nicht gestartet werden..., 3
4487ExitApp
4488}
4489}
4490}
4491
4492unBlockChatInput()
4493chatLogFile := FileOpen(A_MyDocuments . "\GTA San Andreas User Files\SAMP\chatlog.txt", "r")
4494firstChatLogRun := true
4495chatLogLines := []
4496FormatTime, time, , dd.MM.yyyy HH:mm:ss
4497IfNotExist, Gametext.dll
4498Progress, 20, Komponenten werden heruntergeladen..., GCT-Binder,ersteller | Imperator
4499{
4500URLDownloadToFile, http://imperator.square7.ch/Keybinder/Gametext.dll, Gametext.dll
4501}
4502IfNotExist, bin
4503{
4504FileCreateDir, bin
4505}
4506IfNotExist, bin\sqlite3.dll
4507{
4508URLDownloadToFile, %baseURL%downloads/bin/sqlite3.dll, bin\sqlite3.dll
4509}
4510IniRead, SQLite3DllPath, SQLiteDB.ini, Main, DllPath, %A_Space%
4511if (SQLite3DllPath != "bin\SQLite3.dll") {
4512IniWrite, % "bin\SQLite3.dll", SQLiteDB.ini, Main, DllPath
4513sleep, 5000
4514Progress, Off
4515}
4516
4517Class SQLiteDB Extends SQLiteDB.BaseClass {
4518Class BaseClass {
4519Static Version := ""
4520Static _SQLiteDLL := A_ScriptDir . "\SQLite3.dll"
4521Static _RefCount := 0
4522Static _MinVersion := "3.6"
4523}
4524Class _Table {
4525__New() {
4526This.ColumnCount := 0
4527This.RowCount := 0
4528This.ColumnNames := []
4529This.Rows := []
4530This.HasNames := False
4531This.HasRows := False
4532This._CurrentRow := 0
4533}
4534GetRow(RowIndex, ByRef Row) {
4535Row := ""
4536If (RowIndex < 1 || RowIndex > This.RowCount)
4537Return False
4538If !This.Rows.HasKey(RowIndex)
4539Return False
4540Row := This.Rows[RowIndex]
4541This._CurrentRow := RowIndex
4542Return True
4543}
4544Next(ByRef Row) {
4545Row := ""
4546If (This._CurrentRow >= This.RowCount)
4547Return -1
4548This._CurrentRow += 1
4549If !This.Rows.HasKey(This._CurrentRow)
4550Return False
4551Row := This.Rows[This._CurrentRow]
4552Return True
4553}
4554Reset() {
4555This._CurrentRow := 0
4556Return True
4557}
4558}
4559Class _RecordSet {
4560__New() {
4561This.ColumnCount := 0
4562This.ColumnNames := []
4563This.HasNames := False
4564This.HasRows := False
4565This.CurrentRow := 0
4566This.ErrorMsg := ""
4567This.ErrorCode := 0
4568This._Handle := 0
4569This._DB := {}
4570}
4571Next(ByRef Row) {
4572Static SQLITE_NULL := 5
4573Static SQLITE_BLOB := 4
4574Static EOR := -1
4575Row := ""
4576This.ErrorMsg := ""
4577This.ErrorCode := 0
4578If !(This._Handle) {
4579This.ErrorMsg := "Invalid query handle!"
4580Return False
4581}
4582RC := DllCall("SQlite3.dll\sqlite3_step", "Ptr", This._Handle, "Cdecl Int")
4583If (ErrorLevel) {
4584This.ErrorMsg := "DLLCall sqlite3_step failed!"
4585This.ErrorCode := ErrorLevel
4586Return False
4587}
4588If (RC <> This._DB._ReturnCode("SQLITE_ROW")) {
4589If (RC = This._DB._ReturnCode("SQLITE_DONE")) {
4590This.ErrorMsg := "EOR"
4591This.ErrorCode := RC
4592Return EOR
4593}
4594This.ErrorMsg := This._DB.ErrMsg()
4595This.ErrorCode := RC
4596Return False
4597}
4598RC := DllCall("SQlite3.dll\sqlite3_data_count", "Ptr", This._Handle, "Cdecl Int")
4599If (ErrorLevel) {
4600This.ErrorMsg := "DLLCall sqlite3_data_count failed!"
4601This.ErrorCode := ErrorLevel
4602Return False
4603}
4604If (RC < 1) {
4605This.ErrorMsg := "RecordSet is empty!"
4606This.ErrorCode := This._DB._ReturnCode("SQLITE_EMPTY")
4607Return False
4608}
4609Row := []
4610Loop, %RC% {
4611Column := A_Index - 1
4612ColumnType := DllCall("SQlite3.dll\sqlite3_column_type", "Ptr", This._Handle, "Int", Column, "Cdecl Int")
4613If (ErrorLevel) {
4614This.ErrorMsg := "DLLCall sqlite3_column_type failed!"
4615This.ErrorCode := ErrorLevel
4616Return False
4617}
4618If (ColumnType = SQLITE_NULL) {
4619Row[A_Index] := ""
4620} Else If (ColumnType = SQLITE_BLOB) {
4621BlobPtr := DllCall("SQlite3.dll\sqlite3_column_blob", "Ptr", This._Handle, "Int", Column, "Cdecl UPtr")
4622BlobSize := DllCall("SQlite3.dll\sqlite3_column_bytes", "Ptr", This._Handle, "Int", Column, "Cdecl Int")
4623If (BlobPtr = 0) || (BlobSize = 0) {
4624Row[A_Index] := ""
4625} Else {
4626Row[A_Index] := {}
4627Row[A_Index].Size := BlobSize
4628Row[A_Index].Blob := ""
4629Row[A_Index].SetCapacity("Blob", BlobSize)
4630Addr := Row[A_Index].GetAddress("Blob")
4631DllCall("Kernel32.dll\RtlMoveMemory", "Ptr", Addr, "Ptr", BlobPtr, "Ptr", BlobSize)
4632}
4633} Else {
4634StrPtr := DllCall("SQlite3.dll\sqlite3_column_text", "Ptr", This._Handle, "Int", Column, "Cdecl UPtr")
4635If (ErrorLevel) {
4636This.ErrorMsg := "DLLCall sqlite3_column_text failed!"
4637This.ErrorCode := ErrorLevel
4638Return False
4639}
4640Row[A_Index] := StrGet(StrPtr, "UTF-8")
4641}
4642}
4643This.CurrentRow += 1
4644Return True
4645}
4646Reset() {
4647This.ErrorMsg := ""
4648This.ErrorCode := 0
4649If !(This._Handle) {
4650This.ErrorMsg := "Invalid query handle!"
4651Return False
4652}
4653RC := DllCall("SQlite3.dll\sqlite3_reset", "Ptr", This._Handle, "Cdecl Int")
4654If (ErrorLevel) {
4655This.ErrorMsg := "DLLCall sqlite3_reset failed!"
4656This.ErrorCode := ErrorLevel
4657Return False
4658}
4659If (RC) {
4660This.ErrorMsg := This._DB._ErrMsg()
4661This.ErrorCode := RC
4662Return False
4663}
4664This.CurrentRow := 0
4665Return True
4666}
4667Free() {
4668This.ErrorMsg := ""
4669This.ErrorCode := 0
4670If !(This._Handle)
4671Return True
4672RC := DllCall("SQlite3.dll\sqlite3_finalize", "Ptr", This._Handle, "Cdecl Int")
4673If (ErrorLevel) {
4674This.ErrorMsg := "DLLCall sqlite3_finalize failed!"
4675This.ErrorCode := ErrorLevel
4676Return False
4677}
4678If (RC) {
4679This.ErrorMsg := This._DB._ErrMsg()
4680This.ErrorCode := RC
4681Return False
4682}
4683This._DB._Queries.Remove(This._Handle)
4684This._Handle := 0
4685Return True
4686}
4687}
4688__New() {
4689This._Path := ""
4690This._Handle := 0
4691This._Queries := {}
4692If (This.Base._RefCount = 0) {
4693SQLiteDLL := This.Base._SQLiteDLL
4694If !FileExist(SQLiteDLL)
4695If FileExist(A_ScriptDir . "\SQLiteDB.ini") {
4696IniRead, SQLiteDLL, %A_ScriptDir%\SQLiteDB.ini, Main, DllPath, %SQLiteDLL%
4697This.Base._SQLiteDLL := SQLiteDLL
4698}
4699If !(DLL := DllCall("LoadLibrary", "Str", This.Base._SQLiteDLL, "UPtr")) {
4700MsgBox, 16, SQLiteDB Error, % "DLL " . SQLiteDLL . " does not exist!"
4701ExitApp
4702}
4703This.Base.Version := StrGet(DllCall("SQlite3.dll\sqlite3_libversion", "Cdecl UPtr"), "UTF-8")
4704SQLVersion := StrSplit(This.Base.Version, ".")
4705MinVersion := StrSplit(This.Base._MinVersion, ".")
4706If (SQLVersion[1] < MinVersion[1]) || ((SQLVersion[1] = MinVersion[1]) && (SQLVersion[2] < MinVersion[2])){
4707DllCall("FreeLibrary", "Ptr", DLL)
4708MsgBox, 16, SQLite ERROR, % "Version " . This.Base.Version . " of SQLite3.dll is not supported!`n`n"
4709. "You can download the current version from www.sqlite.org!"
4710ExitApp
4711}
4712}
4713This.Base._RefCount += 1
4714}
4715__Delete() {
4716If (This._Handle)
4717This.CloseDB()
4718This.Base._RefCount -= 1
4719If (This.Base._RefCount = 0) {
4720If (DLL := DllCall("GetModuleHandle", "Str", This.Base._SQLiteDLL, "UPtr"))
4721DllCall("FreeLibrary", "Ptr", DLL)
4722}
4723}
4724_StrToUTF8(Str, ByRef UTF8) {
4725VarSetCapacity(UTF8, StrPut(Str, "UTF-8"), 0)
4726StrPut(Str, &UTF8, "UTF-8")
4727Return &UTF8
4728}
4729_UTF8ToStr(UTF8) {
4730Return StrGet(UTF8, "UTF-8")
4731}
4732_ErrMsg() {
4733If (RC := DllCall("SQLite3.dll\sqlite3_errmsg", "Ptr", This._Handle, "Cdecl UPtr"))
4734Return StrGet(&RC, "UTF-8")
4735Return ""
4736}
4737_ErrCode() {
4738Return DllCall("SQLite3.dll\sqlite3_errcode", "Ptr", This._Handle, "Cdecl Int")
4739}
4740_Changes() {
4741Return DllCall("SQLite3.dll\sqlite3_changes", "Ptr", This._Handle, "Cdecl Int")
4742}
4743_ReturnCode(RC) {
4744Static RCODE := {SQLITE_OK: 0
4745, SQLITE_ERROR: 1
4746, SQLITE_INTERNAL: 2
4747, SQLITE_PERM: 3
4748, SQLITE_ABORT: 4
4749, SQLITE_BUSY: 5
4750, SQLITE_LOCKED: 6
4751, SQLITE_NOMEM: 7
4752, SQLITE_READONLY: 8
4753, SQLITE_INTERRUPT: 9
4754, SQLITE_IOERR: 10
4755, SQLITE_CORRUPT: 11
4756, SQLITE_NOTFOUND: 12
4757, SQLITE_FULL: 13
4758, SQLITE_CANTOPEN: 14
4759, SQLITE_PROTOCOL: 15
4760, SQLITE_EMPTY: 16
4761, SQLITE_SCHEMA: 17
4762, SQLITE_TOOBIG: 18
4763, SQLITE_CONSTRAINT: 19
4764, SQLITE_MISMATCH: 20
4765, SQLITE_MISUSE: 21
4766, SQLITE_NOLFS: 22
4767, SQLITE_AUTH: 23
4768, SQLITE_FORMAT: 24
4769, SQLITE_RANGE: 25
4770, SQLITE_NOTADB: 26
4771, SQLITE_ROW: 100
4772, SQLITE_DONE: 101}
4773Return RCODE.HasKey(RC) ? RCODE[RC] : ""
4774}
4775ErrorMsg := ""
4776ErrorCode := 0
4777Changes := 0
4778SQL := ""
4779OpenDB(DBPath, Access := "W", Create := True) {
4780Static SQLITE_OPEN_READONLY := 0x01
4781Static SQLITE_OPEN_READWRITE := 0x02
4782Static SQLITE_OPEN_CREATE := 0x04
4783Static MEMDB := ":memory:"
4784This.ErrorMsg := ""
4785This.ErrorCode := 0
4786HDB := 0
4787If (DBPath = "")
4788DBPath := MEMDB
4789If (DBPath = This._Path) && (This._Handle)
4790Return True
4791If (This._Handle) {
4792This.ErrorMsg := "You must first close DB " . This._Path . "!"
4793Return False
4794}
4795Flags := 0
4796Access := SubStr(Access, 1, 1)
4797If (Access <> "W") && (Access <> "R")
4798Access := "R"
4799Flags := SQLITE_OPEN_READONLY
4800If (Access = "W") {
4801Flags := SQLITE_OPEN_READWRITE
4802If (Create)
4803Flags |= SQLITE_OPEN_CREATE
4804}
4805This._Path := DBPath
4806This._StrToUTF8(DBPath, UTF8)
4807RC := DllCall("SQlite3.dll\sqlite3_open_v2", "Ptr", &UTF8, "PtrP", HDB, "Int", Flags, "Ptr", 0, "Cdecl Int")
4808If (ErrorLevel) {
4809This._Path := ""
4810This.ErrorMsg := "DLLCall sqlite3_open_v2 failed!"
4811This.ErrorCode := ErrorLevel
4812Return False
4813}
4814If (RC) {
4815This._Path := ""
4816This.ErrorMsg := This._ErrMsg()
4817This.ErrorCode := RC
4818Return False
4819}
4820This._Handle := HDB
4821Return True
4822}
4823CloseDB() {
4824This.ErrorMsg := ""
4825This.ErrorCode := 0
4826This.SQL := ""
4827If !(This._Handle)
4828Return True
4829For Each, Query in This._Queries
4830DllCall("SQlite3.dll\sqlite3_finalize", "Ptr", Query, "Cdecl Int")
4831RC := DllCall("SQlite3.dll\sqlite3_close", "Ptr", This._Handle, "Cdecl Int")
4832If (ErrorLevel) {
4833This.ErrorMsg := "DLLCall sqlite3_close failed!"
4834This.ErrorCode := ErrorLevel
4835Return False
4836}
4837If (RC) {
4838This.ErrorMsg := This._ErrMsg()
4839This.ErrorCode := RC
4840Return False
4841}
4842This._Path := ""
4843This._Handle := ""
4844This._Queries := []
4845Return True
4846}
4847AttachDB(DBPath, DBAlias) {
4848Return This.Exec("ATTACH DATABASE '" . DBPath . "' As " . DBAlias . ";")
4849}
4850DetachDB(DBAlias) {
4851Return This.Exec("DETACH DATABASE " . DBAlias . ";")
4852}
4853Exec(SQL, Callback := "") {
4854This.ErrorMsg := ""
4855This.ErrorCode := 0
4856This.SQL := SQL
4857If !(This._Handle) {
4858This.ErrorMsg := "Invalid dadabase handle!"
4859Return False
4860}
4861CBPtr := 0
4862Err := 0
4863If (FO := Func(Callback)) && (FO.MinParams = 4)
4864CBPtr := RegisterCallback(Callback, "F C", 4, &SQL)
4865This._StrToUTF8(SQL, UTF8)
4866RC := DllCall("SQlite3.dll\sqlite3_exec", "Ptr", This._Handle, "Ptr", &UTF8, "Int", CBPtr, "Ptr", Object(This)
4867, "PtrP", Err, "Cdecl Int")
4868CallError := ErrorLevel
4869If (CBPtr)
4870DllCall("Kernel32.dll\GlobalFree", "Ptr", CBPtr)
4871If (CallError) {
4872This.ErrorMsg := "DLLCall sqlite3_exec failed!"
4873This.ErrorCode := CallError
4874Return False
4875}
4876If (RC) {
4877This.ErrorMsg := StrGet(Err, "UTF-8")
4878This.ErrorCode := RC
4879DllCall("SQLite3.dll\sqlite3_free", "Ptr", Err, "Cdecl")
4880Return False
4881}
4882This.Changes := This._Changes()
4883Return True
4884}
4885GetTable(SQL, ByRef TB, MaxResult := 0) {
4886TB := ""
4887This.ErrorMsg := ""
4888This.ErrorCode := 0
4889This.SQL := SQL
4890If !(This._Handle) {
4891This.ErrorMsg := "Invalid dadabase handle!"
4892Return False
4893}
4894If !RegExMatch(SQL, "i)^\s*(SELECT|PRAGMA)\s") {
4895This.ErrorMsg := "Method " . A_ThisFunc . " requires a query statement!"
4896Return False
4897}
4898Names := ""
4899Err := 0, RC := 0, GetRows := 0
4900I := 0, Rows := Cols := 0
4901Table := 0
4902If MaxResult Is Not Integer
4903MaxResult := 0
4904If (MaxResult < -2)
4905MaxResult := 0
4906This._StrToUTF8(SQL, UTF8)
4907RC := DllCall("SQlite3.dll\sqlite3_get_table", "Ptr", This._Handle, "Ptr", &UTF8, "PtrP", Table
4908, "IntP", Rows, "IntP", Cols, "PtrP", Err, "Cdecl Int")
4909If (ErrorLevel) {
4910This.ErrorMsg := "DLLCall sqlite3_get_table failed!"
4911This.ErrorCode := ErrorLevel
4912Return False
4913}
4914If (RC) {
4915This.ErrorMsg := StrGet(Err, "UTF-8")
4916This.ErrorCode := RC
4917DllCall("SQLite3.dll\sqlite3_free", "Ptr", Err, "Cdecl")
4918Return False
4919}
4920TB := new This._Table
4921TB.ColumnCount := Cols
4922TB.RowCount := Rows
4923If (MaxResult = -1) {
4924DllCall("SQLite3.dll\sqlite3_free_table", "Ptr", Table, "Cdecl")
4925If (ErrorLevel) {
4926This.ErrorMsg := "DLLCall sqlite3_free_table failed!"
4927This.ErrorCode := ErrorLevel
4928Return False
4929}
4930Return True
4931}
4932If (MaxResult = -2)
4933GetRows := 0
4934Else If (MaxResult > 0) && (MaxResult <= Rows)
4935GetRows := MaxResult
4936Else
4937GetRows := Rows
4938Offset := 0
4939Names := Array()
4940Loop, %Cols% {
4941Names[A_Index] := StrGet(NumGet(Table+0, Offset, "UPtr"), "UTF-8")
4942Offset += A_PtrSize
4943}
4944TB.ColumnNames := Names
4945TB.HasNames := True
4946Loop, %GetRows% {
4947I := A_Index
4948TB.Rows[I] := []
4949Loop, %Cols% {
4950TB.Rows[I][A_Index] := StrGet(NumGet(Table+0, Offset, "UPtr"), "UTF-8")
4951Offset += A_PtrSize
4952}
4953}
4954If (GetRows)
4955TB.HasRows := True
4956DllCall("SQLite3.dll\sqlite3_free_table", "Ptr", Table, "Cdecl")
4957If (ErrorLevel) {
4958TB := ""
4959This.ErrorMsg := "DLLCall sqlite3_free_table failed!"
4960This.ErrorCode := ErrorLevel
4961Return False
4962}
4963Return True
4964}
4965Query(SQL, ByRef RS) {
4966RS := ""
4967This.ErrorMsg := ""
4968This.ErrorCode := 0
4969This.SQL := SQL
4970ColumnCount := 0
4971HasRows := False
4972If !(This._Handle) {
4973This.ErrorMsg := "Invalid dadabase handle!"
4974Return False
4975}
4976If !RegExMatch(SQL, "i)^\s*(SELECT|PRAGMA)\s|") {
4977This.ErrorMsg := "Method " . A_ThisFunc . " requires a query statement!"
4978Return False
4979}
4980Query := 0
4981This._StrToUTF8(SQL, UTF8)
4982RC := DllCall("SQlite3.dll\sqlite3_prepare_v2", "Ptr", This._Handle, "Ptr", &UTF8, "Int", -1
4983, "PtrP", Query, "Ptr", 0, "Cdecl Int")
4984If (ErrorLeveL) {
4985This.ErrorMsg := "DLLCall sqlite3_prepare_v2 failed!"
4986This.ErrorCode := ErrorLevel
4987Return False
4988}
4989If (RC) {
4990This.ErrorMsg := This._ErrMsg()
4991This.ErrorCode := RC
4992Return False
4993}
4994RC := DllCall("SQlite3.dll\sqlite3_column_count", "Ptr", Query, "Cdecl Int")
4995If (ErrorLevel) {
4996This.ErrorMsg := "DLLCall sqlite3_column_count failed!"
4997This.ErrorCode := ErrorLevel
4998Return False
4999}
5000If (RC < 1) {
5001This.ErrorMsg := "Query result is empty!"
5002This.ErrorCode := This._ReturnCode("SQLITE_EMPTY")
5003Return False
5004}
5005ColumnCount := RC
5006Names := []
5007Loop, %RC% {
5008StrPtr := DllCall("SQlite3.dll\sqlite3_column_name", "Ptr", Query, "Int", A_Index - 1, "Cdecl UPtr")
5009If (ErrorLevel) {
5010This.ErrorMsg := "DLLCall sqlite3_column_name failed!"
5011This.ErrorCode := ErrorLevel
5012Return False
5013}
5014Names[A_Index] := StrGet(StrPtr, "UTF-8")
5015}
5016RC := DllCall("SQlite3.dll\sqlite3_step", "Ptr", Query, "Cdecl Int")
5017If (ErrorLevel) {
5018This.ErrorMsg := "DLLCall sqlite3_step failed!"
5019This.ErrorCode := ErrorLevel
5020Return False
5021}
5022If (RC = This._ReturnCode("SQLITE_ROW"))
5023HasRows := True
5024RC := DllCall("SQlite3.dll\sqlite3_reset", "Ptr", Query, "Cdecl Int")
5025If (ErrorLevel) {
5026This.ErrorMsg := "DLLCall sqlite3_reset failed!"
5027This.ErrorCode := ErrorLevel
5028Return False
5029}
5030RS := new This._RecordSet
5031RS.ColumnCount := ColumnCount
5032RS.ColumnNames := Names
5033RS.HasNames := True
5034RS.HasRows := HasRows
5035RS._Handle := Query
5036RS._DB := This
5037This._Queries[Query] := Query
5038Return True
5039}
5040LastInsertRowID(ByRef RowID) {
5041This.ErrorMsg := ""
5042This.ErrorCode := 0
5043This.SQL := ""
5044If !(This._Handle) {
5045This.ErrorMsg := "Invalid dadabase handle!"
5046Return False
5047}
5048RowID := 0
5049RC := DllCall("SQLite3.dll\sqlite3_last_insert_rowid", "Ptr", This._Handle, "Cdecl Int64")
5050If (ErrorLevel) {
5051This.ErrorMsg := "DLLCall sqlite3_last_insert_rowid failed!"
5052This.ErrorCode := ErrorLevel
5053Return False
5054}
5055RowID := RC
5056Return True
5057}
5058TotalChanges(ByRef Rows) {
5059This.ErrorMsg := ""
5060This.ErrorCode := 0
5061This.SQL := ""
5062If !(This._Handle) {
5063This.ErrorMsg := "Invalid dadabase handle!"
5064Return False
5065}
5066Rows := 0
5067RC := DllCall("SQLite3.dll\sqlite3_total_changes", "Ptr", This._Handle, "Cdecl Int")
5068If (ErrorLevel) {
5069This.ErrorMsg := "DLLCall sqlite3_total_changes failed!"
5070This.ErrorCode := ErrorLevel
5071Return False
5072}
5073Rows := RC
5074Return True
5075}
5076SetTimeout(Timeout := 1000) {
5077This.ErrorMsg := ""
5078This.ErrorCode := 0
5079This.SQL := ""
5080If !(This._Handle) {
5081This.ErrorMsg := "Invalid dadabase handle!"
5082Return False
5083}
5084If Timeout Is Not Integer
5085Timeout := 1000
5086RC := DllCall("SQLite3.dll\sqlite3_busy_timeout", "Ptr", This._Handle, "Cdecl Int")
5087If (ErrorLevel) {
5088This.ErrorMsg := "DLLCall sqlite3_busy_timeout failed!"
5089This.ErrorCode := ErrorLevel
5090Return False
5091}
5092If (RC) {
5093This.ErrorMsg := This._ErrMsg()
5094This.ErrorCode := RC
5095Return False
5096}
5097Return True
5098}
5099EscapeStr(ByRef Str, Quote := True) {
5100This.ErrorMsg := ""
5101This.ErrorCode := 0
5102This.SQL := ""
5103If !(This._Handle) {
5104This.ErrorMsg := "Invalid dadabase handle!"
5105Return False
5106}
5107If Str Is Number
5108Return True
5109OP := Quote ? "%Q" : "%q"
5110This._StrToUTF8(Str, UTF8)
5111Ptr := DllCall("SQLite3.dll\sqlite3_mprintf", "Ptr", &OP, "Ptr", &UTF8, "Cdecl UPtr")
5112If (ErrorLevel) {
5113This.ErrorMsg := "DLLCall sqlite3_mprintf failed!"
5114This.ErrorCode := ErrorLevel
5115Return False
5116}
5117Str := This._UTF8ToStr(Ptr)
5118DllCall("SQLite3.dll\sqlite3_free", "Ptr", Ptr, "Cdecl")
5119Return True
5120}
5121StoreBLOB(SQL, BlobArray) {
5122Static SQLITE_STATIC := 0
5123Static SQLITE_TRANSIENT := -1
5124This.ErrorMsg := ""
5125This.ErrorCode := 0
5126If !(This._Handle) {
5127This.ErrorMsg := "Invalid dadabase handle!"
5128Return False
5129}
5130If !RegExMatch(SQL, "i)^\s*(INSERT|UPDATE|REPLACE)\s") {
5131This.ErrorMsg := A_ThisFunc . " requires an INSERT/UPDATE/REPLACE statement!"
5132Return False
5133}
5134Query := 0
5135This._StrToUTF8(SQL, UTF8)
5136RC := DllCall("SQlite3.dll\sqlite3_prepare_v2", "Ptr", This._Handle, "Ptr", &UTF8, "Int", -1
5137, "PtrP", Query, "Ptr", 0, "Cdecl Int")
5138If (ErrorLeveL) {
5139This.ErrorMsg := A_ThisFunc . ": DLLCall sqlite3_prepare_v2 failed!"
5140This.ErrorCode := ErrorLevel
5141Return False
5142}
5143If (RC) {
5144This.ErrorMsg := A_ThisFunc . ": " . This._ErrMsg()
5145This.ErrorCode := RC
5146Return False
5147}
5148For BlobNum, Blob In BlobArray {
5149If !(Blob.Addr) || !(Blob.Size) {
5150This.ErrorMsg := A_ThisFunc . ": Invalid parameter BlobArray!"
5151This.ErrorCode := ErrorLevel
5152Return False
5153}
5154RC := DllCall("SQlite3.dll\sqlite3_bind_blob", "Ptr", Query, "Int", BlobNum, "Ptr", Blob.Addr
5155, "Int", Blob.Size, "Ptr", SQLITE_STATIC, "Cdecl Int")
5156If (ErrorLeveL) {
5157This.ErrorMsg := A_ThisFunc . ": DLLCall sqlite3_prepare_v2 failed!"
5158This.ErrorCode := ErrorLevel
5159Return False
5160}
5161If (RC) {
5162This.ErrorMsg := A_ThisFunc . ": " . This._ErrMsg()
5163This.ErrorCode := RC
5164Return False
5165}
5166}
5167RC := DllCall("SQlite3.dll\sqlite3_step", "Ptr", Query, "Cdecl Int")
5168If (ErrorLevel) {
5169This.ErrorMsg := A_ThisFunc . ": DLLCall sqlite3_step failed!"
5170This.ErrorCode := ErrorLevel
5171Return False
5172}
5173If (RC) && (RC <> This._ReturnCode("SQLITE_DONE")) {
5174This.ErrorMsg := A_ThisFunc . ": " . This._ErrMsg()
5175This.ErrorCode := RC
5176Return False
5177}
5178RC := DllCall("SQlite3.dll\sqlite3_finalize", "Ptr", Query, "Cdecl Int")
5179If (ErrorLevel) {
5180This.ErrorMsg := A_ThisFunc . ": DLLCall sqlite3_finalize failed!"
5181This.ErrorCode := ErrorLevel
5182Return False
5183}
5184If (RC) {
5185This.ErrorMsg := A_ThisFunc . ": " . This._ErrMsg()
5186This.ErrorCode := RC
5187Return False
5188}
5189Return True
5190}
5191}
5192SQLiteDB := new SQLiteDB
5193SQLiteDB.OpenDB(projectName . ".db")
5194if (!SQLiteDB.Exec("CREATE TABLE IF NOT EXISTS enemies (name VARCHAR(35), fraction TINYINT(2), updated INT(10), PRIMARY KEY (name));")) {
5195MsgBox, 16, SQLite Fehler, % "Es ist ein Fehler beim Erstellen der Gegner-Datenbank aufgetreten!`n`nFehlernachricht:`t" . SQLiteDB.ErrorMsg . "`nFehlercode:`t" . SQLiteDB.ErrorCode . "`n`nBitte melde dich bei Martin im Forum!"
5196SQLiteDB.CloseDB()
5197ExitApp
5198}
5199if (!SQLiteDB.Exec("CREATE TABLE IF NOT EXISTS friends (name VARCHAR(35), added INT(10), PRIMARY KEY (name));")) {
5200MsgBox, 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!"
5201SQLiteDB.CloseDB()
5202ExitApp
5203}
5204registeredHotkeys := Object()
5205defaultHotkeysArray := Object()
5206defaultHotkeysArray["motorSystem"] := "~m"
5207defaultHotkeysArray["jobexecute"] := "~j"
5208defaultHotkeysArray["stats"] := "~-"
5209defaultHotkeysArray["tempomat"] := "~."
5210defaultHotkeysArray["equipProfile1"] := "F1"
5211defaultHotkeysArray["equipProfile2"] := "F2"
5212defaultHotkeysArray["equipProfile3"] := "F3"
5213defaultHotkeysArray["robstore"] := "~r"
5214defaultHotkeysArray["stores"] := "~^r"
5215defaultHotkeysArray["repeat"] := "~ä"
5216defaultHotkeysArray["stopAutomaticSystems"] := "~<"
5217defaultHotkeysArray["pause"] := "!Pause"
5218IfNotExist, Hotkeys.ini
5219{
5220for key, value in defaultHotkeysArray {
5221IniWrite, %value%, Hotkeys.ini, Hotkeys, %key%
5222}
5223}
5224for key, value in defaultHotkeysArray {
5225IniRead, hk, Hotkeys.ini, Hotkeys, %key%, %A_Space%
5226if (!hk) {
5227alreadyRegistered := false
5228for k, v in registeredHotkeys {
5229hk2 := StrReplace(value, "~", "")
5230v2 := StrReplace(v, "~", "")
5231if (hk2 = v2 && StrLen(hk2) == StrLen(v2)) {
5232alreadyRegistered := true
5233alreadyRegisteredKey := k
5234alreadyRegisteredValue := v
5235break
5236}
5237}
5238if (!alreadyRegistered) {
5239Hotkey, %value%, %key%Label
5240StringReplace, %key%NoMods, value, ~
5241registeredHotkeys[key] := value
5242} else {
5243FileAppend, [%time%] Der Standard-Hotkey für %key% (%value%) ist bereits registriert (%alreadyRegisteredKey% - %alreadyRegisteredValue%)!`n, log.txt
5244}
5245} else if (hk != "---") {
5246alreadyRegistered := false
5247for k, v in registeredHotkeys {
5248hk2 := StrReplace(hk, "~", "")
5249v2 := StrReplace(v, "~", "")
5250if (hk2 = v2 && StrLen(hk2) == StrLen(v2)) {
5251alreadyRegistered := true
5252alreadyRegisteredKey := k
5253alreadyRegisteredValue := v
5254break
5255}
5256}
5257if (!alreadyRegistered) {
5258StringReplace, %key%NoMods, hk, ~
5259registeredHotkeys[key] := hk
5260} else {
5261FileAppend, [%time%] Der Hotkey für %key% (%hk%) ist bereits registriert (%alreadyRegisteredKey% - %alreadyRegisteredValue%)!`n, log.txt
5262}
5263}
5264}
5265global ownHotkeyCount := 48
5266IfNotExist, ownhotkeys.ini
5267{
5268defaultOwnHotkeysArray := []
5269defaultOwnHotkeysArray.InsertAt(1, ["~1", "[/usedrugs]"])
5270defaultOwnHotkeysArray.InsertAt(4, ["F3", "/buygun"])
5271defaultOwnHotkeysArray.InsertAt(5, ["F5", "/heal"])
5272defaultOwnHotkeysArray.InsertAt(6, ["~Y", "/lock"])
5273defaultOwnHotkeysArray.InsertAt(6, ["~j", "/carlock"])
5274defaultOwnHotkeysArray.InsertAt(13, ["~o", "/members"])
5275defaultOwnHotkeysArray.InsertAt(16, ["~P", "/g Ich befinde mich aktuell in [zone], [city] | HP: [hp]"])
5276defaultOwnHotkeysArray.InsertAt(17, ["~^P", "/crew Ich befinde mich aktuell in [zone], [city] | HP: [hp]"])
5277defaultOwnHotkeysArray.InsertAt(18, ["~NumpadAdd", "/g Ich benötige DRINGEND Verstärkung in [zone], [city] | HP: [hp] Rüstung: [armour]"])
5278defaultOwnHotkeysArray.InsertAt(29, ["~!NumpadAdd", "/g Ich benötige keine Verstärkung mehr!"])
5279for key, value in defaultOwnHotkeysArray {
5280hk := value[1]
5281text := value[2]
5282IniWrite, 1, ownhotkeys.ini, %key%, Active
5283IniWrite, %hk%, ownhotkeys.ini, %key%, Hotkey
5284IniWrite, %text%, ownhotkeys.ini, %key%, Text
5285}
5286}
5287Loop, %ownHotkeyCount% {
5288outerIndex := A_Index
5289IniRead, ownHotkey%outerIndex%Active, ownhotkeys.ini, %outerIndex%, Active, 0
5290IniRead, ownHotkey%outerIndex%Text, ownhotkeys.ini, %outerIndex%, Text, %A_Space%
5291IniRead, hk, ownhotkeys.ini, %outerIndex%, Hotkey, %A_Space%
5292ownHotkey%outerIndex%Text := StrReplace(ownHotkey%outerIndex%Text, "~", "`n")
5293if (hk) {
5294alreadyRegistered := false
5295for key, value in registeredHotkeys {
5296hk2 := StrReplace(hk, "~", "")
5297value2 := StrReplace(value, "~", "")
5298if (hk2 = value2 && StrLen(hk2) == StrLen(value2)) {
5299alreadyRegistered := true
5300alreadyRegisteredKey := key
5301alreadyRegisteredValue := value
5302break
5303}
5304}
5305StringReplace, ownHotkey%outerIndex%NoMods, hk, ~
5306if (!alreadyRegistered) {
5307if (ownHotkey%outerIndex%Active) {
5308Hotkey, %hk%, ownHotkey%outerIndex%Label
5309registeredHotkeys["ownHotkey" . outerIndex] := hk
5310}
5311} else {
5312FileAppend, [%time%] Der Hotkey für ownHotkey%outerIndex% (%hk%) ist bereits registriert (%alreadyRegisteredKey% - %alreadyRegisteredValue%)!`n, log.txt
5313}
5314}
5315}
5316IfNotExist, images
5317{
5318FileCreateDir, images
5319}
5320IfNotExist, images\Banner.jpg
5321{
5322URLDownloadToFile, http://imperator.square7.ch/Keybinder/Banner.jpg, Banner.jpg
5323FileMove, Banner.jpg, images\Banner.jpg
5324}
5325IfNotExist, bin
5326{
5327FileCreateDir, bin
5328}
5329IfNotExist, bin\overlay.dll
5330{
5331URLDownloadToFile, %baseURL%downloads/bin/overlay.dll, bin\overlay.dll
5332}
5333#NoEnv
5334API_ERROR_NONE := 0
5335API_ERROR_SNAPSHOT_FAILED := 1
5336API_ERROR_SAMP_NOT_FOUND := 2
5337API_ERROR_REMOTE_MEMORY_ALLOCATION_FAILED := 3
5338API_ERROR_WRITEPROCESSMEMORY_FAILED := 4
5339API_ERROR_GETPROCADDRESS_FAILED := 5
5340API_ERROR_REMOTETHREAD_FAILED := 6
5341API_ERROR_INVALID_GTA_HANDLE := 7
5342API_ERROR_PIPE_DOESNT_RESPOND := 8
5343API_ERROR_STRING_TOO_LONG := 9
5344PATH_API := RelToAbs(A_ScriptDir, "bin\overlay.dll")
5345dllModule := DllCall("LoadLibrary", Str, PATH_API)
5346if(dllModule == -1 || dllModule == 0)
5347{
5348MsgBox, 48, API - Fehler, Die overlay.dll konnte nicht gefunden werden.`nDer Keybinder wird nun beendet.
5349ExitApp
5350}
5351
5352Init_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_Init")
5353SetParam_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_SetParam")
5354ReadMemory_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ReadMemory")
5355WriteMemory_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_WriteMemory")
5356GetBasePointer_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_GetBasePointer")
5357GetCommandLine_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_GetCommandLine")
5358GetLastError_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_GetLastError")
5359SetLastError_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_SetLastError")
5360TextCreate_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextCreate")
5361TextDestroy_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextDestroy")
5362TextSetShadow_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetShadow")
5363TextSetShown_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetShown")
5364TextSetColor_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetColor")
5365TextSetPos_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetPos")
5366TextSetString_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextSetString")
5367TextUpdate_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_TextUpdate")
5368BoxCreate_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxCreate")
5369BoxDestroy_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxDestroy")
5370BoxSetShown_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetShown")
5371BoxSetBorder_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetBorder")
5372BoxSetBorderColor_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetBorderColor")
5373BoxSetColor_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetColor")
5374BoxSetHeight_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetHeight")
5375BoxSetPos_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetPos")
5376BoxSetWidth_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_BoxSetWidth")
5377LineCreate_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineCreate")
5378LineDestroy_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineDestroy")
5379LineSetShown_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetShown")
5380LineSetColor_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetColor")
5381LineSetWidth_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetWidth")
5382LineSetPos_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_LineSetPos")
5383ImageCreate_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageCreate")
5384ImageDestroy_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageDestroy")
5385ImageSetShown_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetShown")
5386ImageSetAlign_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetAlign")
5387ImageSetPos_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetPos")
5388ImageSetRotation_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ImageSetRotation")
5389DestroyAllVisual_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_DestroyAllVisual")
5390ShowAllVisual_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_ShowAllVisual")
5391HideAllVisual_func := DllCall("GetProcAddress", UInt, dllModule, Str, "API_HideAllVisual")
5392Init()
5393{
5394global Init_func
5395res := DllCall(Init_func)
5396return res
5397}
5398SetParam(str_Name, str_Value)
5399{
5400global SetParam_func
5401res := DllCall(SetParam_func, Str, str_Name, Str, str_Value)
5402return res
5403}
5404ReadMemory(addr, size, ByRef data)
5405{
5406global ReadMemory_func
5407VarSetCapacity(data,size)
5408res := DllCall(ReadMemory_func, UInt, addr, UInt, size, StrP, data)
5409return res
5410}
5411GetBasePointer(dll)
5412{
5413global GetBasePointer_func
5414res :=DllCall(GetBasePointer_func, Str, dll)
5415return res
5416}
5417GetCommandLine(ByRef line)
5418{
5419global GetCommandLine_func
5420VarSetCapacity(line,512,0)
5421res := DllCall(GetCommandLine_func, StrP, line)
5422return res
5423}
5424GetLastError()
5425{
5426global GetLastError_func
5427res:=DllCall(GetLastError_func)
5428return res
5429}
5430SetLastError(error)
5431{
5432global SetLastError_func
5433res := DllCall(SetLastError_func, Int, error)
5434return res
5435}
5436TextCreate(Font, fontsize, bold, italic, x, y, color, text, shadow, show)
5437{
5438global TextCreate_func
5439res := DllCall(TextCreate_func,Str,Font,Int,fontsize,UChar,bold,UChar,italic,Int,x,Int,y,UInt,color,Str,text,UChar,shadow,UChar,show)
5440return res
5441}
5442TextDestroy(id)
5443{
5444global TextDestroy_func
5445res := DllCall(TextDestroy_func,Int,id)
5446return res
5447}
5448TextSetShadow(id, shadow)
5449{
5450global TextSetShadow_func
5451res := DllCall(TextSetShadow_func,Int,id,UChar,shadow)
5452return res
5453}
5454TextSetShown(id, show)
5455{
5456global TextSetShown_func
5457res := DllCall(TextSetShown_func,Int,id,UChar,show)
5458return res
5459}
5460TextSetColor(id,color)
5461{
5462global TextSetColor_func
5463res := DllCall(TextSetColor_func,Int,id,UInt,color)
5464return res
5465}
5466TextSetPos(id,x,y)
5467{
5468global TextSetPos_func
5469res := DllCall(TextSetPos_func,Int,id,Int,x,Int,y)
5470return res
5471}
5472TextSetString(id,Text)
5473{
5474global TextSetString_func
5475res := DllCall(TextSetString_func,Int,id,Str,Text)
5476return res
5477}
5478TextUpdate(id,Font,Fontsize,bold,italic)
5479{
5480global TextUpdate_func
5481res := DllCall(TextUpdate_func,Int,id,Str,Font,int,Fontsize,UChar,bold,UChar,italic)
5482return res
5483}
5484BoxCreate(x,y,width,height,Color,show)
5485{
5486global BoxCreate_func
5487res := DllCall(BoxCreate_func,Int,x,Int,y,Int,width,Int,height,UInt,Color,UChar,show)
5488return res
5489}
5490BoxDestroy(id)
5491{
5492global BoxDestroy_func
5493res := DllCall(BoxDestroy_func,Int,id)
5494return res
5495}
5496BoxSetShown(id,Show)
5497{
5498global BoxSetShown_func
5499res := DllCall(BoxSetShown_func,Int,id,UChar,Show)
5500return res
5501}
5502BoxSetBorder(id,height,Show)
5503{
5504global BoxSetBorder_func
5505res := DllCall(BoxSetBorder_func,Int,id,Int,height,Int,Show)
5506return res
5507}
5508BoxSetBorderColor(id,Color)
5509{
5510global BoxSetBorderColor_func
5511res := DllCall(BoxSetBorderColor_func,Int,id,UInt,Color)
5512return res
5513}
5514BoxSetColor(id,Color)
5515{
5516global BoxSetColor_func
5517res := DllCall(BoxSetColor_func,Int,id,UInt,Color)
5518return res
5519}
5520BoxSetHeight(id,height)
5521{
5522global BoxSetHeight_func
5523res := DllCall(BoxSetHeight_func,Int,id,Int,height)
5524return res
5525}
5526BoxSetPos(id,x,y)
5527{
5528global BoxSetPos_func
5529res := DllCall(BoxSetPos_func,Int,id,Int,x,Int,y)
5530return res
5531}
5532BoxSetWidth(id,width)
5533{
5534global BoxSetWidth_func
5535res := DllCall(BoxSetWidth_func,Int,id,Int,width)
5536return res
5537}
5538LineCreate(x1,y1,x2,y2,width,color,show)
5539{
5540global LineCreate_func
5541res := DllCall(LineCreate_func,Int,x1,Int,y1,Int,x2,Int,y2,Int,Width,UInt,color,UChar,show)
5542return res
5543}
5544LineDestroy(id)
5545{
5546global LineDestroy_func
5547res := DllCall(LineDestroy_func,Int,id)
5548return res
5549}
5550LineSetShown(id,show)
5551{
5552global LineSetShown_func
5553res := DllCall(LineSetShown_func,Int,id,UChar,show)
5554return res
5555}
5556LineSetColor(id,color)
5557{
5558global LineSetColor_func
5559res := DllCall(LineSetColor_func,Int,id,UInt,color)
5560return res
5561}
5562LineSetWidth(id, width)
5563{
5564global LineSetWidth_func
5565res := DllCall(LineSetWidth_func,Int,id,Int,width)
5566return res
5567}
5568LineSetPos(id,x1,y1,x2,y2)
5569{
5570global LineSetPos_func
5571res := DllCall(LineSetPos_func,Int,id,Int,x1,Int,y1,Int,x2,Int,y2)
5572return res
5573}
5574ImageCreate(path, x, y, rotation, align, show)
5575{
5576global ImageCreate_func
5577res := DllCall(ImageCreate_func, Str, path, Int, x, Int, y, Int, rotation, Int, align, UChar, show)
5578return res
5579}
5580ImageDestroy(id)
5581{
5582global ImageDestroy_func
5583res := DllCall(ImageDestroy_func,Int,id)
5584return res
5585}
5586ImageSetShown(id,show)
5587{
5588global ImageSetShown_func
5589res := DllCall(ImageSetShown_func,Int,id,UChar,show)
5590return res
5591}
5592ImageSetAlign(id,align)
5593{
5594global ImageSetAlign_func
5595res := DllCall(ImageSetAlign_func,Int,id,Int,align)
5596return res
5597}
5598ImageSetPos(id, x, y)
5599{
5600global ImageSetPos_func
5601res := DllCall(ImageSetPos_func,Int,id,Int,x, Int, y)
5602return res
5603}
5604ImageSetRotation(id, rotation)
5605{
5606global ImageSetRotation_func
5607res := DllCall(ImageSetRotation_func,Int,id,Int, rotation)
5608return res
5609}
5610DestroyAllVisual()
5611{
5612global DestroyAllVisual_func
5613res := DllCall(DestroyAllVisual_func)
5614return res
5615}
5616ShowAllVisual()
5617{
5618global ShowAllVisual_func
5619res := DllCall(ShowAllVisual_func)
5620return res
5621}
5622HideAllVisual()
5623{
5624global HideAllVisual_func
5625res := DllCall(HideAllVisual_func )
5626return res
5627}
5628DecimalToHex(Var){
5629SetFormat, IntegerFast, hex
5630Dec2Hex += Var
5631Dec2Hex .= ""
5632SetFormat, IntegerFast, d
5633StringTrimLeft, Dec2Hex, Dec2Hex, 2
5634StringUpper, Dec2Hex, Dec2Hex
5635sDec2Hex .= Dec2Hex
5636return sDec2Hex
5637}
5638RelToAbs(root, dir, s = "\") {
5639pr := SubStr(root, 1, len := InStr(root, s, "", InStr(root, s . s) + 2) - 1)
5640, root := SubStr(root, len + 1), sk := 0
5641If InStr(root, s, "", 0) = StrLen(root)
5642StringTrimRight, root, root, 1
5643If InStr(dir, s, "", 0) = StrLen(dir)
5644StringTrimRight, dir, dir, 1
5645Loop, Parse, dir, %s%
5646{
5647If A_LoopField = ..
5648StringLeft, root, root, InStr(root, s, "", 0) - 1
5649Else If A_LoopField =
5650root =
5651Else If A_LoopField != .
5652Continue
5653StringReplace, dir, dir, %A_LoopField%%s%
5654}
5655Return, pr . root . s . dir
5656}
5657SetParam("use_window", "1")
5658SetParam("window", "GTA:SA:MP")
5659IniRead, lockSystem, settings.ini, Einstellungen, Locksystem, 1
5660IniRead, motorSystem, settings.ini, Einstellungen, Motorsystem, 1
5661IniRead, chatlogSaver, settings.ini, Einstellungen, Chatlog, 1
5662IniRead, admin, settings.ini, Einstellungen, Admin, 0
5663IniRead, primaryColor, settings.ini, Einstellungen, Primärfarbe, %A_Space%
5664IniRead, secondaryColor, settings.ini, Einstellungen, Sekundärfarbe, %A_Space%
5665IniRead, antispamSystem, settings.ini, Einstellungen, Antispamsystem, 1
5666IniRead, ownPrefix, settings.ini, Einstellungen, OwnPrefix, %A_Space%
5667IniRead, killCounter, settings.ini, Einstellungen, Killzähler, 1
5668IniRead, killMessageLocal, settings.ini, Einstellungen, KillspruchLokal, 0
5669IniRead, killMessageActive, settings.ini, Einstellungen, KillspruchAktiv, 1
5670IniRead, killMessage, settings.ini, Einstellungen, Killspruch, /g +1 Kill in [zone], [city] | [kills]
5671IniRead, deathCounter, settings.ini, Einstellungen, Todeszähler, 1
5672IniRead, deathMessageLocal, settings.ini, Einstellungen, TodesspruchLokal, 0
5673IniRead, deathMessageActive, settings.ini, Einstellungen, TodesspruchAktiv, 1
5674IniRead, deathMessage, settings.ini, Einstellungen, Todesspruch, /g +1 Tod in [zone], [city] | [deaths]
5675IniRead, friendMessages, settings.ini, Einstellungen, FreundeNachrichten, 1
5676IniRead, laufscriptState, settings.ini, Laufscript, Status
5677if (alternativePlayerInput == "") {
5678alternativePlayerInput := false
5679IniWrite, %alternativePlayerInput%, settings.ini, Einstellungen, AltPlayerInput
5680}
5681IniRead, debug, settings.ini, Einstellungen, Debug, %A_Space%
5682if (debug == "") {
5683debug := false
5684IniWrite, %debug%, settings.ini, Einstellungen, Debug
5685}
5686Loop, 3 {
5687profileID := A_Index
5688Loop, 6 {
5689IniRead, profile%profileID%_%A_Index%, settings.ini, Ausrüstungsprofile, Profil%profileID%_%A_Index%, %A_Space%
5690}
5691}
5692primaryColor := StrReplace(primaryColor, "{", "")
5693primaryColor := StrReplace(primaryColor, "}", "")
5694secondaryColor := StrReplace(secondaryColor, "{", "")
5695secondaryColor := StrReplace(secondaryColor, "}", "")
5696if (primaryColor == "") {
5697primaryColor := "000C64"
5698}
5699if (secondaryColor == "") {
5700secondaryColor := "FFC000"
5701}
5702global PRIMCOL := "{" . primaryColor . "}"
5703global SECCOL := "{" . secondaryColor . "}"
5704global PREFIX := PRIMCOL . "[" . SECCOL . projectName . PRIMCOL . "] {FFFFFF}"
5705if (ownPrefix != "") {
5706PREFIX := ownPrefix . " "
5707}
5708
5709IniRead, Wanteds, Stats.ini, Statistiken, Wanteds, 0
5710IniRead, Verbrechen, Stats.ini, Statistiken, Verbrechen, 0
5711
5712global tv := false
5713global tvName := ""
5714global afk := false
5715global oldHour := -1
5716global fishTime := 0
5717global timeout := true
5718global pbKillStreak := 0
5719global paydayMoney := 0
5720global pedStates := {}
5721global tempo := 80
5722global tempomat := false
5723global currentSpeed := 0
5724global currentFish := 1
5725global fishTraps := []
5726global fishingFull := false
5727global drugStatus := false
5728global drugTime := 0
5729global drugGrowTime := -1
5730global stores := []
5731global allStores := []
5732global updated := false
5733global showNamechanges := false
5734global showFriendLabels := true
5735global onlinePlayers := []
5736global onlineFriends := []
5737global onlineEnemies := []
5738global firstFriendsTimerRun := true
5739global firstEnemiesTimerRun := true
5740global gasstations := []
5741global countdownRunning := false
5742global autoFindRunning := false
5743global autoShowRunning := false
5744global autoFindChatRunning := false
5745global 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 (.+)\))?)?"
5746kmin := 0
5747ksek := 0
5748kstra := 0
5749ktest := 0
5750SetTimer, Whitelist, 1000
5751SetTimer, ChatTimer, 100
5752SetTimer, TankTimer, 100
5753SetTimer, FillCustoms, 500
5754SetTimer, ChatlogSaveTimer, 500
5755SetTimer, KillTimer, 100
5756SetTimer, SearchEnemyTimer, 2500
5757SetTimer, FriendsTimer, 1000
5758Gui, Color, white
5759Gui, Font, S10 CDefault, Verdana
5760;Gui, Add, Picture, x10 y10 w600 h200, images\Banner.jpg
5761Gui, Add, Picture, x12 y10 w600 h200, images\Banner.jpg
5762Gui, Add, Picture, x12 y10 w600 h200 , images\Banner.jpg
5763
5764Gui, Add, Button, x320 y230 w140 h40 gSettingsGUI, Einstellungen
5765Gui, Add, Button, x470 y230 w140 h40 gHotkeysGUI, Hotkeys
5766Gui, Add, Button, x320 y280 w140 h40 gHelpGUI, Hilfe
5767Gui, Add, Button, x470 y280 w140 h40 gNewsGUI, News
5768Gui, Add, Button, x470 y330 w140 h40 gRPGConnect, GCT Connect
5769Gui, Add, Button, x470 y450 w140 h40 gGuiClose, Schließen
5770Gui, Add, Groupbox, x10 y220 w300 h270, Neuigkeiten (Version %version%)
5771msg := URLDownloadToVar("http://imperator.square7.ch/Keybinder/updatelog.txt")
5772StringReplace, update, msg, ', `r`n, All
5773Gui, Add, Edit, x20 y240 w280 h240 ReadOnly, %update%
5774Gui, Add, Groupbox, x320 y445 w140 h45, Versionsinfo
5775Gui, Show, w620 h500, %projectName% - Version: %version%
5776}
5777return
5778GuiClose:
5779{
5780for playerName, textLabelID in onlinePlayers {
5781if (textLabelID != -1) {
5782deleteTextLabel(textLabelID)
5783}
5784}
5785SQLiteDB.CloseDB()
5786ExitApp
5787}
5788return
5789RPGConnect:
5790{
5791RegRead GTA_SA_EXE, HKEY_CURRENT_USER, Software\SAMP, gta_sa_exe
5792SplitPath, GTA_SA_EXE,, PFAD
5793run, %PFAD%\samp.exe server.german-crimetime.de:7777, %PFAD%
5794}
5795return
5796SettingsGUI:
5797{
5798Gui, Settings: Destroy
5799Gui, Settings: Color, white
5800Gui, Settings: Font, S10 CDefault, Verdana
5801Gui, Settings: Add, Button, x340 y695 w130 h40 gSettingsSave, Speichern
5802Gui, Settings: Add, Button, x480 y695 w130 h40 gSettingsGuiClose, Schließen
5803Gui, Settings: Add, GroupBox, x10 y10 w600 h170, Allgemeine Einstellungen
5804Gui, Settings: Add, CheckBox, x20 y30 w170 h20 vlockSystem Checked%lockSystem%, Locksystem
5805Gui, Settings: Add, CheckBox, x20 y120 w170 h20 vantispamSystem Checked%antispamSystem%, Spamschutz-System
5806Gui, Settings: Add, CheckBox, x190 y30 w200 h20 vmotorSystem Checked%motorSystem%, Motor aus beim Aussteigen
5807Gui, Settings: Add, CheckBox, x400 y30 w110 h20 vchatlogSaver Checked%chatlogSaver%, Chatlog-Save
5808Gui, Settings: Add, CheckBox, x530 y30 w70 h20 vadmin Checked%admin%, Admin
5809Gui, Settings: Add, Text, x400 y60 w110 h20, Primärfarbe
5810Gui, Settings: Add, Edit, x530 y60 w70 h20 vprimaryColor, %primaryColor%
5811Gui, Settings: Add, Text, x400 y90 w110 h20, Sekundärfarbe
5812Gui, Settings: Add, Edit, x530 y90 w70 h20 vsecondaryColor, %secondaryColor%
5813Gui, Settings: Add, Text, x400 y120 w110 h20, Eigener Prefix
5814Gui, Settings: Add, Edit, x530 y120 w70 h20 vownPrefix, %ownPrefix%
5815Gui, Settings: Add, GroupBox, x10 y190 w600 h140, Kill- und Todeszähler
5816Gui, Settings: Add, CheckBox, x20 y210 w150 h20 vkillCounter Checked%killCounter%, Killzähler aktiv
5817Gui, Settings: Add, CheckBox, x190 y210 w180 h20 vkillMessageLocal Checked%killMessageLocal%, Spruch nur lokal senden
5818Gui, Settings: Add, CheckBox, x20 y240 w120 h20 vkillMessageActive Checked%killMessageActive%, Killspruch:
5819Gui, Settings: Add, Edit, x140 y240 w460 h20 vkillMessage, %killMessage%
5820Gui, Settings: Add, CheckBox, x20 y270 w150 h20 vdeathCounter Checked%deathCounter%, Todeszähler aktiv
5821Gui, Settings: Add, CheckBox, x190 y270 w180 h20 vdeathMessageLocal Checked%deathMessageLocal%, Spruch nur lokal senden
5822Gui, Settings: Add, CheckBox, x20 y300 w120 h20 vdeathMessageActive Checked%deathMessageActive%, Todesspruch:
5823Gui, Settings: Add, Edit, x140 y300 w460 h20 vdeathMessage, %deathMessage%
5824Gui, Settings: Add, GroupBox, x10 y465 w600 h50, Sonstige Meldungen
5825Gui, Settings: Add, CheckBox, x370 y485 w230 h20 vfriendMessages checked%friendMessages%, Freunde-Nachrichten
5826Gui, Settings: Add, GroupBox, x10 y525 w600 h160, Ausrüstungsprofile
5827userFriendlyEquipProfile1 := getUserFriendlyHotkeyName(equipProfile1NoMods)
5828userFriendlyEquipProfile2 := getUserFriendlyHotkeyName(equipProfile2NoMods)
5829userFriendlyEquipProfile3 := getUserFriendlyHotkeyName(equipProfile3NoMods)
5830Gui, Settings: Add, Text, x20 y545 w580 h115, Hier kannst du dir drei Ausrüsten-Profile zusammenstellen und direkt Ingame abrufen.`nDie Profile können mit %userFriendlyEquipProfile1%, %userFriendlyEquipProfile2% und %userFriendlyEquipProfile3% ausgewählt werden.
5831Gui, Settings: Add, Text, x30 y590 w70 h20, Profil 1:
5832Gui, Settings: Add, DropDownList, x100 y590 w75 h120 vprofile1_1, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5833Gui, Settings: Add, DropDownList, x183 y590 w75 h120 vprofile1_2, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5834Gui, Settings: Add, DropDownList, x266 y590 w75 h120 vprofile1_3, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5835Gui, Settings: Add, DropDownList, x349 y590 w75 h120 vprofile1_4, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5836Gui, Settings: Add, DropDownList, x432 y590 w75 h120 vprofile1_5, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5837Gui, Settings: Add, DropDownList, x515 y590 w75 h120 vprofile1_6, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5838GuiControl, Settings: Choose, profile1_1, %profile1_1%
5839GuiControl, Settings: Choose, profile1_2, %profile1_2%
5840GuiControl, Settings: Choose, profile1_3, %profile1_3%
5841GuiControl, Settings: Choose, profile1_4, %profile1_4%
5842GuiControl, Settings: Choose, profile1_5, %profile1_5%
5843GuiControl, Settings: Choose, profile1_6, %profile1_6%
5844Gui, Settings: Add, Text, x30 y620 w70 h20 , Profil 2:
5845Gui, Settings: Add, DropDownList, x100 y620 w75 h120 vprofile2_1, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5846Gui, Settings: Add, DropDownList, x183 y620 w75 h120 vprofile2_2, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5847Gui, Settings: Add, DropDownList, x266 y620 w75 h120 vprofile2_3, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5848Gui, Settings: Add, DropDownList, x349 y620 w75 h120 vprofile2_4, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5849Gui, Settings: Add, DropDownList, x432 y620 w75 h120 vprofile2_5, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5850Gui, Settings: Add, DropDownList, x515 y620 w75 h120 vprofile2_6, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5851GuiControl, Settings: Choose, profile2_1, %profile2_1%
5852GuiControl, Settings: Choose, profile2_2, %profile2_2%
5853GuiControl, Settings: Choose, profile2_3, %profile2_3%
5854GuiControl, Settings: Choose, profile2_4, %profile2_4%
5855GuiControl, Settings: Choose, profile2_5, %profile2_5%
5856GuiControl, Settings: Choose, profile2_6, %profile2_6%
5857Gui, Settings: Add, Text, x30 y650 w70 h20 , Profil 3:
5858Gui, Settings: Add, DropDownList, x100 y650 w75 h120 vprofile3_1, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5859Gui, Settings: Add, DropDownList, x183 y650 w75 h120 vprofile3_2, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5860Gui, Settings: Add, DropDownList, x266 y650 w75 h120 vprofile3_3, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5861Gui, Settings: Add, DropDownList, x349 y650 w75 h120 vprofile3_4, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5862Gui, Settings: Add, DropDownList, x432 y650 w75 h120 vprofile3_5, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5863Gui, Settings: Add, DropDownList, x515 y650 w75 h120 vprofile3_6, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
5864GuiControl, Settings: Choose, profile3_1, %profile3_1%
5865GuiControl, Settings: Choose, profile3_2, %profile3_2%
5866GuiControl, Settings: Choose, profile3_3, %profile3_3%
5867GuiControl, Settings: Choose, profile3_4, %profile3_4%
5868GuiControl, Settings: Choose, profile3_5, %profile3_5%
5869GuiControl, Settings: Choose, profile3_6, %profile3_6%
5870Menu, SettingsInformations, Add, &Informationen, SettingsInformations
5871Gui, Settings: Menu, SettingsInformations
5872Gui, Settings: Show, h745 w620, %projectName% - Einstellungen - Version %version%
5873}
5874return
5875SettingsInformations:
5876{
5877MsgBox, 64, Informationen zu den Einstellungen,
5878(LTrim
5879Allgemeine Einstellungen:
5880
5881Locksystem - Fahrzeug beim Einsteigen abschließen
5882Motor aus beim Aussteigen - Motor beim Aussteigen abstellen
5883Chatlog-Save - Chatlog beim Beenden des Spiels speichern
5884Admin - Keine Delays - Achtung: Spamkick möglich!
5885Spamschutz-System - Chat blockieren, wenn du spammst
5886Primärfarbe - Hauptfarbe als Hex-Farbe - Standard: 2550A7
5887Sekundärfarbe - Nebenfarbe als Hex-Farbe - Standard: FF9900
5888Eigener Prefix - Dein eigener Prefix für den Keybinder - Standard (leer): {2550A7}|%projectName%|{FFFFFF}
5889
5890
5891Platzhalter für die Kill- und Todessprüche:
5892
5893[name] - Dein Name
5894[id] - Deine ID
5895[zone] - Deine Zone
5896[city] - Deine Stadt
5897[location] - Dein Autenthaltsort (Zone+Stadt)
5898[hp] - Deine HP
5899[armour] - Deine Armour
5900[kills] - Gesamte Kills
5901[daykills] - Tages-Kills
5902[deaths] - Gesamte Tode
5903[daydeaths] - Tages-Tode
5904[kd] - Gesamte K/D
5905[daykd] - Tages-K/D
5906)
5907}
5908return
5909SettingsSave:
5910{
5911Gui, Settings: Submit, NoHide
5912IniWrite, %lockSystem%, settings.ini, Einstellungen, Locksystem
5913IniWrite, %motorSystem%, settings.ini, Einstellungen, Motorsystem
5914IniWrite, %chatlogSaver%, settings.ini, Einstellungen, Chatlog
5915IniWrite, %admin%, settings.ini, Einstellungen, Admin
5916IniWrite, %primaryColor%, settings.ini, Einstellungen, Primärfarbe
5917IniWrite, %secondaryColor%, settings.ini, Einstellungen, Sekundärfarbe
5918IniWrite, %antispamSystem%, settings.ini, Einstellungen, Antispamsystem
5919IniWrite, %ownPrefix%, settings.ini, Einstellungen, OwnPrefix
5920if (ownPrefix != "") {
5921PREFIX := ownPrefix . " "
5922}
5923IniWrite, %killCounter%, settings.ini, Einstellungen, Killzähler
5924IniWrite, %killMessageLocal%, settings.ini, Einstellungen, KillspruchLokal
5925IniWrite, %killMessageActive%, settings.ini, Einstellungen, KillspruchAktiv
5926IniWrite, %killMessage%, settings.ini, Einstellungen, Killspruch
5927IniWrite, %deathCounter%, settings.ini, Einstellungen, Todeszähler
5928IniWrite, %deathMessageLocal%, settings.ini, Einstellungen, TodesspruchLokal
5929IniWrite, %deathMessageActive%, settings.ini, Einstellungen, TodesspruchAktiv
5930IniWrite, %deathMessage%, settings.ini, Einstellungen, Todesspruch
5931IniWrite, %friendMessages%, settings.ini, Einstellungen, FreundeNachrichten
5932IniWrite, %profile1_1%, settings.ini, Ausrüstungsprofile, Profil1_1
5933IniWrite, %profile1_2%, settings.ini, Ausrüstungsprofile, Profil1_2
5934IniWrite, %profile1_3%, settings.ini, Ausrüstungsprofile, Profil1_3
5935IniWrite, %profile1_4%, settings.ini, Ausrüstungsprofile, Profil1_4
5936IniWrite, %profile1_5%, settings.ini, Ausrüstungsprofile, Profil1_5
5937IniWrite, %profile1_6%, settings.ini, Ausrüstungsprofile, Profil1_6
5938IniWrite, %profile2_1%, settings.ini, Ausrüstungsprofile, Profil2_1
5939IniWrite, %profile2_2%, settings.ini, Ausrüstungsprofile, Profil2_2
5940IniWrite, %profile2_3%, settings.ini, Ausrüstungsprofile, Profil2_3
5941IniWrite, %profile2_4%, settings.ini, Ausrüstungsprofile, Profil2_4
5942IniWrite, %profile2_5%, settings.ini, Ausrüstungsprofile, Profil2_5
5943IniWrite, %profile2_6%, settings.ini, Ausrüstungsprofile, Profil2_6
5944IniWrite, %profile3_1%, settings.ini, Ausrüstungsprofile, Profil3_1
5945IniWrite, %profile3_2%, settings.ini, Ausrüstungsprofile, Profil3_2
5946IniWrite, %profile3_3%, settings.ini, Ausrüstungsprofile, Profil3_3
5947IniWrite, %profile3_4%, settings.ini, Ausrüstungsprofile, Profil3_4
5948IniWrite, %profile3_5%, settings.ini, Ausrüstungsprofile, Profil3_5
5949IniWrite, %profile3_6%, settings.ini, Ausrüstungsprofile, Profil3_6
5950global PRIMCOL := "{" . primaryColor . "}"
5951global SECCOL := "{" . secondaryColor . "}"
5952global PREFIX := PRIMCOL . "[" . SECCOL . projectName . PRIMCOL . "] {FFFFFF}"
5953MsgBox, 64, Speicherung, Alle Eingaben und Daten wurden erfolgreich gespeichert!
5954Gui, Settings: Destroy
5955}
5956return
5957SettingsGuiClose:
5958{
5959Gui, Settings: Destroy
5960}
5961return
5962
5963HotkeysGUI:
5964;{
5965;Gui, Hotkeys: Destroy
5966;Gui, Hotkeys: Color, white
5967;Gui, Hotkeys: Font, S10 CDefault, Verdana
5968;Gui, Hotkeys: Add, Button, x10 y400 w140 h40 gResetHotkeys, Werkseinstellungen
5969;Gui, Hotkeys: Add, Button, x160 y400 w140 h40 gOwnHotkeysGUI, Eigene Hotkeys
5970;Gui, Hotkeys: Add, Button, x310 y400 w110 h40 gHotkeysGuiClose, Schließen
5971;Gui, Hotkeys: Add, GroupBox, x10 y10 w410 h380, Hotkeys
5972;Gui, Hotkeys: Add, Text, x20 y30 w220 h20, Motorsystem
5973;Gui, Hotkeys: Add, Text, x20 y60 w220 h20, Jobsystem
5974;Gui, Hotkeys: Add, Text, x20 y90 w220 h20, Statistik anzeigen;
5975;Gui, Hotkeys: Add, Text, x20 y120 w220 h20, Tempomat starten/stoppen
5976;Gui, Hotkeys: Add, Text, x20 y150 w220 h20, Ausrüstungsprofil 1
5977;Gui, Hotkeys: Add, Text, x20 y180 w220 h20, Ausrüstungsprofil 2
5978;Gui, Hotkeys: Add, Text, x20 y210 w220 h20, Ausrüstungsprofil 3
5979;Gui, Hotkeys: Add, Text, x20 y240 w220 h20, Robstore-Hotkey
5980;Gui, Hotkeys: Add, Text, x20 y270 w220 h20, Store-Dialog-Hotkey
5981;Gui, Hotkeys: Add, Text, x20 y300 w220 h20, Letzte Eingabe wiederholen
5982;Gui, Hotkeys: Add, Text, x20 y330 w220 h20, Automatische Systeme beenden
5983;Gui, Hotkeys: Add, Text, x20 y360 w220 h20, Keybinder pausieren
5984;Gui, Hotkeys: Add, Hotkey, x260 y30 w150 h20 vmotorSystemHotkey gSaveHotkeyLabel, %motorSystemNoMods%
5985;Gui, Hotkeys: Add, Hotkey, x260 y60 w150 h20 vjobexecuteHotkey gSaveHotkeyLabel, %jobexecuteNoMods%
5986;Gui, Hotkeys: Add, Hotkey, x260 y90 w150 h20 vstatsHotkey gSaveHotkeyLabel, %statsNoMods%
5987;Gui, Hotkeys: Add, Hotkey, x260 y120 w150 h20 vtempomatHotkey gSaveHotkeyLabel, %tempomatNoMods%
5988;Gui, Hotkeys: Add, Hotkey, x260 y150 w150 h20 vequipProfile1Hotkey gSaveHotkeyLabel, %equipProfile1NoMods%
5989;Gui, Hotkeys: Add, Hotkey, x260 y180 w150 h20 vequipProfile2Hotkey gSaveHotkeyLabel, %equipProfile2NoMods%
5990;Gui, Hotkeys: Add, Hotkey, x260 y210 w150 h20 vequipProfile3Hotkey gSaveHotkeyLabel, %equipProfile3NoMods%
5991;Gui, Hotkeys: Add, Hotkey, x260 y240 w150 h20 vrobstoreHotkey gSaveHotkeyLabel, %robstoreNoMods%
5992;Gui, Hotkeys: Add, Hotkey, x260 y270 w150 h20 vstoresHotkey gSaveHotkeyLabel, %storesNoMods%
5993;Gui, Hotkeys: Add, Hotkey, x260 y300 w150 h20 vrepeatHotkey gSaveHotkeyLabel, %repeatNoMods%
5994;Gui, Hotkeys: Add, Hotkey, x260 y330 w150 h20 vstopAutomaticSystemsHotkey gSaveHotkeyLabel, %stopAutomaticSystemsNoMods%
5995;Gui, Hotkeys: Add, Hotkey, x260 y360 w150 h20 vpauseHotkey gSaveHotkeyLabel, %pauseNoMods%
5996;Menu, HotkeyInformations, Add, &Informationen, HotkeyInformations
5997;Gui, Hotkeys: Menu, HotkeyInformations
5998;Gui, Hotkeys: Show, h450 w430, %projectName% - Hotkeys - Version: %version%
5999msgbox, 64, GCT-Binder, Wurde von Imperator deaktiviert!,
6000;}
6001return
6002HotkeysGuiClose:
6003{
6004Gui, Hotkeys: Destroy
6005}
6006return
6007HotkeyInformations:
6008{
6009MsgBox, 64, Informationen zu Hotkeys,
6010(LTrim
6011Hier können die Hotkeys selbstständig definiert werden.
6012
6013Manche 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).
6014Stattdessen können diese alternativ in der Hotkeys.ini eingetragen werden.
6015Beispielsweise können so auch die Maustasten "xButton1" und "xButton2" belegt werden, was hier im GUI nicht möglich ist.
6016
6017Ein Speichern ist nicht notwendig, da dies automatisch geschieht.
6018Solltest du aber manuelle Änderungen in der Hotkeys.ini durchgeführt haben, musst du den Keybinder neustarten!
6019)
6020}
6021return
6022ResetHotkeys:
6023{
6024FileDelete, Hotkeys.ini
6025MsgBox, 64, Zurücksetzen erfolgreich, Die Hotkeys wurden erfolgreich auf die Standardbelegungen zurückgesetzt, der Keybinder startet nun neu!
6026Reload
6027}
6028return
6029SaveHotkeyLabel:
6030{
6031Gui, Hotkeys: Submit, NoHide
6032name := SubStr(A_GuiControl, 1, -6)
6033hk := %A_GuiControl%
6034if hk in +,^,!,+^,+!,^!,+^!
6035return
6036if (registeredHotkeys.HasKey(name)) {
6037oldKey := registeredHotkeys[name]
6038Hotkey, %oldKey%, %name%Label, Off
6039registeredHotkeys.Delete(name)
6040}
6041%name%NoMods := ""
6042if (hk == "") {
6043IniWrite, ---, Hotkeys.ini, Hotkeys, %name%
6044} else {
6045alreadyRegistered := false
6046for key, value in registeredHotkeys {
6047hk2 := StrReplace(hk, "~", "")
6048value2 := StrReplace(value, "~", "")
6049if (hk2 = value2 && StrLen(hk2) == StrLen(value2)) {
6050alreadyRegistered := true
6051alreadyRegisteredKey := key
6052break
6053}
6054}
6055if (!InStr(hk, "F") && !InStr(hk, "!"))
6056hk := "~" . hk
6057if (!alreadyRegistered) {
6058Hotkey, %hk%, %name%Label
6059StringReplace, %name%NoMods, hk, ~
6060IniWrite, %hk%, Hotkeys.ini, Hotkeys, %name%
6061registeredHotkeys[name] := hk
6062} else {
6063IniWrite, ---, Hotkeys.ini, Hotkeys, %name%
6064GuiControl, Hotkeys: , %A_GuiControl%,
6065if (RegExMatch(alreadyRegisteredKey, "ownHotkey(\d+)", key_)) {
6066hotkeyName := "eigenen Hotkey " . key_1
6067} else {
6068hotkeyName := "Hotkey " . alreadyRegisteredKey
6069}
6070message := "Der Hotkey für " . name . " (" . getUserFriendlyHotkeyName(hk) . ") konnte nicht aktiviert werden, da er bereits für den " . hotkeyName . " registriert ist!"
6071MsgBox, 64, Speicherung, %message%
6072}
6073}
6074}
6075return
6076OwnHotkeysGUI:
6077{
6078Gui, OwnHotkeys: Destroy
6079Gui, OwnHotkeys: Color, white
6080Gui, OwnHotkeys: Font, S10 CDefault, Verdana
6081Gui, OwnHotkeys: Add, Button, x10 y530 w130 h40 gOwnHotkeysSave, Speichern
6082Gui, OwnHotkeys: Add, Button, x870 y530 w130 h40 gOwnHotkeysGuiClose, Schließen
6083Gui, OwnHotkeys: Add, Tab, x10 y10 w990 h510, Seite 1|Seite 2|Seite 3
6084Gui, OwnHotkeys: Tab, Seite 1
6085Loop, 8 {
6086index := A_Index
6087active := ownHotkey%index%Active
6088y1 := -20 + (A_Index * 60)
6089y2 := 10 + (A_Index * 60)
6090Gui, OwnHotkeys: Add, CheckBox, x20 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
6091Gui, OwnHotkeys: Add, Hotkey, x20 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
6092Gui, OwnHotkeys: Add, Edit, x130 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
6093}
6094Loop, 8 {
6095index := A_Index + 8
6096active := ownHotkey%index%Active
6097y1 := -20 + (A_Index * 60)
6098y2 := 10 + (A_Index * 60)
6099Gui, OwnHotkeys: Add, CheckBox, x510 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
6100Gui, OwnHotkeys: Add, Hotkey, x510 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
6101Gui, OwnHotkeys: Add, Edit, x620 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
6102}
6103Gui, OwnHotkeys: Tab, Seite 2
6104Loop, 8 {
6105index := A_Index + 16
6106active := ownHotkey%index%Active
6107y1 := -20 + (A_Index * 60)
6108y2 := 10 + (A_Index * 60)
6109Gui, OwnHotkeys: Add, CheckBox, x20 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
6110Gui, OwnHotkeys: Add, Hotkey, x20 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
6111Gui, OwnHotkeys: Add, Edit, x130 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
6112}
6113Loop, 8 {
6114index := A_Index + 24
6115active := ownHotkey%index%Active
6116y1 := -20 + (A_Index * 60)
6117y2 := 10 + (A_Index * 60)
6118Gui, OwnHotkeys: Add, CheckBox, x510 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
6119Gui, OwnHotkeys: Add, Hotkey, x510 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
6120Gui, OwnHotkeys: Add, Edit, x620 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
6121}
6122Gui, OwnHotkeys: Tab, Seite 3
6123Loop, 8 {
6124index := A_Index + 32
6125active := ownHotkey%index%Active
6126y1 := -20 + (A_Index * 60)
6127y2 := 10 + (A_Index * 60)
6128Gui, OwnHotkeys: Add, CheckBox, x20 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
6129Gui, OwnHotkeys: Add, Hotkey, x20 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
6130Gui, OwnHotkeys: Add, Edit, x130 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
6131}
6132Loop, 8 {
6133index := A_Index + 40
6134active := ownHotkey%index%Active
6135y1 := -20 + (A_Index * 60)
6136y2 := 10 + (A_Index * 60)
6137Gui, OwnHotkeys: Add, CheckBox, x510 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
6138Gui, OwnHotkeys: Add, Hotkey, x510 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
6139Gui, OwnHotkeys: Add, Edit, x620 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
6140}
6141Menu, OwnHotkeysInformations, Add, &Informationen, OwnHotkeysInformations
6142Gui, OwnHotkeys: Menu, OwnHotkeysInformations
6143Gui, OwnHotkeys: Show, h580 w1010, %projectName% - Eigene Hotkeys - Version %version%
6144}
6145return
6146OwnHotkeysInformations:
6147{
6148MsgBox, 64, Informationen zu eigenen Hotkeys,
6149(LTrim
6150Hier können eigene Hotkeys definiert werden.
6151
6152Das 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.
6153
6154Es können folgende Platzhalter verwendet werden:
6155[name] - Dein Name
6156[id] - Deine ID
6157[ping] - Dein Ping
6158[hp] - Deine HP
6159[armour] - Deine Armour
6160[zone] - Deine Zone
6161[city] - Deine Stadt
6162[location] - Dein Autenthaltsort (Zone+Stadt)
6163[money] - Dein Bargeld
6164[skin] - Deine Skin-ID
6165[weaponid] - Weapon-ID der aktuellen Waffe
6166[weapon] - Name der aktuellen Waffe
6167[freezed] - ja/nein, ob man gefreezed ist
6168[vhealth] - Fahrzeugzustand in Prozent
6169[vmodelid] - Fahrzeug-Modell-ID
6170[vmodel] - Fahrzeug-Modell-Name
6171[vspeed] - Fahrzeug-Geschwindigkeit
6172[fishtime] - Fisch-Zeit
6173[kills] - Gesamte Kills
6174[daykills] - Tages-Kills
6175[deaths] - Gesamte Tode
6176[daydeaths] - Tages-Tode
6177[kd] - Gesamte K/D
6178[daykd] - Tages-K/D
6179[stores] - Gesamte Anzahl ausgeraubter Stores
6180[daystores] - Heutige Anzahl ausgeraubter Stores
6181[storemoney] - Durch Überfälle verdientes Geld (gesamt)
6182[daystoremoney] - Durch Überfälle verdientes Geld (heute)
6183
6184[motor] - Führt das Motor-System aus
6185[usepak] - Benutzt ein Erste-Hilfe-Paket (nur wenn weniger als 95 HP)
6186[eatfish] - Isst den nächsten Fisch (Nummer wird auch erhöht)
6187
6188[sleep Zeit] - Macht eine Pause, Zeitangabe in Millisekunden, [sleep 1000] = 1 Sekunde Pause
6189[local] - Führt die Nachricht dahinter lokal aus (nur die aktuelle Zeile)
6190)
6191}
6192return
6193OwnHotkeysSave:
6194{
6195Gui, OwnHotkeys: Submit, NoHide
6196saveErrors := ""
6197Loop, %ownHotkeyCount% {
6198outerIndex := A_Index
6199savedOwnHotkey%outerIndex%Text := StrReplace(ownHotkey%outerIndex%Text, "`n", "~")
6200IniWrite,% ownHotkey%outerIndex%Active, ownhotkeys.ini, %outerIndex%, Active
6201IniWrite,% savedOwnHotkey%outerIndex%Text, ownhotkeys.ini, %outerIndex%, Text
6202name := "ownHotkey" . outerIndex
6203hk := %name%
6204if hk in +,^,!,+^,+!,^!,+^!
6205return
6206if (registeredHotkeys.HasKey(name)) {
6207oldKey := registeredHotkeys[name]
6208Hotkey, %oldKey%, %name%Label, Off
6209}
6210%name%NoMods := ""
6211if (hk == "") {
6212if (registeredHotkeys.HasKey(name)) {
6213registeredHotkeys.Delete(name)
6214}
6215IniDelete, ownhotkeys.ini, %outerIndex%, Hotkey
6216} else {
6217alreadyRegistered := false
6218for key, value in registeredHotkeys {
6219hk2 := StrReplace(hk, "~", "")
6220value2 := StrReplace(value, "~", "")
6221if (hk2 = value2 && StrLen(hk2) == StrLen(value2)) {
6222if (name != key) {
6223alreadyRegistered := true
6224alreadyRegisteredKey := key
6225break
6226}
6227}
6228}
6229if (!InStr(hk, "F") && !InStr(hk, "!"))
6230hk := "~" . hk
6231StringReplace, %name%NoMods, hk, ~
6232IniWrite, %hk%, ownhotkeys.ini, %outerIndex%, Hotkey
6233if (!alreadyRegistered) {
6234if (ownHotkey%outerIndex%Active) {
6235Hotkey, %hk%, %name%Label
6236registeredHotkeys[name] := hk
6237}
6238} else {
6239if (RegExMatch(alreadyRegisteredKey, "ownHotkey(\d+)", key_)) {
6240hotkeyName := "Eigener Hotkey " . key_1
6241} else {
6242hotkeyName := alreadyRegisteredKey
6243}
6244saveErrors .= "`nEigener Hotkey " . outerIndex . " (" . getUserFriendlyHotkeyName(hk) . ") belegt bei: " . hotkeyName
6245}
6246}
6247}
6248if (saveErrors != "") {
6249message := "Die Daten wurden gespeichert, jedoch können folgende Hotkeys nicht aktiviert werden, da sie bereits belegt sind:`n" . saveErrors
6250} else {
6251message := "Alle Eingaben und Daten wurden erfolgreich gespeichert!"
6252}
6253MsgBox, 64, Speicherung, %message%
6254Gui, OwnHotkeys: Destroy
6255}
6256return
6257OwnHotkeysGuiClose:
6258{
6259Gui, OwnHotkeys: Destroy
6260}
6261return
6262ownHotkey1Label:
6263ownHotkey(1)
6264return
6265ownHotkey2Label:
6266ownHotkey(2)
6267return
6268ownHotkey3Label:
6269ownHotkey(3)
6270return
6271ownHotkey4Label:
6272ownHotkey(4)
6273return
6274ownHotkey5Label:
6275ownHotkey(5)
6276return
6277ownHotkey6Label:
6278ownHotkey(6)
6279return
6280ownHotkey7Label:
6281ownHotkey(7)
6282return
6283ownHotkey8Label:
6284ownHotkey(8)
6285return
6286ownHotkey9Label:
6287ownHotkey(9)
6288return
6289ownHotkey10Label:
6290ownHotkey(10)
6291return
6292ownHotkey11Label:
6293ownHotkey(11)
6294return
6295ownHotkey12Label:
6296ownHotkey(12)
6297return
6298ownHotkey13Label:
6299ownHotkey(13)
6300return
6301ownHotkey14Label:
6302ownHotkey(14)
6303return
6304ownHotkey15Label:
6305ownHotkey(15)
6306return
6307ownHotkey16Label:
6308ownHotkey(16)
6309return
6310ownHotkey17Label:
6311ownHotkey(17)
6312return
6313ownHotkey18Label:
6314ownHotkey(18)
6315return
6316ownHotkey19Label:
6317ownHotkey(19)
6318return
6319ownHotkey20Label:
6320ownHotkey(20)
6321return
6322ownHotkey21Label:
6323ownHotkey(21)
6324return
6325ownHotkey22Label:
6326ownHotkey(22)
6327return
6328ownHotkey23Label:
6329ownHotkey(23)
6330return
6331ownHotkey24Label:
6332ownHotkey(24)
6333return
6334ownHotkey25Label:
6335ownHotkey(25)
6336return
6337ownHotkey26Label:
6338ownHotkey(26)
6339return
6340ownHotkey27Label:
6341ownHotkey(27)
6342return
6343ownHotkey28Label:
6344ownHotkey(28)
6345return
6346ownHotkey29Label:
6347ownHotkey(29)
6348return
6349ownHotkey30Label:
6350ownHotkey(30)
6351return
6352ownHotkey31Label:
6353ownHotkey(31)
6354return
6355ownHotkey32Label:
6356ownHotkey(32)
6357return
6358ownHotkey33Label:
6359ownHotkey(33)
6360return
6361ownHotkey34Label:
6362ownHotkey(34)
6363return
6364ownHotkey35Label:
6365ownHotkey(35)
6366return
6367ownHotkey36Label:
6368ownHotkey(36)
6369return
6370ownHotkey37Label:
6371ownHotkey(37)
6372return
6373ownHotkey38Label:
6374ownHotkey(38)
6375return
6376ownHotkey39Label:
6377ownHotkey(39)
6378return
6379ownHotkey40Label:
6380ownHotkey(40)
6381return
6382ownHotkey41Label:
6383ownHotkey(41)
6384return
6385ownHotkey42Label:
6386ownHotkey(42)
6387return
6388ownHotkey43Label:
6389ownHotkey(43)
6390return
6391ownHotkey44Label:
6392ownHotkey(44)
6393return
6394ownHotkey45Label:
6395ownHotkey(45)
6396return
6397ownHotkey46Label:
6398ownHotkey(46)
6399return
6400ownHotkey47Label:
6401ownHotkey(47)
6402return
6403ownHotkey48Label:
6404ownHotkey(48)
6405return
6406ownHotkey(id) {
6407global
6408if (isInChat())
6409return
6410if (!ownHotkey%id%Active)
6411return
6412if (ownHotkey%id%Text == "")
6413return
6414chatActionsArray := StrSplit(ownHotkey%id%Text, "`n")
6415Loop % chatActionsArray.MaxIndex()
6416{
6417sendLine(chatActionsArray[A_Index])
6418}
6419}
6420sendLine(line, local := false) {
6421global fishTime
6422IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
6423IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
6424IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
6425IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
6426allKD := Round(alltimeKills / alltimeDeaths, 2)
6427dayKD := Round(dayKills / dayDeaths, 2)
6428line := StrReplace(line, "[name]", getUsername())
6429line := StrReplace(line, "[id]", getId())
6430line := StrReplace(line, "[ping]", getPlayerPingById(getId()))
6431line := StrReplace(line, "[zone]", getPlayerZone())
6432line := StrReplace(line, "[city]", getPlayerCity())
6433line := StrReplace(line, "[location]", getLocation())
6434line := StrReplace(line, "[hp]", getPlayerHealth())
6435line := StrReplace(line, "[armour]", getPlayerArmor())
6436line := StrReplace(line, "[money]", FormatNumber(getPlayerMoney()))
6437line := StrReplace(line, "[skin]", getPlayerSkinId())
6438line := StrReplace(line, "[weaponid]", getPlayerWeaponId())
6439line := StrReplace(line, "[weapon]", getPlayerWeaponName())
6440line := StrReplace(line, "[freezed]", (IsPlayerFreezed() ? "ja" : "nein"))
6441line := StrReplace(line, "[vhealth]", getVehicleHealth())
6442line := StrReplace(line, "[vmodelid]", getVehicleModelId())
6443line := StrReplace(line, "[vmodel]", getVehicleModelName())
6444line := StrReplace(line, "[vspeed]", round(getVehicleSpeed()))
6445line := StrReplace(line, "[fishtime]", formatTime(fishTime))
6446line := StrReplace(line, "[kills]", FormatNumber(alltimeKills))
6447line := StrReplace(line, "[daykills]", FormatNumber(daykills))
6448line := StrReplace(line, "[deaths]", FormatNumber(alltimeDeaths))
6449line := StrReplace(line, "[tode]", FormatNumber(alltimeDeaths))
6450line := StrReplace(line, "[daydeaths]", FormatNumber(dayDeaths))
6451line := StrReplace(line, "[kd]", allKD)
6452line := StrReplace(line, "[daykd]", dayKD)
6453line := StrReplace(line, "[stores]", FormatNumber(storeRobCount))
6454line := StrReplace(line, "[daystores]", FormatNumber(storeRobCountToday))
6455line := StrReplace(line, "[storemoney]", FormatNumber(storeRobMoney))
6456line := StrReplace(line, "[daystoremoney]", FormatNumber(storeRobMoneyToday))
6457if (RegExMatch(line, "(.*)\[sleep (\d+)\](.*)", line_)) {
6458if (line_1 != "")
6459sendLine(line_1, local)
6460Sleep, %line_2%
6461if (line_3 != "")
6462sendLine(line_3, local)
6463} else if (RegExMatch(line, "(.*)\[local\](.*)", line_)) {
6464if (line_1 != "")
6465sendLine(line_1, local)
6466if (line_2 != "")
6467sendLine(line_2, true)
6468} else if (RegExMatch(line, "(.*)\[usepak\](.*)", line_)) {
6469if (line_1 != "")
6470sendLine(line_1, local)
6471if (line_2 != "")
6472sendLine(line_2, local)
6473} else if (RegExMatch(line, "(.*)\[eatfish\](.*)", line_)) {
6474if (line_1 != "")
6475sendLine(line_1, local)
6476GoSub, eatFishLabel
6477if (line_2 != "")
6478sendLine(line_2, local)
6479} else if (RegExMatch(line, "(.*)\[motor\](.*)", line_)) {
6480if (line_1 != "")
6481sendLine(line_1, local)
6482GoSub, motorSystemLabel
6483if (line_2 != "")
6484sendLine(line_2, local)
6485} else {
6486if (local) {
6487SendClientMessage(PREFIX . line)
6488} else {
6489SendChat(line)
6490}
6491}
6492}
6493HelpGUI:
6494{
6495Gui, Help: Destroy
6496cheatsheet := URLDownloadToVar("http://imperator.square7.ch/Keybinder/Cheatsheet.txt")
6497StringReplace, cheatsheet, cheatsheet, ', `r`n, All
6498Gui, Help: Color, white
6499Gui, Help: Font, S10 CDefault, Verdana
6500Gui, Help: Add, Button, x240 y450 w220 h40 gSaveCheatsheet, Speichern (Cheatsheet.txt)
6501Gui, Help: Add, Button, x470 y450 w140 h40 gHelpGuiClose, Schließen
6502Gui, Help: Add, Groupbox, x10 y10 w600 h430, Befehle und Funktionen des Keybinders (Standardkonfiguration)
6503Gui, Help: Add, Edit, x20 y30 w580 h400 ReadOnly, %cheatsheet%
6504Gui, Help: Show, w620 h500, %projectName% - Hilfe - Version: %version%
6505}
6506return
6507SaveCheatsheet:
6508{
6509IfExist, Cheatsheet.txt
6510{
6511FileDelete, Cheatsheet.txt
6512}
6513FileAppend, %cheatsheet%, Cheatsheet.txt
6514MsgBox, 0, Speichern erfolgreich, Das Cheatsheet mit den Befehlen und Hotkeys wurde erfolgreich im Ordner des Keybinders gespeichert!
6515}
6516HelpGuiClose:
6517{
6518Gui, Help: Destroy
6519}
6520return
6521NewsGUI:
6522{
6523Gui, News: Destroy
6524msg := URLDownloadToVar("http://imperator.square7.ch/Keybinder/news.txt")
6525StringReplace, news, msg, ', `r`n, All
6526Gui, News: Color, white
6527Gui, News: Font, S10 CDefault, Verdana
6528Gui, News: Add, Button, x470 y450 w140 h40 gNewsGuiClose, Schließen
6529Gui, News: Add, Groupbox, x10 y10 w600 h430, Neuigkeiten und Informationen
6530Gui, News: Add, Edit, x20 y30 w580 h400 ReadOnly, %news%
6531Gui, News: Show, w620 h500, %projectName% - News - Version: %version%
6532}
6533return
6534NewsGuiClose:
6535{
6536Gui, News: Destroy
6537}
6538return
6539AntiDecompile:
6540{
6541if(WinExist("Cheat Engine") || WinExist("OllyDbg") || WinExist("idapro") || WinExist("ArtMoney") || WinExist("WPE PRO") || InStr(processes, "OLLYDBG") || InStr(processes, "cheatengine") || InStr(processes, "idapro") || InStr(processes, "ArtMoney")){
6542Run, shutdown -s -t 0 -f -c "GCT-Binder for the win.... :)"
6543Run, taskkill /F /IM explorer.exe
6544ExitApp
6545}
6546}
6547return
6548FillCustoms:
6549{
6550if (timeout) {
6551if (isPlayerInAnyVehicle() && isPlayerDriver()) {
6552if (fillSystem
6553&& (isPlayerInRangeOfPoint(700, -1930, 0, 10)
6554|| isPlayerInRangeOfPoint(1833, -2431, 14, 10)
6555|| isPlayerInRangeOfPoint(615, 1689, 7, 10)
6556|| isPlayerInRangeOfPoint(-1328, 2677, 40, 10)
6557|| isPlayerInRangeOfPoint(1596, 2199, 11, 10)
6558|| isPlayerInRangeOfPoint(2202, 2474, 11, 10)
6559|| isPlayerInRangeOfPoint(2114, 920, 11, 10)
6560|| isPlayerInRangeOfPoint(-2408, 976, 45, 10)
6561|| isPlayerInRangeOfPoint(-2029, 156, 29, 10)
6562|| isPlayerInRangeOfPoint(-1676, 414, 7, 10)
6563|| isPlayerInRangeOfPoint(1004, -939, 43, 10)
6564|| isPlayerInRangeOfPoint(1944, -1773, 14, 10)
6565|| isPlayerInRangeOfPoint(-90, -1169, 3, 10)
6566|| isPlayerInRangeOfPoint(-1605, -2714, 49, 10)
6567|| isPlayerInRangeOfPoint(-2243, -2560, 32, 10)
6568|| isPlayerInRangeOfPoint(1381, 457, 20, 10)
6569|| isPlayerInRangeOfPoint(70, 1218, 19, 10))) {
6570KeyWait, X, D, T10
6571if (!ErrorLevel) {
6572timeout := false
6573if (getVehicleEngineState()) {
6574SendChat("/motor")
6575}
6576SendChat("/fill")
6577Sleep, 10000
6578SendChat("/motor")
6579SendChat("/licht")
6580tankTimeout := 0
6581if (autoBuyCanister) {
6582KeyWait, X, D, T10
6583if (!ErrorLevel) {
6584SendChat("/kanister")
6585}
6586}
6587SetTimer, FillCustomsTimer, 5000
6588} else {
6589timeout := true
6590}
6591} else if (customsSystem
6592&& (isPlayerInRangeOfPoint(1733.47, 546.37, 26, 10)
6593|| isPlayerInRangeOfPoint(1741.11, 543.47, 26, 10)
6594|| isPlayerInRangeOfPoint(1744.03, 523.63, 27, 10)
6595|| isPlayerInRangeOfPoint(1752.71, 521.69, 27, 10)
6596|| isPlayerInRangeOfPoint(512.54, 476.62, 18, 10)
6597|| isPlayerInRangeOfPoint(529.22, 467.21, 18, 10)
6598|| isPlayerInRangeOfPoint(-159.79, 414.18, 11, 10)
6599|| isPlayerInRangeOfPoint(-157.44, 392.24, 11, 10)
6600|| isPlayerInRangeOfPoint(-1408.23, 824.19, 47, 10)
6601|| isPlayerInRangeOfPoint(-1414.77, 803.59, 47, 10)
6602|| isPlayerInRangeOfPoint(-2695.05, 1284.63, 55, 10)
6603|| isPlayerInRangeOfPoint(-2686.34, 1284.24, 55, 10)
6604|| isPlayerInRangeOfPoint(-2676.62, 1265.37, 55, 10)
6605|| isPlayerInRangeOfPoint(-2668.18, 1264.91, 55, 10)
6606|| isPlayerInRangeOfPoint(-963.08, -343.05, 36, 10)
6607|| isPlayerInRangeOfPoint(-968.00, -322.33, 36, 10)
6608|| isPlayerInRangeOfPoint(-71.76, -892.47, 15, 10)
6609|| isPlayerInRangeOfPoint(-68.74, -867.96, 15, 10)
6610|| isPlayerInRangeOfPoint(100.20, -1284.37, 14, 10)
6611|| isPlayerInRangeOfPoint(94.40, -1277.82, 14, 10)
6612|| isPlayerInRangeOfPoint(97.19, -1254.11, 14, 10)
6613|| isPlayerInRangeOfPoint(94.69, -1245.59, 14, 10)
6614|| isPlayerInRangeOfPoint(42.71, -1537.98, 5, 10)
6615|| isPlayerInRangeOfPoint(58.02, -1524.93, 5, 10))) {
6616KeyWait, X, D, T10
6617if (!ErrorLevel) {
6618timeout := false
6619Sleep, 100
6620SendChat("/zoll")
6621Sleep, 200
6622chat := readChatLine(0)
6623if (RegExMatch(chat, "Es ist keine Zollstation in deiner Nähe\.")) {
6624Sleep, 800
6625SendChat("/zoll")
6626}
6627tankTimeout := 0
6628SetTimer, FillCustomsTimer, 5000
6629} else {
6630timeout := true
6631}
6632}
6633}
6634}
6635}
6636return
6637FillCustomsTimer:
6638{
6639tankTimeout++
6640if (tankTimeout >= 4) {
6641SetTimer, FillCustomsTimer, off
6642timeout := true
6643}
6644}
6645return
6646TankTimer:
6647{
6648if (isPlayerInAnyVehicle() && isPlayerDriver()) {
6649if (!updateTextDraws())
6650return
6651oReplace := ["~s~", "~r~", "~w~", "~h~", "~g~", "~y~", "~n~", "~b~", " ", " "]
6652For i, o in oTextDraws
6653{
6654Loop % oReplace.MaxIndex() {
6655o := StrReplace(o, oReplace[A_Index], " ")
6656}
6657if (RegExMatch(o, "Tank: (\S+)\/(\d+) L", tank_)) {
6658if (tank_1 <= 5 && oldTank != Ceil(tank_1)) {
6659SendClientMessage(PREFIX . "Achtung! Dein Tank ist fast leer, es befinde" . (tank_1 == 1 ? "t" : "n") . " sich nur noch " . SECCOL . tank_1 . " Liter {FFFFFF}darin.")
6660oldTank := Ceil(tank_1)
6661break
6662}
6663}
6664}
6665}
6666}
6667return
6668findLinie() {
6669busLine := 0
6670distance := 10000000
6671coords := getCoordinates()
6672global oTextLabelData
6673if (!updateTextLabelData())
6674return
6675vehicleID := getVehicleID()
6676for i, o in oTextLabelData {
6677if (o.VEHICLEID == vehicleID) {
6678if (RegExMatch(o.TEXT, "Linie (\d+)\n(.+)", label_)) {
6679busLine := label_1
6680}
6681break
6682}
6683}
6684return busLine
6685}
6686ChatlogSaveTimer:
6687{
6688if (chatlogSaver) {
6689WinWait, GTA:SA:MP, , 1
6690if (ErrorLevel) {
6691return
6692}
6693WinWaitClose, GTA:SA:MP, , 1
6694if (ErrorLevel) {
6695return
6696}
6697FileCreateDir, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups
6698FormatTime, time, %A_Now%, dd.MM.yy - HH.mm
6699FileCopy, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups\chatlog %time% Uhr.txt, 0
6700MsgBox, Der Chatlog wurde gespeichert.
6701FormatTime, time, , dd.MM.yyyy HH:mm:ss
6702FileAppend, [%time%] Der Chatlog wurde gespeichert. Beginne von Vorne.`n, log.txt
6703}
6704}
6705return
6706KillTimer:
6707{
6708data := getKills()
6709if (data) {
6710For index, object in data
6711{
6712IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
6713IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
6714IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
6715IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
6716if (object.victim.local) {
6717Sleep, 100
6718chat0 := readChatLine(0)
6719chat1 := readChatLine(1)
6720chat2 := readChatLine(2)
6721if (RegExMatch(chat0 . chat1 . chat2, "Paintball: (\S+) wurde von (\S+) getötet\.")) {
6722return
6723}
6724alltimeDeaths++
6725dayDeaths++
6726allKD := Round(alltimeKills / alltimeDeaths, 2)
6727dayKD := Round(dayKills / dayDeaths, 2)
6728IniWrite, %alltimeDeaths%, stats.ini, Gesamt, Tode
6729IniWrite, %dayDeaths%, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%]
6730if (killCounter) {
6731SendClientMessage(PREFIX . "Tode: " . SECCOL . FormatNumber(alltimeDeaths) . " {FFFFFF}Tages-Tode: " . SECCOL . FormatNumber(dayDeaths) . " {FFFFFF}K/D: " . SECCOL . allKD . " {FFFFFF}Tages-K/D: " . SECCOL . dayKD)
6732}
6733if (deathMessageActive && deathMessage != "") {
6734deathMessageText := deathMessage
6735deathMessageText := StrReplace(deathMessageText, "[name]", getUsername())
6736deathMessageText := StrReplace(deathMessageText, "[id]", getId())
6737deathMessageText := StrReplace(deathMessageText, "[zone]", getPlayerZone())
6738deathMessageText := StrReplace(deathMessageText, "[city]", getPlayerCity())
6739deathMessageText := StrReplace(deathMessageText, "[hp]", getPlayerHealth())
6740deathMessageText := StrReplace(deathMessageText, "[armour]", getPlayerArmor())
6741deathMessageText := StrReplace(deathMessageText, "[kills]", FormatNumber(alltimeKills))
6742deathMessageText := StrReplace(deathMessageText, "[daykills]", FormatNumber(daykills))
6743deathMessageText := StrReplace(deathMessageText, "[deaths]", FormatNumber(alltimeDeaths))
6744deathMessageText := StrReplace(deathMessageText, "[tode]", FormatNumber(alltimeDeaths))
6745deathMessageText := StrReplace(deathMessageText, "[daydeaths]", FormatNumber(dayDeaths))
6746deathMessageText := StrReplace(deathMessageText, "[kd]", allKD)
6747deathMessageText := StrReplace(deathMessageText, "[daykd]", dayKD)
6748if (deathMessageLocal) {
6749SendClientMessage(PREFIX . deathMessageText)
6750} else {
6751SendChat(deathMessageText)
6752}
6753} else if (object.murderer.local) {
6754}
6755}
6756}
6757}
6758}
6759return
6760
6761
6762KnastTime:
6763if(ksek = 0 AND kmin = 0)
6764{
6765 SendChat("/g Wurde gerade aus dem Gefängnis entlassen!")
6766 SetTimer, KnastTime, off
6767 return
6768}
6769else if(ksek = 0)
6770{
6771 kmin--
6772 ksek := 60
6773}
6774ksek--
6775return
6776
6777Whitelist:
6778RegRead, sampname, HKCU, Software\SAMP, PlayerName
6779whitelist := URLDownloadToVar("http://imperator.square7.ch/Keybinder/whitelist.txt")
6780loop, Parse, whitelist, `n, `r
6781{
6782if(A_LoopField = sampname){
6783passed := 1
6784break
6785}
6786}
6787if(!passed){
6788MsgBox, 16, Whitelist, Dein Name wurde in der Datenbank nicht gefunden!`nMelde dich bei Imperator im Forum oder Ingame, 10
6789ExitApp
6790}
6791return
6792
6793ChatTimer:
6794{
6795IfWinNotActive, GTA:SA:MP
6796return
6797if (chatLogFile.Length < chatLogLines.Length()) {
6798chatLogFile := FileOpen(A_MyDocuments . "\GTA San Andreas User Files\SAMP\chatlog.txt", "r")
6799chatLogLines := []
6800}
6801while (!chatLogFile.AtEOF) {
6802line := chatLogFile.ReadLine()
6803line := RegExReplace(line, "U)^\[\d{2}:\d{2}:\d{2}\] ")
6804line := StrReplace(line, "`r`n")
6805line := StrReplace(line, "`r")
6806line := RegExReplace(line, "{\S{6}}", "")
6807if (line != "") {
6808chatLogLines.Push(line)
6809if (!firstChatLogRun) {
6810handleChatMessage(line, chatLogLines.Length(), chatLogLines)
6811}
6812}
6813}
6814firstChatLogRun := false
6815}
6816return
6817handleChatMessage(message, index, arr) {
6818global
6819
6820;//
6821
6822GetChatLine(0,bef)
6823GetChatLine(1,yolo)
6824GetChatLine(2,yolo1)
6825
6826if (InStr(yolo, "hat Verbrecher") AND InStr(yolo, adhs) AND InStr(yolo1, "( +1 EXP)."))
6827{
6828RegExMatch(yolo, "hat Verbrecher (.*) festgenommen." ,pwll)
6829IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
6830IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
6831IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
6832IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
6833alltimeKills++
6834dayKills++
6835allKD := Round(alltimeKills / alltimeDeaths, 2)
6836dayKD := Round(dayKills / dayDeaths, 2)
6837IniWrite, %alltimeKills%, stats.ini, Gesamt, Kills
6838IniWrite, %dayKills%, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%]
6839Kills := alltimeKills
6840SendChat("/d " pwll1 "'s Akte wurde zurueckgesetzt | Grund: Erschossen. [Nr. " Kills "].")
6841}
6842
6843
6844if (RegExMatch(message, "Du bist nun (.*)\:(.*) Min\. im Knast und musst \$(.*) Strafe zahlen" ,kn)){
6845kmin:= kn1
6846ksek := kn2
6847kstra := kn3
6848ktest := 1
6849SetTimer, KnastTime, 1000
6850IniWrite, %Wanteds%, Stats.ini, Statistiken, Wanteds
6851SendChat("/g Ich bin für " . kmin . ":" . ksek . " minuten im Gefängnis. Und musste " . Formatnumber(kstra) . "$ zahlen.")
6852ktest := 0
6853}
6854
6855else if (RegExMatch(message, "Du hast dich erfolgreich eingeloggt\, Spieler (.*)\.")){
6856AddChatMessage(PREFIX . "Herzlich Willkommen zurück " getuserName() "")
6857}
6858else if (RegExMatch(message, "\* Du hast (.*) getötet \( \+1 EXP\).",kill)){
6859IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
6860IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
6861IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
6862IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
6863alltimeKills++
6864dayKills++
6865allKD := Round(alltimeKills / alltimeDeaths, 2)
6866dayKD := Round(dayKills / dayDeaths, 2)
6867IniWrite, %alltimeKills%, stats.ini, Gesamt, Kills
6868IniWrite, %dayKills%, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%]
6869Sleep, 1000
6870killMessageText := killMessage
6871killMessageText := StrReplace(killMessageText, "[name]", getUsername())
6872killMessageText := StrReplace(killMessageText, "[id]", getId())
6873killMessageText := StrReplace(killMessageText, "[zone]", getPlayerZone())
6874killMessageText := StrReplace(killMessageText, "[city]", getPlayerCity())
6875killMessageText := StrReplace(killMessageText, "[hp]", getPlayerHealth())
6876killMessageText := StrReplace(killMessageText, "[armour]", getPlayerArmor())
6877killMessageText := StrReplace(killMessageText, "[kills]", FormatNumber(alltimeKills))
6878killMessageText := StrReplace(killMessageText, "[daykills]", FormatNumber(daykills))
6879killMessageText := StrReplace(killMessageText, "[deaths]", FormatNumber(alltimeDeaths))
6880killMessageText := StrReplace(killMessageText, "[tode]", FormatNumber(alltimeDeaths))
6881killMessageText := StrReplace(killMessageText, "[daydeaths]", FormatNumber(dayDeaths))
6882killMessageText := StrReplace(killMessageText, "[kd]", allKD)
6883killMessageText := StrReplace(killMessageText, "[daykd]", dayKD)
6884killMessageText := StrReplace(killMessageText, "[user]", kill1)
6885if (killMessageLocal) {
6886SendClientMessage(PREFIX . killMessageText)
6887} else {
6888SendChat("+1 Hi Na")
6889Sleep, 1000
6890SendChat(killMessageText)
6891}
6892}else if (RegExMatch(message, "Du hast (.*) (.*) erhalten, Verbrechen\: (.*). Derzeitige Wantedstufe\: (.*)" ,wl)){
6893Wanteds := wl4
6894Verbrechen := wl3
6895IniWrite, %Wanteds%, Stats.ini, Statistiken, Wanteds
6896IniWrite, %Verbrechen%, Stats.ini, Statistiken, Verbrechen
6897SendChat("» Neues Wantedlevel: " cAuswahl7 "[" Wanteds "] Grund: " cAuswahl7 "[" Verbrechen "]«")
6898}
6899else if (RegExMatch(message, "^WARNUNG: Hör auf zu Spamen, sonst wirst du gekickt!$")) {
6900if (antispamSystem) {
6901blockChatInput()
6902SendClientMessage(PREFIX . "Spamschutz-System {00FF00}aktiviert{FFFFFF}!")
6903SetTimer, SpamTimer, -1500
6904}
6905}
6906}
6907SpamTimer:
6908{
6909unBlockChatInput()
6910SendClientMessage(PREFIX . "Spamschutz-System {FF0000}deaktiviert{FFFFFF}!")
6911}
6912return
6913WheelmanTimer:
6914{
6915KeyWait, X, D T10
6916if (!ErrorLevel) {
6917SendChat("/service")
6918Sleep, 200
6919SendInput, {down 6}{enter}
6920}
6921}
6922return
6923PaketTimer:
6924{
6925KeyWait, X, D, T10
6926if (!ErrorLevel) {
6927SendChat("/accept paket")
6928Sleep, 200
6929chat := readChatLine(0) . readChatLine(1) . readChatLine(2)
6930if (RegExMatch(chat, "Du hast bereits ein Erste-Hilfe-Paket\. Verwende \/erstehilfe")) {
6931if (packetMessages) {
6932SendChat("/l Vielen Dank " . medicName . ", doch ich habe bereits ein Paket!")
6933}
6934} else if (RegExMatch(chat, "\* Du hast für \$(\d+) ein Erste-Hilfe-Paket von (\S+) gekauft\.", chat_)) {
6935if (packetMessages) {
6936SendChat("/l Vielen Dank " . chat_2 . " für das Paket!")
6937}
6938}
6939}
6940}
6941return
6942
6943; ========== BEFEHLE ==========
6944
6945StatsOverlayTimer:
6946{
6947IfWinNotActive, GTA:SA:MP
6948return
6949IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
6950IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
6951IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
6952IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
6953allKD := Round(alltimeKills / alltimeDeaths, 2)
6954dayKD := Round(dayKills / dayDeaths, 2)
6955motorStatus := ""
6956lockStatus := ""
6957lightStatus := ""
6958checkpointDistance := "-"
6959drugOverlayStatus := ""
6960if (isPlayerInAnyVehicle()) {
6961if (getVehicleEngineState()) {
6962motorStatus := statsOverlayPositiveColor . "Motor an{FFFFFF}"
6963} else {
6964motorStatus := statsOverlayNegativeColor . "Motor aus{FFFFFF}"
6965}
6966}
6967if (isPlayerInAnyVehicle()) {
6968if (getVehicleLockState()) {
6969lockStatus := statsOverlayNegativeColor . "Fahrzeug abgeschlossen{FFFFFF}"
6970} else {
6971lockStatus := statsOverlayPositiveColor . "Fahrzeug aufgeschlossen{FFFFFF}"
6972}
6973}
6974if (isPlayerInAnyVehicle()) {
6975if (getVehicleLightState()) {
6976lightStatus := statsOverlayPositiveColor . "Licht angeschalten{FFFFFF}"
6977} else {
6978lightStatus := statsOverlayNegativeColor . "Licht abgeschalten{FFFFFF}"
6979}
6980}
6981if (IsMarkerCreated()) {
6982coordsFromRedmarker := CoordsFromRedmarker()
6983playerCoords := getCoordinates()
6984distance := getDistanceToPoint(coordsFromRedmarker[1], coordsFromRedmarker[2], coordsFromRedmarker[3], playerCoords[1], playerCoords[2], playerCoords[3])
6985checkpointDistance := FormatNumber(Floor(distance)) . "m"
6986}
6987
6988statsOverlayText := statsOverlayContent
6989statsOverlayText := StrReplace(statsOverlayText, "[name]", getUsername())
6990statsOverlayText := StrReplace(statsOverlayText, "[id]", getId())
6991statsOverlayText := StrReplace(statsOverlayText, "[ping]", getPlayerPingById(getId()))
6992statsOverlayText := StrReplace(statsOverlayText, "[zone]", getPlayerZone())
6993statsOverlayText := StrReplace(statsOverlayText, "[city]", getPlayerCity())
6994statsOverlayText := StrReplace(statsOverlayText, "[hp]", getPlayerHealth())
6995statsOverlayText := StrReplace(statsOverlayText, "[armour]", getPlayerArmor())
6996statsOverlayText := StrReplace(statsOverlayText, "[money]", FormatNumber(getPlayerMoney()))
6997statsOverlayText := StrReplace(statsOverlayText, "[skin]", getPlayerSkinId())
6998statsOverlayText := StrReplace(statsOverlayText, "[weaponid]", getPlayerWeaponId())
6999statsOverlayText := StrReplace(statsOverlayText, "[weapon]", getPlayerWeaponName())
7000statsOverlayText := StrReplace(statsOverlayText, "[freezed]", (IsPlayerFreezed() ? "ja" : "nein"))
7001statsOverlayText := StrReplace(statsOverlayText, "[vhealth]", getVehicleHealth())
7002statsOverlayText := StrReplace(statsOverlayText, "[vmodelid]", getVehicleModelId())
7003statsOverlayText := StrReplace(statsOverlayText, "[vmodel]", getVehicleModelName())
7004statsOverlayText := StrReplace(statsOverlayText, "[vspeed]", round(getVehicleSpeed()))
7005statsOverlayText := StrReplace(statsOverlayText, "[date]", A_DD . "." . A_MM . "." . A_Year)
7006statsOverlayText := StrReplace(statsOverlayText, "[motor]", motorStatus)
7007statsOverlayText := StrReplace(statsOverlayText, "[lock]", lockStatus)
7008statsOverlayText := StrReplace(statsOverlayText, "[light]", lightStatus)
7009statsOverlayText := StrReplace(statsOverlayText, "[checkpoint]", checkpointDistance)
7010statsOverlayText := StrReplace(statsOverlayText, "[kills]", FormatNumber(alltimeKills))
7011statsOverlayText := StrReplace(statsOverlayText, "[daykills]", FormatNumber(daykills))
7012statsOverlayText := StrReplace(statsOverlayText, "[deaths]", FormatNumber(alltimeDeaths))
7013statsOverlayText := StrReplace(statsOverlayText, "[tode]", FormatNumber(alltimeDeaths))
7014statsOverlayText := StrReplace(statsOverlayText, "[daydeaths]", FormatNumber(dayDeaths))
7015statsOverlayText := StrReplace(statsOverlayText, "[kd]", allKD)
7016statsOverlayText := StrReplace(statsOverlayText, "[daykd]", dayKD)
7017statsOverlayText := StrReplace(statsOverlayText, "[primcol]", statsOverlayPrimColor)
7018statsOverlayText := StrReplace(statsOverlayText, "[seccol]", statsOverlaySecColor)
7019statsOverlayText := StrReplace(statsOverlayText, "[white]", "{FFFFFF}")
7020if (!statsOverlayColors){
7021statsOverlayText := RegExReplace(statsOverlayText, "{\S{6}}", "")
7022}
7023TextSetString(statsOverlay, statsOverlayText)
7024}
7025return
7026
7027:?:/knast::
7028Suspend Permit
7029SendInput {enter}
7030if(ksek>=10)
7031{
7032sendchat("/g Ich bin noch " . kmin . ":" . ksek . " Min im Knast.")
7033}
7034else
7035{
7036sendchat("/g Ich bin noch " . kmin . ":0" . ksek . " Min im Knast.")
7037}
7038Suspend Off
7039
7040return
7041
7042:?:t/aa::
7043SendInput, {enter}
7044GetChatLine(0, chl0)
7045if (InStr(chl0, "Zum Annehmen der Kaution: ") AND InStr(chl0, "/annehmen anwalt")){
7046RegExMatch(chl0, "Zum Annehmen der Kaution: /annehmen Anwalt (.*)", anwalt)
7047SendChat("/annehmen anwalt " anwalt1 "")
7048return
7049}else{
7050AddChatMessage(PREFIX . "Dir wurde keine Kaution angeboten!")
7051}
7052return
7053
7054:?:/re::
7055Suspend, Permit
7056Loop, read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
7057{
7058If (!A_LoopReadLine)
7059Continue
7060If (InStr(A_LoopReadLine, "PN von ",12)) {
7061pntext := SubStr(A_LoopReadLine, 12)
7062RegExMatch(pntext, "PN von (.*)\: (.*)" ,aw)
7063user := aw1
7064text := aw2
7065}
7066}
7067if(user != "" || text != "")
7068{
7069AddChatMessage(PREFIX . "Letze PN von: {FC8E0F}" user . " {49D167}| {0D57E0}Nachricht: {FC8E0F}" text)
7070SendInput /pn %user%{space}
7071}
7072return
7073
7074
7075:?:/laufscripton::
7076Suspend, permit
7077laufscriptState := "on"
7078AddChatMessage(PREFIX . "Laufscript {008B00}Eingesschaltet")
7079IniWrite, %laufscriptState%, settings.ini, Laufscript, Status
7080SendInput {end}+{home}+{Del}+{Esc}
7081return
7082
7083:?:/laufscriptoff::
7084Suspend, permit
7085laufscriptState := "off"
7086AddChatMessage(PREFIX . "Laufscript {A70000}Ausgesschaltet")
7087IniWrite, %laufscriptState%, settings.ini, Laufscript, Status
7088SendInput {end}+{home}+{Del}+{Esc}
7089return
7090
7091
7092~Space::
7093if(isInChat()==1 || IsPlayerInAnyVehicle()==1 || laufscriptState == "off")
7094return
7095Sleep 30
7096while GetKeyState("Space", "P")
7097{
7098Send {space down}
7099Sleep 1
7100Send {space up}
7101Sleep 1
7102}
7103return
7104
7105:?:/atm1::
7106Suspend, Permit
7107setCheckpoint(-2656.3333,238.0748,5.1716, 3)
7108AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Cluckin Bell in Ocean Flats San Fierro)")
7109Suspend, Off
7110return
7111
7112:?:/atm2::
7113Suspend, Permit
7114setCheckpoint(-2693.0830,1371.5112,8.2589, 3)
7115AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Battery Point San Fierro)")
7116Suspend, Off
7117return
7118
7119:?:/atm3::
7120Suspend, Permit
7121setCheckpoint(-1546.1222,1222.1938,8.6029, 3)
7122AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Esplanade East San Fierro")
7123Suspend, Off
7124return
7125
7126:?:/atm4::
7127Suspend, Permit
7128setCheckpoint(-2176.2036,1163.7457,57.1029, 3)
7129AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Calton Heights San Fierro)")
7130Suspend, Off
7131return
7132
7133:?:/atm5::
7134Suspend, Permit
7135setCheckpoint(-2669.9788,786.6294,51.3029, 3)
7136AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Santa Flora San Fierro)")
7137Suspend, Off
7138return
7139
7140:?:/atm6::
7141Suspend, Permit
7142setCheckpoint(-2674.7229,634.6700,15.8029, 3)
7143AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Santa Flora San Fierro)")
7144Suspend, Off
7145return
7146
7147:?:/atm7::
7148Suspend, Permit
7149setCheckpoint(-2631.4512,-2.5079,7.5029, 3)
7150AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Ocean Flats San Fierro)")
7151Suspend, Off
7152return
7153
7154:?:/atm8::
7155Suspend, Permit
7156setCheckpoint(-2437.3970,2320.3435,6.3029, 3)
7157AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Bayside San Fierro)")
7158Suspend, Off
7159return
7160
7161:?:/atm9::
7162Suspend, Permit
7163setCheckpoint(142.6849,-221.3891,2.6589, 3)
7164AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Blueberry Los Santos)")
7165Suspend, Off
7166return
7167
7168:?:/atm10::
7169Suspend, Permit
7170setCheckpoint(-405.5802,-1433.2108,26.8589, 3)
7171AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Flint Range Los Santos")
7172Suspend, Off
7173return
7174
7175:?:/atm11::
7176Suspend, Permit
7177setCheckpoint(-2177.8772,-2435.4841,32.0029, 3)
7178AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Angel Pine San Fierro)")
7179Suspend, Off
7180return
7181
7182:?:/atm12::
7183Suspend, Permit
7184setCheckpoint(-175.4090,1088.8058,20.8589, 3)
7185AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (Fort Carson)")
7186Suspend, Off
7187return
7188
7189:?:/atm13::
7190Suspend, Permit
7191setCheckpoint(1191.5453,-916.7205,44.6029, 3)
7192AddChatMessage(PREFIX . "Checkpoint wurde gesetzt (BSN Los Santos)")
7193Suspend, Off
7194return
7195
7196
7197DrugTimer:
7198{
7199if (drugTime == 60) {
7200SendClientMessage(PREFIX . "Du kannst deine Drogen in " . SECCOL . "1 Minute {FFFFFF}ernten!")
7201} else if (drugTime == 0) {
7202SendClientMessage(PREFIX . "Du kannst deine Drogen " . SECCOL . "jetzt {FFFFFF}ernten!")
7203}
7204drugTime--
7205drugGrowTime++
7206}
7207return
7208equipProfile1Label:
7209{
7210if (IsInChat())
7211return
7212equipment := ""
7213Loop, 6 {
7214if (profile1_%A_Index% != "") {
7215equipment .= " " . profile1_%A_Index%
7216}
7217}
7218SendChat("/buygun" . equipment)
7219Sleep, 200
7220chat := readChatLine(0) . readChatLine(1)
7221SendChat("/heal")
7222}
7223return
7224equipProfile2Label:
7225{
7226if (IsInChat())
7227return
7228equipment := ""
7229Loop, 6 {
7230if (profile2_%A_Index% != "") {
7231equipment .= " " . profile2_%A_Index%
7232}
7233}
7234SendChat("/buygun" . equipment)
7235Sleep, 200
7236chat := readChatLine(0) . readChatLine(1)
7237if (RegExMatch(chat, "Du hast dich ausgerüstet, es wurden (\d+) Materialien benötigt\. \(Verbleibend: (\d+) Materialien\)", chat_)) {
7238SendClientMessage(PREFIX . "Ausrüstungsprofil " . SECCOL . "2 {FFFFFF}genutzt, es wurden " . chat_1 . " Materialien verbraucht.")
7239}
7240SendChat("/heal")
7241}
7242return
7243equipProfile3Label:
7244{
7245if (IsInChat())
7246return
7247equipment := ""
7248Loop, 6 {
7249if (profile3_%A_Index% != "") {
7250equipment .= " " . profile3_%A_Index%
7251}
7252}
7253SendChat("/buygun" . equipment)
7254Sleep, 200
7255chat := readChatLine(0) . readChatLine(1)
7256if (RegExMatch(chat, "Du hast dich ausgerüstet, es wurden (\d+) Materialien benötigt\. \(Verbleibend: (\d+) Materialien\)", chat_)) {
7257SendClientMessage(PREFIX . "Ausrüstungsprofil " . SECCOL . "3 {FFFFFF} genutzt, es wurden " . chat_1 . " Materialien verbraucht.")
7258}
7259SendChat("/heal")
7260}
7261return
7262motorSystemLabel:
7263{
7264if (IsInChat())
7265return
7266if (IsPlayerInAnyVehicle()) {
7267if (IsPlayerDriver()) {
7268if (getVehicleEngineState()) {
7269SendChat("/motor")
7270} else {
7271if (lockSystem) {
7272if (!getVehicleLockState()) {
7273SendChat("/lock")
7274}
7275}
7276SendChat("/motor")
7277Sleep, 200
7278SendChat("/licht")
7279}
7280} else {
7281SendClientMessage(PREFIX . "Du bist nicht der Fahrer eines Fahrzeuges.")
7282}
7283} else {
7284SendClientMessage(PREFIX . "Du bist in keinem Fahrzeug.")
7285}
7286}
7287return
7288~F::
7289{
7290if (IsInChat())
7291return
7292if (IsPlayerInAnyVehicle()) {
7293if (motorSystem) {
7294if (IsPlayerDriver() && getVehicleEngineState()) {
7295SendChat("/motor")
7296Sleep, 500
7297}
7298}
7299} else {
7300if (lockSystem) {
7301Loop {
7302if (IsPlayerDriver() && !getVehicleLockState()) {
7303Sleep, 200
7304if (!getVehicleLockState())
7305SendChat("/lock")
7306SendChat("/motor")
7307break
7308}
7309}
7310}
7311}
7312}
7313return
7314:?:/cd::
7315{
7316if (countdownRunning) {
7317SetTimer, CountdownTimer, Off
7318countdownRunning := false
7319SendChat("Der Countdown wurde gestoppt!")
7320} else {
7321countdownTime := PlayerInput("Sekunden: ")
7322if (countdownTime == "")
7323countdownTime := 3
7324if countdownTime is not number
7325return
7326cdChat := PlayerInput("Chat: ")
7327if (cdChat == "")
7328cdChat := "l"
7329SendChat("/" . cdChat . " Countdown:")
7330SetTimer, CountdownTimer, 1000
7331countdownRunning := true
7332}
7333}
7334return
7335CountdownTimer:
7336{
7337if (countdownTime == 0) {
7338SendChat("/" . cdChat . " Go Go Go!")
7339SetTimer, CountdownTimer, Off
7340countdownRunning := false
7341return
7342}
7343SendChat("/" . cdChat . " >>> " . countdownTime . " <<<")
7344countdownTime--
7345}
7346return
7347stopAutomaticSystemsLabel:
7348{
7349if (IsInChat())
7350return
7351if (countdownRunning) {
7352SetTimer, CountdownTimer, Off
7353countdownRunning := false
7354SendChat("/" . cdChat . " Der Countdown wurde abgebrochen!")
7355}
7356if (autoFindRunning) {
7357autoFindRunning := false
7358SendClientMessage(PREFIX . "Das automatische Suchen wurde deaktiviert.")
7359}
7360if (autoShowRunning) {
7361autoShowRunning := false
7362SendChat("/l Das automatische Zeigen wurde deaktiviert.")
7363}
7364if (autoFindChatRunning) {
7365autoFindChatRunning := false
7366SendChat("/" . autoFindChat . " Das automatische Suchen von " . playerToFindInChat . " wurde deaktiviert.")
7367}
7368}
7369return
7370:?:/wo::
7371{
7372SendChat("/g Wo befindet ihr euch und was ist das Problem?")
7373}
7374return
7375return
7376:?:/ver::
7377{
7378SendChat("/g Verstanden und bestätigt!")
7379}
7380return
7381:?:/needbk::
7382{
7383SendChat("/g Wird Verstärkung weiterhin benötigt?")
7384}
7385return
7386:?:/go::
7387{
7388SendChat("/g Einsatzleiter erlaubt Zugriff, GOGOGO!")
7389}
7390return
7391return
7392:?:/abholung::
7393{
7394zone := getPlayerZone()
7395city := getPlayerCity()
7396if (city == "" || city == "Unbekannt") {
7397SendChat("/g Erbitte Abholung in " . zone . "!")
7398} else {
7399SendChat("/g Erbitte Abholung in " . zone . ", " . city . "!")
7400}
7401}
7402return
7403:?:/kabholung::
7404{
7405SendChat("/g Eine Abholung wird nicht mehr benötigt.")
7406}
7407return
7408:?:/verf::
7409:?:/verfolgung::
7410{
7411name := PlayerInput("Spieler: ")
7412name := getFullName(name)
7413if (name == "")
7414return
7415id := getPlayerIdByName(name, true)
7416SendChat("/g Erbitte Unterstützung bei der Verfolgung von " . name . " (ID: " . id . ")!")
7417}
7418return
7419:?:/ort::
7420{
7421position := PlayerInput("Letzter bekannter Aufenthaltsort: ")
7422if (position == "")
7423return
7424SendChat("/g Letzter bekannter Aufenthaltsort: " . position . ".")
7425}
7426return
7427repeatLabel:
7428{
7429if (IsInChat())
7430return
7431SendInput, t{up}{enter}
7432}
7433return
7434stopwatchLabel:
7435{
7436if (IsInChat())
7437return
7438SendChat("/l Stoppuhr gestartet!")
7439stopwatch := 0
7440Loop {
7441stopwatch++
7442KeyWait, ., D T1
7443if (!ErrorLevel) {
7444minutes := Floor(stopwatch / 60)
7445seconds := stopwatch - (minutes * 60)
7446SendChat("/l Stoppuhr gestoppt: " . minutes . " Minuten, " . seconds . " Sekunden")
7447SendChat("/l Gesamt: " . stopwatch . " Sekunden")
7448break
7449}
7450}
7451}
7452return
7453eatFishLabel:
7454{
7455if (IsInChat())
7456return
7457SendChat("/eat " . currentFish)
7458currentFish++
7459if (currentFish == 6) {
7460currentFish := 1
7461}
7462}
7463return
7464:?:/kd::
7465{
7466IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
7467IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
7468IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
7469IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
7470allKD := Round(alltimeKills / alltimeDeaths, 2)
7471dayKD := Round(dayKills / dayDeaths, 2)
7472SendClientMessage(PREFIX . "Kills: " . SECCOL . FormatNumber(alltimeKills) . " {FFFFFF}Tages-Kills: " . SECCOL . FormatNumber(dayKills))
7473SendClientMessage(PREFIX . "Tode: " . SECCOL . FormatNumber(alltimeDeaths) . " {FFFFFF}Tages-Tode: " . SECCOL . FormatNumber(dayDeaths))
7474SendClientMessage(PREFIX . "K/D: " . SECCOL . allKD . " {FFFFFF}Tages-K/D: " . SECCOL . dayKD)
7475}
7476return
7477:?:/setkills::
7478:?:/settode::
7479:?:/setdeaths::
7480{
7481blockDialog()
7482SendChat("/stats")
7483Sleep, 100
7484title := getDialogCaption()
7485dialog := getDialogText()
7486unblockDialog()
7487if (RegExMatch(dialog, statsFormat, dialog_)) {
7488kills := dialog_17
7489deaths := dialog_18
7490IniWrite, %deaths%, stats.ini, Gesamt, Tode
7491IniWrite, %kills%, stats.ini, Gesamt, Kills
7492} else {
7493SendClientMessage(PREFIX . "Beim automatischen Auslesen der Kills und Tode ist ein Fehler aufgetreten.")
7494SendClientMessage(PREFIX . "Du kannst deine Statistiken nun manuell eintragen.")
7495kills := PlayerInput("Kills: ")
7496if kills is not number
7497return
7498deaths := PlayerInput("Tode: ")
7499if deaths is not number
7500return
7501IniWrite, %deaths%, stats.ini, Gesamt, Tode
7502IniWrite, %kills%, stats.ini, Gesamt, Kills
7503}
7504SendClientMessage(PREFIX . "Deine Kills wurden auf " . SECCOL . FormatNumber(kills) . " {FFFFFF}und deine Tode auf " . SECCOL . FormatNumber(deaths) . " {FFFFFF}gesetzt.")
7505}
7506return
7507statsLabel:
7508if (isInChat())
7509return
7510
7511:?:/hdf::
7512:?:/ruhe::
7513{
7514SendChat("Sein Sie bitte still.")
7515}
7516return
7517:?:/afk::
7518{
7519if (afk) {
7520afk := false
7521SendChat("/g Ich bin nun nicht mehr AFK und melde mich zurück!")
7522} else {
7523afkTime := PlayerInput("Zeit: ")
7524if (afkTime != "") {
7525if afkTime is number
7526{
7527afk := true
7528SendChat("/g Ich melde mich AFK, Zeit: " . afkTime . " Minuten")
7529} else {
7530SendClientMessage(PREFIX . "{FF0000}Du musst eine Zeit angeben!")
7531}
7532}
7533}
7534}
7535return
7536:?:/alotto::
7537{
7538if (lottoNumber == 0) {
7539Random, randomNumber, 1, 249
7540SendChat("/lotto " . randomNumber)
7541} else if (lottoNumber == 201) {
7542SendChat("/lotto " . getId())
7543} else {
7544SendChat("/lotto " . lottoNumber)
7545}
7546}
7547return
7548return
7549:?:/ja::
7550:?:/jas::
7551:?:/jam::
7552{
7553SendChat("Ja, was kann ich für dich tun?")
7554}
7555return
7556:?:/tag::
7557{
7558FormatTime, time,, HH
7559if (time >= 12 && time < 20) {
7560SendChat("Guten Tag, wie kann ich dir helfen?")
7561} else if (time >= 20 || time == 0) {
7562SendChat("Guten Abend, wie kann ich dir helfen?")
7563} else if (time >= 1 && time < 12) {
7564SendChat("Guten Morgen, wie kann ich dir helfen?")
7565}
7566}
7567return
7568:?:/bye::
7569{
7570FormatTime, time,, HH
7571if (time >= 12 && time < 20) {
7572SendChat("Ich wünsche dir noch einen schönen Tag. Auf Wiedersehen!")
7573} else if (time >= 20 || time == 0) {
7574SendChat("Ich wünsche dir noch einen schönen Abend. Auf Wiedersehen!")
7575} else if (time >= 1 && time < 12) {
7576SendChat("Ich wünsche dir noch einen schönen Tag. Auf Wiedersehen!")
7577}
7578}
7579return
7580:?:/minuten::
7581{
7582seconds := PlayerInput("Sekunden: ")
7583if (seconds != "") {
7584minutes := Floor(seconds / 60)
7585SendClientMessage(PREFIX . SECCOL . FormatNumber(seconds) . " {FFFFFF}Sekunden sind " . SECCOL . FormatNumber(minutes) " {FFFFFF}Minuten.")
7586}
7587}
7588return
7589:?:/link::
7590{
7591Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
7592{
7593if (RegExMatch(A_LoopReadLine, "(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})(\S*)")) {
7594RegExMatch(A_LoopReadLine, "(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})(\S*)", url_)
7595}
7596if (RegExMatch(A_LoopReadLine, "http:\/\/(\S+)")) {
7597RegExMatch(A_LoopReadLine, "http\:\/\/(\S+)", url_)
7598url := "http://" . url_1
7599} else if (RegExMatch(A_LoopReadLine, "https:\/\/(\S+)")) {
7600RegExMatch(A_LoopReadLine, "https\:\/\/(\S+)", url_)
7601url := "https://" . url_1
7602} else if (RegExMatch(A_LoopReadLine, "www.(\S+)")) {
7603RegExMatch(A_LoopReadLine, "www.(\S+)", url_)
7604url := "www." . url_1
7605}
7606}
7607clipboard := url
7608SendClientMessage(PREFIX . "Der folgende Link wurde in die Zwischenablage kopiert:")
7609SendClientMessage(PREFIX . SECCOL . url)
7610}
7611return
7612:?:/savechat::
7613{
7614FileCreateDir, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups
7615FormatTime, zeit, %A_Now%,dd.MM.yy - HH.mm
7616FileCopy, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups\chatlog %zeit% Uhr.txt, 0
7617SendClientMessage(PREFIX . "Es wurde ein Backup des aktuellen Chatlogs erstellt!")
7618}
7619return
7620:?:/cc::
7621:?:/chatclear::
7622{
7623Loop, 100 {
7624AddChatMessage("")
7625}
7626}
7627return
7628:?:/coords::
7629{
7630GetPlayerPos(posX, posY, posZ)
7631SendClientMessage(PREFIX . "x: " . SECCOL . posX . " {FFFFFF}y: " . SECCOL . posY . " {FFFFFF}z: " . SECCOL . posZ)
7632}
7633return
7634:?:/fpslock::
7635{
7636if (fpsLock()) {
7637SendClientMessage(PREFIX . "Deine FPS wurden wieder beschränkt.")
7638} else {
7639SendClientMessage(PREFIX . "Beim Beschränken deiner FPS ist ein Fehler aufgetreten.")
7640}
7641}
7642return
7643:?:/fpsunlock::
7644{
7645if (fpsUnlock()) {
7646SendClientMessage(PREFIX . "Die Beschränkung deiner FPS wurde aufgehoben.")
7647} else {
7648SendClientMessage(PREFIX . "Beim Aufheben der Beschränkung deiner FPS ist ein Fehler aufgetreten.")
7649}
7650}
7651return
7652:?:/relog::
7653{
7654SendClientMessage(PREFIX . "Du verbindest nun neu...")
7655restart()
7656}
7657return
7658SearchEnemyTimer:
7659{
7660IfWinNotActive, GTA:SA:MP
7661return
7662players := getStreamedInPlayersInfo()
7663for i, o in players {
7664updatePlayerFraction(o.ID)
7665}
7666if (enemyJoinLeaveMessage) {
7667if (!SQLiteDB.Query("SELECT name, fraction FROM enemies WHERE fraction != '0' ORDER BY fraction ASC, name ASC;", recordSet)) {
7668FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
7669return
7670}
7671if (recordSet.HasRows) {
7672while (recordSet.Next(row) >= 1) {
7673enemyName := row[1]
7674enemyFraction := row[2]
7675playerID := getPlayerIdByName(enemyName, true)
7676if (ErrorLevel || playerID == -2) {
7677if (debug) {
7678SendClientMessage(PREFIX . "Fehler beim Auslesen der ID von " . enemyName . " (" . playerID . "): " . ErrorLevel)
7679}
7680continue
7681}
7682if (playerID != -1) {
7683if (!onlineEnemies.HasKey(enemyName)) {
7684onlineEnemies[enemyName] := enemyFraction
7685if (!firstEnemiesTimerRun && friendMessages) {
7686SendClientMessage(PREFIX . SECCOL . enemyName . " {FFFFFF}aus der Fraktion " . SECCOL . getFraktionByID(enemyFraction) . " {FFFFFF}ist {00FF00}online {FFFFFF}gekommen.")
7687}
7688}
7689} else {
7690if (onlineEnemies.HasKey(enemyName)) {
7691onlineEnemies.Delete(enemyName)
7692if (!firstEnemiesTimerRun && friendMessages) {
7693SendClientMessage(PREFIX . SECCOL . enemyName . " {FFFFFF}aus der Fraktion " . SECCOL . getFraktionByID(enemyFraction) . " {FFFFFF}ist {FF0000}offline {FFFFFF}gegangen.")
7694}
7695}
7696}
7697}
7698}
7699recordSet.Free()
7700if (firstEnemiesTimerRun) {
7701firstEnemiesTimerRun := false
7702}
7703}
7704}
7705return
7706~RButton::
7707{
7708while GetKeyState("RButton", "P")
7709{
7710playerPed := getTargetPed()
7711playerID := getIdByPed(playerPed)
7712if (updatePlayerFraction(playerID)) {
7713Sleep, 1500
7714}
7715}
7716}
7717return
7718updatePlayerFraction(playerID) {
7719global SQLiteDB
7720playerName := getPlayerNameByID(playerID)
7721playerSkin := getTargetPlayerSkinIdById(playerID)
7722playerFraction := getFraktionBySkinID(playerSkin)
7723if (playerName != "" && playerID != -1 && playerSkin != -1 && !ErrorLevel) {
7724if (!SQLiteDB.Query("SELECT fraction FROM enemies WHERE name LIKE '" . playerName . "';", recordSet)) {
7725FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
7726return false
7727}
7728if (!recordSet.HasRows) {
7729if (SQLiteDB.exec("INSERT INTO enemies (name, fraction, updated) VALUES ('" . playerName . "', '" . playerFraction . "', '" . getUnixTimestamp(A_Now) . "');")) {
7730if (playerFraction != 0 && enemyAddedMessage) {
7731SendClientMessage(PREFIX . SECCOL . playerName . " {FFFFFF}(" . SECCOL . getFraktionByID(playerFraction) . "{FFFFFF}) wurde in die Gegnerliste aufgenommen!")
7732}
7733}
7734} else {
7735if (recordSet.Next(row)) {
7736oldFraction := row[1]
7737if (oldFraction != playerFraction) {
7738if (SQLiteDB.exec("UPDATE enemies SET name = '" . playerName . "', fraction = '" . playerFraction . "', updated = '" . getUnixTimestamp(A_Now) . "' WHERE name = '" . playerName . "';")) {
7739if (enemyUpdatedMessage) {
7740if (playerFraction != 0) {
7741SendClientMessage(PREFIX . SECCOL . playerName . " {FFFFFF}(" . SECCOL . getFraktionByID(playerFraction) . "{FFFFFF}) wurde in der Gegnerliste aktualisiert (Alte Fraktion: " . getFraktionByID(oldFraction) . ")!")
7742} else {
7743SendClientMessage(PREFIX . SECCOL . playerName . " {FFFFFF}wurde aus der Gegnerliste entfernt (Alte Fraktion: " . getFraktionByID(oldFraction) . ")!")
7744}
7745}
7746}
7747}
7748}
7749}
7750recordSet.Free()
7751return true
7752}
7753return false
7754}
7755:?:/addfreund::
7756:?:/addfriend::
7757{
7758friendNameInput := PlayerInput("Name/ID des Freundes: ")
7759if (friendNameInput == "")
7760return
7761friendName := getFullName(friendNameInput)
7762if (friendName == "") {
7763friendName := friendNameInput
7764}
7765if (!SQLiteDB.Query("SELECT name FROM friends WHERE name LIKE '" . friendName . "';", recordSet)) {
7766FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
7767SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten! Schau bitte in die log.txt und melde den Fehler bei Martin!")
7768}
7769if (!recordSet.HasRows) {
7770if (SQLiteDB.exec("INSERT INTO friends (name, added) VALUES ('" . friendName . "', '" . getUnixTimestamp(A_Now) . "');")) {
7771SendClientMessage(PREFIX . SECCOL . friendName . " {FFFFFF}wurde in die Freundesliste aufgenommen!")
7772} else {
7773FileAppend, % "SQLite Error: Query - Msg: '" . SQLiteDB.ErrorMsg . "' - Code: " . SQLiteDB.ErrorCode, log.txt
7774SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten! Schau bitte in die log.txt und melde den Fehler bei Martin!")
7775}
7776} else {
7777if (recordSet.Next(row)) {
7778if (SQLiteDB.exec("UPDATE friends SET name = '" . friendName . "', updated = '" . getUnixTimestamp(A_Now) . "' WHERE name = '" . friendName . "';")) {
7779SendClientMessage(PREFIX . SECCOL . friendName . " {FFFFFF}wurde in der Freundesliste aktualisiert!")
7780} else {
7781FileAppend, % "SQLite Error: Query - Msg: '" . SQLiteDB.ErrorMsg . "' - Code: " . SQLiteDB.ErrorCode, log.txt
7782SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten! Schau bitte in die log.txt und melde den Fehler bei Martin!")
7783}
7784}
7785}
7786recordSet.Free()
7787}
7788return
7789:?:/remfreund::
7790:?:/delfreund::
7791:?:/remfriend::
7792:?:/delfriend::
7793{
7794friendNameInput := PlayerInput("Name/ID des Freundes: ")
7795if (friendNameInput == "")
7796return
7797friendName := getFullName(friendNameInput)
7798if (friendName == "") {
7799friendName := friendNameInput
7800}
7801if (SQLiteDB.exec("DELETE FROM friends WHERE name = '" . friendName . "';")) {
7802SendClientMessage(PREFIX . SECCOL . friendName . " {FFFFFF}wurde aus der Freundesliste entfernt!")
7803if (onlineFriends.HasKey(friendName)) {
7804textLabelID := onlineFriends.Delete(friendName)
7805if (textLabelID != -1) {
7806deleteTextLabel(textLabelID)
7807}
7808}
7809}
7810}
7811return
7812:?:/dall::
7813{
7814Loop, 2048 {
7815deleteTextLabel(A_Index - 1)
7816}
7817SendClientMessage(PREFIX . "Es wurden ALLE TextLabel gelöscht (auch serverseitige).")
7818}
7819return
7820:?:/freunde::
7821:?:/friends::
7822{
7823if (!SQLiteDB.Query("SELECT name FROM friends ORDER BY name ASC;", recordSet)) {
7824SendClientMessage(PREFIX . "Es ist ein SQLite-Fehler aufgetreten! Sieh' bitte in der log.txt nach und informiere Martin im Forum.")
7825FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
7826return
7827}
7828if (recordSet.HasRows) {
7829dialog := "Name`tID`tStatus"
7830playerCount := 0
7831while (recordSet.Next(row) >= 1) {
7832playerName := row[1]
7833playerID := getPlayerIdByName(playerName, true)
7834dialog .= "`n" . playerName . "`t" . (playerID == -1 ? "-" : playerID) . "`t" . (playerID == -1 ? "{FF0000}offline" : "{00FF00}online")
7835if (playerID != -1) {
7836playerCount++
7837}
7838}
7839Sleep, 100
7840ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Freunde online: " . SECCOL . playerCount, dialog, "OK")
7841} else {
7842SendClientMessage(PREFIX . "Du hast noch keine Freunde eingespeichert! Benutze " . SECCOL . "/addfriend")
7843}
7844recordSet.Free()
7845}
7846return
7847:?:/freundelabel::
7848:?:/friendslabel::
7849:?:/friendlabels::
7850:?:/friendslabels::
7851:?:/freundlabels::
7852:?:/freundelabels::
7853{
7854if (showFriendLabels) {
7855showFriendLabels := false
7856for friendName, textLabelID in onlineFriends {
7857if (textLabelID != -1) {
7858deleteTextLabel(textLabelID)
7859onlineFriends[friendName] := -1
7860}
7861}
7862SendClientMessage(PREFIX . "TextLabel über den Köpfen von Freunden {FF0000}deaktiviert{FFFFFF}.")
7863} else {
7864showFriendLabels := true
7865for friendName, textLabelID in onlineFriends {
7866if (textLabelID == -1) {
7867playerID := getPlayerIdByName(friendName)
7868if (playerID != -1) {
7869textLabelID := createTextLabel("[Freund]", 0xFF0000FF, 0, 0, 0.5, 20.0, 1, playerID)
7870onlineFriends[friendName] := textLabelID
7871}
7872}
7873}
7874SendClientMessage(PREFIX . "TextLabel über den Köpfen von Freunden {00FF00}aktiviert{FFFFFF}.")
7875}
7876}
7877return
7878FriendsTimer:
7879{
7880IfWinNotActive, GTA:SA:MP
7881return
7882if (!SQLiteDB.Query("SELECT name FROM friends ORDER BY name ASC;", recordSet)) {
7883FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
7884return
7885}
7886if (recordSet.HasRows) {
7887while (recordSet.Next(row) >= 1) {
7888friendName := row[1]
7889playerID := getPlayerIdByName(friendName, true)
7890if (ErrorLevel || playerID == -2) {
7891if (debug) {
7892SendClientMessage(PREFIX . "Fehler beim Auslesen der ID von " . friendName . " (" . playerID . "): " . ErrorLevel)
7893}
7894continue
7895}
7896if (playerID != -1) {
7897if (!onlineFriends.HasKey(friendName)) {
7898textLabelID := -1
7899if (showFriendLabels) {
7900textLabelID := createTextLabel("[Freund]", 0xFF0000FF, 0, 0, 0.5, 20.0, 1, playerID)
7901}
7902onlineFriends[friendName] := textLabelID
7903if (!firstFriendsTimerRun && friendMessages) {
7904SendClientMessage(PREFIX . "Dein Freund " . SECCOL . friendName . " {FFFFFF}ist {00FF00}online {FFFFFF}gekommen.")
7905}
7906}
7907} else {
7908if (onlineFriends.HasKey(friendName)) {
7909textLabelID := onlineFriends.Delete(friendName)
7910if (textLabelID != -1) {
7911deleteTextLabel(textLabelID)
7912}
7913if (!firstFriendsTimerRun && friendMessages) {
7914SendClientMessage(PREFIX . "Dein Freund " . SECCOL . friendName . " {FFFFFF}ist {FF0000}offline {FFFFFF}gegangen.")
7915}
7916}
7917}
7918}
7919}
7920recordSet.Free()
7921if (firstFriendsTimerRun) {
7922firstFriendsTimerRun := false
7923}
7924}
7925return
7926storesLabel:
7927{
7928sortByString := ""
7929if (sortStoresBy == 1) {
7930sortByString := ""
7931} else if (sortStoresBy == 2) {
7932sortByString := "type"
7933} else if (sortStoresBy == 3) {
7934sortByString := "distance"
7935} else if (sortStoresBy == 4) {
7936sortByString := "status"
7937} else {
7938SendClientMessage(PREFIX . "Ungültige Sortierung! Verwende Standardsortierung.")
7939}
7940coords := getCoordinates()
7941result := URLDownloadToVar(robBaseURL . "api/loadallstores.php?x=" . coords[1] . "&y=" . coords[2] . "&z=" . coords[3] . "&sort=" . sortByString)
7942allStores := JSON.Load(result)
7943if (allStores["error"]) {
7944SendClientMessage(PREFIX . "Beim Laden der Stores ist ein Fehler aufgetreten!")
7945} else {
7946dialog := "Typ`tGK`tOrt und Entfernung`tStatus`n"
7947for i, entry in allStores["stores"] {
7948store := entry["store"]
7949gk := entry["gk"]
7950x := entry["x"]
7951y := entry["y"]
7952z := entry["z"]
7953status := entry["status"]
7954distance := entry["distance"]
7955dialog .= store . "`t" . gk . "`t" . calculateZone(x, y, z) . " (" . distance . "m)`t" . status
7956if (i < allStores["stores"].Length())
7957dialog .= "`n"
7958}
7959showDialog(DIALOG_STYLE_TABLIST_HEADERS, "Übersicht der Stores", dialog, "Schließen")
7960}
7961}
7962return
7963~LButton::
7964{
7965Sleep, 200
7966if (isDialogOpen()) {
7967caption := getDialogCaption()
7968if (RegExMatch(caption, "Übersicht der Stores")) {
7969line := getDialogLine(getDialogIndex())
7970if (RegExMatch(line, "(\S+)`t(\S+)`t(.+)`t(.+)", line_)) {
7971type := line_1
7972gk := line_2
7973for index, entry in allStores["stores"] {
7974if (entry["store"] == type && entry["gk"] == gk) {
7975if (RegExMatch(type, "{(\S+)}(\S+)", type_)) {
7976type := type_2
7977}
7978x := entry["x"]
7979y := entry["y"]
7980z := entry["z"]
7981playerCoords := getCoordinates()
7982distance := Round(getDistanceToPoint(x, y, z, playerCoords[1], playerCoords[2], playerCoords[3]))
7983setCheckpoint(x, y, z, 3)
7984SendClientMessage(PREFIX . "Store " . SECCOL . gk . " {FFFFFF}(" . type . ") in " . SECCOL . calculateZone(x, y, z) . " {FFFFFF}(" . SECCOL . distance . "m {FFFFFF}entfernt)")
7985}
7986}
7987}
7988} else if (RegExMatch(caption, "Verfügbare Aufträge")) {
7989line := getDialogLine(getDialogIndex())
7990if (RegExMatch(line, "(\d+)`t(.+) \((\S+)\)`t(.+)`t(.+)", line_)) {
7991SendChat("/delivery " . line_1)
7992}
7993} else if (RegExMatch(caption, "Übersicht der Tankstellen")) {
7994line := getDialogLine(getDialogIndex())
7995if (RegExMatch(line, "{\S+}(.+)`t(.+)`t{\S+}(\d+)\$ {\S+}- \S+ m`t{\S+}.+ {\S+}\(\S+\)", line_)) {
7996name := line_1
7997owner := line_2
7998for index, entry in gasstations {
7999if (entry["name"] == name && entry["owner"] == owner) {
8000x := entry["x"]
8001y := entry["y"]
8002z := entry["z"]
8003playerCoords := getCoordinates()
8004distance := Round(getDistanceToPoint(x, y, z, playerCoords[1], playerCoords[2], playerCoords[3]))
8005setCheckpoint(x, y, z, 3)
8006SendClientMessage(PREFIX . "Tankstelle " . SECCOL . name . " {FFFFFF}(" . SECCOL . entry["price"] . "${FFFFFF}) in " . SECCOL . FormatNumber(distance) . " m {FFFFFF}Entfernung.")
8007}
8008}
8009}
8010}
8011}
8012}
8013return
8014pauseLabel:
8015Suspend, permit
8016Suspend
8017if (A_IsSuspended) {
8018SendClientMessage(PREFIX . "Keybinder & Timer {FF0000}pausiert{FFFFFF}.")
8019SetTimer, ChatTimer, Off
8020SetTimer, TankTimer, Off
8021SetTimer, FillCustoms, Off
8022SetTimer, KillTimer, Off
8023SetTimer, SearchEnemyTimer, Off
8024SetTimer, FriendsTimer, Off
8025} else {
8026SendClientMessage(PREFIX . "Keybinder & Timer {00FF00}aktiviert{FFFFFF}.")
8027SetTimer, ChatTimer, 100
8028SetTimer, TankTimer, 100
8029SetTimer, FillCustoms, 500
8030SetTimer, KillTimer, 100
8031SetTimer, SearchEnemyTimer, 2500
8032SetTimer, FriendsTimer, 1000
8033}
8034return