Advertisement
comniemeer

8Bit.ahk - 1.3.7

Feb 3rd, 2018
1,692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #IfWinActive, GTA:SA:MP
  2. #SingleInstance, force
  3.  
  4. #Persistent
  5. #NoEnv
  6.  
  7. #Include, include/UDF.ahk
  8. #Include, include/API.ahk
  9. #Include, include/JSON.ahk
  10.  
  11. #DEFINE overlay
  12.  
  13. SetWorkingDir, %A_ScriptDir%
  14.  
  15. SetTimer, AntiDecompile, 100
  16.  
  17. IfExist, update.bat
  18. {
  19.     FileDelete, update.bat
  20. }
  21.  
  22. global baseURL := "https://comniemeer.de/projects/8bitbinder/"
  23. global robBaseURL := "https://comniemeer.de/projects/robbinder/"
  24. global gkBaseURL := "https://lsmd.comniemeer.de/"
  25.  
  26. projectName := "8Bit"
  27. version := "1.3.7"
  28.  
  29. IniRead, kVersion, settings.ini, Info, Version, %A_Space%
  30.  
  31. if (kVersion != version) {
  32.     IniWrite, %version%, settings.ini, Info, Version
  33.    
  34.     if (version == "1.0.1") {
  35.         FileDelete, images\Banner.png
  36.     } else if (version == "1.1.3") {
  37.         IniWrite, 0, stats.ini, Fischsystem, Fischgeld
  38.     }
  39. }
  40.  
  41. errorMessage := "Es ist ein unbekannter Fehler aufgetreten!"
  42.  
  43. if (IsSAMPAvailable()) {
  44.     if (!InStr(getServerName(), "GTA-City Reallife") || (getServerIP() != "31.214.160.11" && getServerIP() != "5.83.163.101") || getServerPort() != "7777") {
  45.         errorMessage := "Du musst auf RPG-City verbunden sein (server.rpg-city.de bzw. blue.rpg-city.de)!`n"
  46.         errorMessage .= "`nEs kann sein, dass der Keybinder auch nicht funktioniert, weil du mit der SA:MP-Version 0.3.7-R2 spielst.`nDeshalb solltest du diese Version zuerst über die SAMPUninstall.exe in deinem GTA-Verzeichnis deinstallieren.`nAnschließend installierst du die alte Version, die du über folgenden Link herunterladen kannst: http://files.sa-mp.com/sa-mp-0.3.7-install.exe`nNun sollte der Keybinder wieder starten!"
  47.     } else {
  48.         result := UrlDownloadToVar(baseURL . "api/checkwhitelist.php?name=" . getUsername() . "&version=" . version)
  49.        
  50.         if (result == "true") {
  51.             Goto, Start
  52.         } else if (result == "false") {
  53.             errorMessage := "Du stehst nicht auf der Whitelist!`nBitte lass dich im Forum im Keybinder-Thema eintragen."
  54.         } else if (result == "ERROR_CONNECTION") {
  55.             errorMessage := "Aktuell liegt ein Fehler in der Verbindung zum Server (comniemeer.de) vor, bitte versuche es gleich oder später erneut!"
  56.         } else {
  57.             errorMessage := "Fehler bei der Überprüfung der Whitelist: " . result
  58.         }
  59.     }
  60. } else {
  61.     errorMessage := "Der Keybinder hat keinen Zugriff auf dein GTA, um deinen Namen auslesen zu können.`nEine mögliche Lösung ist das Starten des Keybinders als Administrator (Rechtsklick -> Als Administrator ausführen).`n`nSollte der Keybinder immer noch nicht starten, versuche AutoHotkey zu installieren.`nLade es dir hier herunter: https://autohotkey.com/download/`nInstalliere das Programm, aber achte darauf, dass du unten bei Version 'ANSI 32-bit' auswählst!`nAnschließend versuche den Keybinder zu starten.`n`nSollte das alles auch nicht funktionieren, kann ich dir leider nicht helfen."
  62. }
  63.  
  64. MsgBox, 16, Fehler, Es ist ein Fehler bei der Authentifizierung aufgetreten`, der Zugriff wurde verweigert.`n`n%errorMessage%
  65. ExitApp
  66. return
  67.  
  68. Start:
  69. {
  70.     newver := URLDownloadToVar(baseURL . "downloads/version.txt")
  71.    
  72.     if (compareVersions(version, newver) == -1) {
  73.         changelog := URLDownloadToVar(baseURL . "downloads/updatelog.single.txt")
  74.        
  75.         MsgBox, 68, %projectName% Keybinder - Version %version%, Es wurde eine neue Keybinderversion (Version %newver%) veröffentlicht!`nMöchtest du diese nun herunterladen?`n`n%changelog%
  76.        
  77.         IfMsgBox, Yes
  78.         {
  79.             Progress, 25, Lädt neue Version herunter, Der Keybinder wird nun geupdated..., Update
  80. #IFDEF nooverlay
  81.             extraVersion := "_nov"
  82. #ELSE
  83.             extraVersion := ""
  84. #ENDIF
  85.            
  86.             UrlDownloadToFile, %baseURL%downloads/%projectName%%extraVersion%.exe, %projectName%%extraVersion%.new.exe
  87.            
  88.             Progress, 75, Installiere Update, Der Keybinder wird nun geupdated..., Update
  89.             Sleep, 500
  90.            
  91.             updateBat =
  92.                 (LTrim
  93.                     ping 127.0.0.1 -n 2 > nul
  94.                     Del "%projectName%%extraVersion%.exe"
  95.                     Rename "%projectName%%extraVersion%.new.exe" "%projectName%%extraVersion%.exe"
  96.                     "%projectName%%extraVersion%.exe"
  97.                 )
  98.            
  99.             FileAppend, %updateBat%, update.bat
  100.             Run, update.bat, , hide
  101.            
  102.             Progress, 100, Abgeschlossen, Der Keybinder wird nun geupdated..., Update
  103.            
  104.             ExitApp
  105.         }
  106.     }
  107.    
  108.     unBlockChatInput()
  109.    
  110.     chatLogFile := FileOpen(A_MyDocuments . "\GTA San Andreas User Files\SAMP\chatlog.txt", "r")
  111.     firstChatLogRun := true
  112.     chatLogLines := []
  113.    
  114.     FormatTime, time, , dd.MM.yyyy HH:mm:ss
  115.    
  116.     IfNotExist, bin
  117.     {
  118.         FileCreateDir, bin
  119.     }
  120.    
  121.     IfNotExist, bin\sqlite3.dll
  122.     {
  123.         URLDownloadToFile, %baseURL%downloads/bin/sqlite3.dll, bin\sqlite3.dll
  124.     }
  125.    
  126.     IniRead, SQLite3DllPath, SQLiteDB.ini, Main, DllPath, %A_Space%
  127.    
  128.     if (SQLite3DllPath != "bin\SQLite3.dll") {
  129.         IniWrite, % "bin\SQLite3.dll", SQLiteDB.ini, Main, DllPath
  130.     }
  131.    
  132.     #Include, include/Class_SQLiteDB.ahk
  133.    
  134.     SQLiteDB := new SQLiteDB
  135.    
  136.     SQLiteDB.OpenDB(projectName . ".db")
  137.    
  138.     if (!SQLiteDB.Exec("CREATE TABLE IF NOT EXISTS enemies (name VARCHAR(35), fraction TINYINT(2), updated INT(10), PRIMARY KEY (name));")) {
  139.         MsgBox, 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!"
  140.        
  141.         SQLiteDB.CloseDB()
  142.         ExitApp
  143.     }
  144.    
  145.     if (!SQLiteDB.Exec("CREATE TABLE IF NOT EXISTS friends (name VARCHAR(35), added INT(10), PRIMARY KEY (name));")) {
  146.         MsgBox, 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!"
  147.        
  148.         SQLiteDB.CloseDB()
  149.         ExitApp
  150.     }
  151.    
  152.     SQLiteDB.Exec("UPDATE enemies SET fraction = '0' WHERE fraction = '1' OR fraction = '2' OR fraction = '3';")
  153.    
  154.     registeredHotkeys := Object()
  155.     defaultHotkeysArray := Object()
  156.    
  157.     defaultHotkeysArray["motorSystem"] := "~m"
  158.     defaultHotkeysArray["jobexecute"] := "~j"
  159.     defaultHotkeysArray["stats"] := "~-"
  160.     defaultHotkeysArray["tempomat"] := "~."
  161.     defaultHotkeysArray["equipProfile1"] := "F1"
  162.     defaultHotkeysArray["equipProfile2"] := "F2"
  163.     defaultHotkeysArray["equipProfile3"] := "F3"
  164.     defaultHotkeysArray["robstore"] := "~r"
  165.     defaultHotkeysArray["stores"] := "~^r"
  166.     defaultHotkeysArray["repeat"] := "~ä"
  167.     defaultHotkeysArray["stopAutomaticSystems"] := "~<"
  168.     defaultHotkeysArray["pause"] := "!Pause"
  169.    
  170.     IfNotExist, Hotkeys.ini
  171.     {
  172.         for key, value in defaultHotkeysArray {
  173.             IniWrite, %value%, Hotkeys.ini, Hotkeys, %key%
  174.         }
  175.     }
  176.    
  177.     for key, value in defaultHotkeysArray {
  178.         IniRead, hk, Hotkeys.ini, Hotkeys, %key%, %A_Space%
  179.        
  180.         if (!hk) {
  181.             alreadyRegistered := false
  182.            
  183.             for k, v in registeredHotkeys {
  184.                 hk2 := StrReplace(value, "~", "")
  185.                 v2 := StrReplace(v, "~", "")
  186.                
  187.                 if (hk2 = v2 && StrLen(hk2) == StrLen(v2)) {
  188.                     alreadyRegistered := true
  189.                     alreadyRegisteredKey := k
  190.                     alreadyRegisteredValue := v
  191.                     break
  192.                 }
  193.             }
  194.            
  195.             if (!alreadyRegistered) {
  196.                 ;IniWrite, %value%, Hotkeys.ini, Hotkeys, %key%
  197.                 Hotkey, %value%, %key%Label
  198.                 StringReplace, %key%NoMods, value, ~
  199.                
  200.                 registeredHotkeys[key] := value
  201.             } else {
  202.                 FileAppend, [%time%] Der Standard-Hotkey für %key% (%value%) ist bereits registriert (%alreadyRegisteredKey% - %alreadyRegisteredValue%)!`n, log.txt
  203.             }
  204.         } else if (hk != "---") {
  205.             alreadyRegistered := false
  206.            
  207.             for k, v in registeredHotkeys {
  208.                 hk2 := StrReplace(hk, "~", "")
  209.                 v2 := StrReplace(v, "~", "")
  210.                
  211.                 if (hk2 = v2 && StrLen(hk2) == StrLen(v2)) {
  212.                     alreadyRegistered := true
  213.                     alreadyRegisteredKey := k
  214.                     alreadyRegisteredValue := v
  215.                     break
  216.                 }
  217.             }
  218.            
  219.             if (!alreadyRegistered) {
  220.                 Hotkey, %hk%, %key%Label
  221.                 StringReplace, %key%NoMods, hk, ~
  222.                
  223.                 registeredHotkeys[key] := hk
  224.             } else {
  225.                 FileAppend, [%time%] Der Hotkey für %key% (%hk%) ist bereits registriert (%alreadyRegisteredKey% - %alreadyRegisteredValue%)!`n, log.txt
  226.             }
  227.         }
  228.     }
  229.    
  230.     global ownHotkeyCount := 48
  231.    
  232.     IfNotExist, ownhotkeys.ini
  233.     {
  234.         defaultOwnHotkeysArray := []
  235.        
  236.         defaultOwnHotkeysArray.InsertAt(1, ["~1", "[usepak]"])
  237.         defaultOwnHotkeysArray.InsertAt(2, ["~2", "[eatfish]"])
  238.         defaultOwnHotkeysArray.InsertAt(3, ["~3", "/usedrugs"])
  239.         defaultOwnHotkeysArray.InsertAt(4, ["F4", "/ausruesten"])
  240.         defaultOwnHotkeysArray.InsertAt(5, ["F5", "/heal"])
  241.         defaultOwnHotkeysArray.InsertAt(6, ["~Y", "/lock"])
  242.         defaultOwnHotkeysArray.InsertAt(7, ["~L", "/licht"])
  243.         defaultOwnHotkeysArray.InsertAt(8, ["~Numpad7", "Danke!"])
  244.         defaultOwnHotkeysArray.InsertAt(9, ["~Numpad8", "Kein Problem!"])
  245.         defaultOwnHotkeysArray.InsertAt(10, ["~Numpad9", "Entschuldigung!"])
  246.         defaultOwnHotkeysArray.InsertAt(11, ["~NumpadSub", "/auf"])
  247.         defaultOwnHotkeysArray.InsertAt(12, ["~sc135", "/gpsaus"])
  248.         defaultOwnHotkeysArray.InsertAt(13, ["~N", "/members"])
  249.         defaultOwnHotkeysArray.InsertAt(14, ["~O", "/crewmembers"])
  250.         defaultOwnHotkeysArray.InsertAt(15, ["~B", "/fixveh"])
  251.         defaultOwnHotkeysArray.InsertAt(16, ["~I", "/zoll"])
  252.         defaultOwnHotkeysArray.InsertAt(17, ["~P", "/f Ich befinde mich aktuell in [zone], [city] | HP: [hp]"])
  253.         defaultOwnHotkeysArray.InsertAt(18, ["~^P", "/crew Ich befinde mich aktuell in [zone], [city] | HP: [hp]"])
  254.         defaultOwnHotkeysArray.InsertAt(19, ["~NumpadAdd", "/f Ich benötige DRINGEND Verstärkung in [zone], [city] | HP: [hp]"])
  255.         defaultOwnHotkeysArray.InsertAt(20, ["~!NumpadAdd", "/f Ich benötige keine Verstärkung mehr!"])
  256.         defaultOwnHotkeysArray.InsertAt(21, ["~Numpad7", "/hide~/s Stop, ich stelle mich!"])
  257.        
  258.         for key, value in defaultOwnHotkeysArray {
  259.             hk := value[1]
  260.             text := value[2]
  261.            
  262.             IniWrite, 1, ownhotkeys.ini, %key%, Active
  263.             IniWrite, %hk%, ownhotkeys.ini, %key%, Hotkey
  264.             IniWrite, %text%, ownhotkeys.ini, %key%, Text
  265.         }
  266.     }
  267.    
  268.     Loop, %ownHotkeyCount% {
  269.         outerIndex := A_Index
  270.        
  271.         IniRead, ownHotkey%outerIndex%Active, ownhotkeys.ini, %outerIndex%, Active, 0
  272.         IniRead, ownHotkey%outerIndex%Text, ownhotkeys.ini, %outerIndex%, Text, %A_Space%
  273.         IniRead, hk, ownhotkeys.ini, %outerIndex%, Hotkey, %A_Space%
  274.        
  275.         ownHotkey%outerIndex%Text := StrReplace(ownHotkey%outerIndex%Text, "~", "`n")
  276.        
  277.         if (hk) {
  278.             alreadyRegistered := false
  279.            
  280.             for key, value in registeredHotkeys {
  281.                 hk2 := StrReplace(hk, "~", "")
  282.                 value2 := StrReplace(value, "~", "")
  283.                
  284.                 if (hk2 = value2 && StrLen(hk2) == StrLen(value2)) {
  285.                     alreadyRegistered := true
  286.                     alreadyRegisteredKey := key
  287.                     alreadyRegisteredValue := value
  288.                     break
  289.                 }
  290.             }
  291.            
  292.             StringReplace, ownHotkey%outerIndex%NoMods, hk, ~
  293.            
  294.             if (!alreadyRegistered) {
  295.                 if (ownHotkey%outerIndex%Active) {
  296.                     Hotkey, %hk%, ownHotkey%outerIndex%Label
  297.                    
  298.                     registeredHotkeys["ownHotkey" . outerIndex] := hk
  299.                 }
  300.             } else {
  301.                 FileAppend, [%time%] Der Hotkey für ownHotkey%outerIndex% (%hk%) ist bereits registriert (%alreadyRegisteredKey% - %alreadyRegisteredValue%)!`n, log.txt
  302.             }
  303.         }
  304.     }
  305.    
  306.     IfNotExist, images
  307.     {
  308.         FileCreateDir, images
  309.     }
  310.    
  311.     IfNotExist, images\Banner.png
  312.     {
  313.         URLDownloadToFile, %baseURL%downloads/images/Banner.png, Banner.png
  314.         FileMove, Banner.png, images\Banner.png
  315.     }
  316.    
  317. #IFNDEF nooverlay
  318.     IfNotExist, bin
  319.     {
  320.         FileCreateDir, bin
  321.     }
  322.    
  323.     IfNotExist, bin\overlay.dll
  324.     {
  325.         URLDownloadToFile, %baseURL%downloads/bin/overlay.dll, bin\overlay.dll
  326.     }
  327.    
  328.     #Include, include/overlay.ahk
  329.    
  330.     SetParam("use_window", "1")
  331.     SetParam("window", "GTA:SA:MP")
  332. #ENDIF
  333.    
  334.     IniRead, taxes, settings.ini, Einstellungen, Steuersatz, 1
  335.     IniRead, tempo, settings.ini, Einstellungen, Tempo, 80
  336.    
  337.     IniRead, lockSystem, settings.ini, Einstellungen, Locksystem, 1
  338.     IniRead, motorSystem, settings.ini, Einstellungen, Motorsystem, 1
  339.     IniRead, fillSystem, settings.ini, Einstellungen, Tanksystem, 1
  340.     IniRead, customsSystem, settings.ini, Einstellungen, Zollsystem, 1
  341.     IniRead, lottoSystem, settings.ini, Einstellungen, Lottosystem, 1
  342.     IniRead, lottoNumber, settings.ini, Einstellungen, Lottozahl, 0
  343.     IniRead, chatlogSaver, settings.ini, Einstellungen, Chatlog, 1
  344.     IniRead, admin, settings.ini, Einstellungen, Admin, 0
  345.     IniRead, primaryColor, settings.ini, Einstellungen, Primärfarbe, %A_Space%
  346.     IniRead, secondaryColor, settings.ini, Einstellungen, Sekundärfarbe, %A_Space%
  347.     IniRead, antispamSystem, settings.ini, Einstellungen, Antispamsystem, 1
  348.     IniRead, statsFormatted, settings.ini, Einstellungen, StatistikFormatiert, 1
  349.     IniRead, fishMode, settings.ini, Einstellungen, FischModus, 0
  350.     IniRead, autoBuyCanister, settings.ini, Einstellungen, AutoKanister, 0
  351.     IniRead, ownPrefix, settings.ini, Einstellungen, OwnPrefix, %A_Space%
  352.    
  353.     IniRead, killCounter, settings.ini, Einstellungen, Killzähler, 1
  354.     IniRead, killMessageLocal, settings.ini, Einstellungen, KillspruchLokal, 0
  355.     IniRead, killMessageActive, settings.ini, Einstellungen, KillspruchAktiv, 1
  356.     IniRead, killMessage, settings.ini, Einstellungen, Killspruch, /f +1 Kill in [zone], [city] | [kills]
  357.     IniRead, deathCounter, settings.ini, Einstellungen, Todeszähler, 1
  358.     IniRead, deathMessageLocal, settings.ini, Einstellungen, TodesspruchLokal, 0
  359.     IniRead, deathMessageActive, settings.ini, Einstellungen, TodesspruchAktiv, 1
  360.     IniRead, deathMessage, settings.ini, Einstellungen, Todesspruch, /f +1 Tod in [zone], [city] | [deaths]
  361.    
  362.     IniRead, sortStoresBy, settings.ini, Einstellungen, SortStoresBy, 1
  363.     IniRead, robcountdown, settings.ini, Einstellungen, RobCountdown, 1
  364.    
  365.     IniRead, enemyAddedMessage, settings.ini, Einstellungen, GegnerHinzugefügtNachricht, 1
  366.     IniRead, enemyUpdatedMessage, settings.ini, Einstellungen, GegnerGeupdatetNachricht, 0
  367.     IniRead, enemyJoinLeaveMessage, settings.ini, Einstellungen, GegnerJoinLeaveNachricht, 0
  368.    
  369.     IniRead, packetMessages, settings.ini, Einstellungen, PaketNachrichten, 1
  370.     IniRead, paintballMessages, settings.ini, Einstellungen, PaintballNachrichten, 1
  371.     IniRead, friendMessages, settings.ini, Einstellungen, FreundeNachrichten, 1
  372.    
  373.     IniRead, job, settings.ini, Job, Job, %A_Space%
  374.     IniRead, jobLine, settings.ini, Job, Linie, %A_Space%
  375.     IniRead, busRestartLine, settings.ini, Job, BusLinieAutoNeustart, 1
  376.     IniRead, busSendToJobChat, settings.ini, Job, BusSendJobChat, 0
  377.     IniRead, jobWeapondealerSkill, settings.ini, Job, Waffendealerskill, %A_Space%
  378.     IniRead, jobDetectiveSkill, settings.ini, Job, Detektivskill, %A_Space%
  379.    
  380.     IniRead, alternativePlayerInput, settings.ini, Einstellungen, AltPlayerInput, %A_Space%
  381.    
  382.     if (alternativePlayerInput == "") {
  383.         alternativePlayerInput := false
  384.        
  385.         IniWrite, %alternativePlayerInput%, settings.ini, Einstellungen, AltPlayerInput
  386.     }
  387.    
  388.     IniRead, debug, settings.ini, Einstellungen, Debug, %A_Space%
  389.    
  390.     if (debug == "") {
  391.         debug := false
  392.        
  393.         IniWrite, %debug%, settings.ini, Einstellungen, Debug
  394.     }
  395.    
  396.     Loop, 3 {
  397.         profileID := A_Index
  398.        
  399.         Loop, 6 {
  400.             IniRead, profile%profileID%_%A_Index%, settings.ini, Ausrüstungsprofile, Profil%profileID%_%A_Index%, %A_Space%
  401.         }
  402.     }
  403.    
  404.     primaryColor := StrReplace(primaryColor, "{", "")
  405.     primaryColor := StrReplace(primaryColor, "}", "")
  406.     secondaryColor := StrReplace(secondaryColor, "{", "")
  407.     secondaryColor := StrReplace(secondaryColor, "}", "")
  408.    
  409.     if (primaryColor == "") {
  410.         primaryColor := "000C64"
  411.     }
  412.    
  413.     if (secondaryColor == "") {
  414.         secondaryColor := "FFC000"
  415.     }
  416.    
  417.     global PRIMCOL := "{" . primaryColor . "}"
  418.     global SECCOL := "{" . secondaryColor . "}"
  419.    
  420.     global PREFIX := PRIMCOL . "[" . SECCOL . projectName . PRIMCOL . "] {FFFFFF}"
  421.    
  422.     if (ownPrefix != "") {
  423.         PREFIX := ownPrefix . " "
  424.     }
  425.    
  426. #IFNDEF nooverlay
  427.     ; Statistik-Overlay
  428.     IniRead, statsOverlayContent, settings.ini, StatsOverlay, Content, %A_Space%
  429.     IniRead, statsOverlayAutostart, settings.ini, StatsOverlay, Autostart, 0
  430.     IniRead, statsOverlayPosX, settings.ini, StatsOverlay, PosX, 20
  431.     IniRead, statsOverlayPosY, settings.ini, StatsOverlay, PosY, 215
  432.     IniRead, statsOverlayColors, settings.ini, StatsOverlay, Colors, 1
  433.     IniRead, statsOverlayItalic, settings.ini, StatsOverlay, Italic, 0
  434.     IniRead, statsOverlayFont, settings.ini, StatsOverlay, Font, Arial
  435.     IniRead, statsOverlayFontSize, settings.ini, StatsOverlay, FontSize, 7
  436.     IniRead, statsOverlayBold, settings.ini, StatsOverlay, Bold, 1
  437.     IniRead, statsOverlayColor, settings.ini, StatsOverlay, Color, FFFFFF
  438.    
  439.     if (statsOverlayContent == "") {
  440.         statsOverlayContent := "[white]Name: [primcol][name][white], ID: [primcol][id]~[white]HP: [primcol][hp][white], Ping: [primcol][ping][white], FPS: [primcol][fps]~[white]Standort: [primcol][zone][white], [primcol][city]~[white]Datum: [primcol][date]~[white]Geld durch Fischen: [primcol][fishmoney]$~[white]Du kannst wieder fischen in: [primcol][fishtime]~[white]Distanz zum Checkpoint: [primcol][checkpoint]~[white]Payday: [primcol][pdmoney]$ [white]([primcol][pdmoneynetto]$[white])~[white]Tages-Kills: [primcol][daykills][white], Tages-Tode: [primcol][daydeaths]~[white]Tages-K/D: [primcol][daykd]~[motor]~[lock]~[light]"
  441.        
  442.         IniWrite, %statsOverlayContent%, settings.ini, StatsOverlay, Content
  443.     }
  444.    
  445.     statsOverlayContent := StrReplace(statsOverlayContent, "~", "`n")
  446.    
  447.     statsOverlayPrimColor := SECCOL
  448.     statsOverlaySecColor := "{" . statsOverlayColor . "}"
  449.     statsOverlayPositiveColor := "{00FF00}"
  450.     statsOverlayNegativeColor := "{FF0000}"
  451.    
  452.     ; Gegner-Overlay
  453.     IniRead, enemyOverlayAutostart, settings.ini, EnemyOverlay, Autostart, 0
  454.     IniRead, enemyOverlayPosX, settings.ini, EnemyOverlay, PosX, 660
  455.     IniRead, enemyOverlayPosY, settings.ini, EnemyOverlay, PosY, 250
  456.     IniRead, enemyOverlayColors, settings.ini, EnemyOverlay, Colors, 1
  457.     IniRead, enemyOverlayItalic, settings.ini, EnemyOverlay, Italic, 0
  458.     IniRead, enemyOverlayFont, settings.ini, EnemyOverlay, Font, Arial
  459.     IniRead, enemyOverlayFontSize, settings.ini, EnemyOverlay, FontSize, 7
  460.     IniRead, enemyOverlayBold, settings.ini, EnemyOverlay, Bold, 1
  461.     IniRead, enemyOverlayColor, settings.ini, EnemyOverlay, Color, FFFFFF
  462.     IniRead, enemyOverlayShowCops, settings.ini, EnemyOverlay, Cops, 1
  463.     IniRead, enemyOverlayShowOwnFraction, settings.ini, EnemyOverlay, EigeneFraktion, 1
  464.    
  465.     enemyOverlayPrimColor := SECCOL
  466.     enemyOverlaySecColor := "{" . statsOverlayColor . "}"
  467.     enemyOverlayPositiveColor := "{00FF00}"
  468.     enemyOverlayNegativeColor := "{FF0000}"
  469.    
  470.     statsOverlayEnabled := false
  471.     enemyOverlayEnabled := false
  472.    
  473.     if (statsOverlayAutostart) {
  474.         createOverlay(1)
  475.        
  476.         statsOverlayEnabled := true
  477.     }
  478.    
  479.     if (enemyOverlayAutostart) {
  480.         createOverlay(2)
  481.        
  482.         enemyOverlayEnabled := true
  483.     }
  484. #ENDIF
  485.    
  486.     hpText := -1
  487.     armourText := -1
  488.    
  489.     IniRead, hpTextAutostart, settings.ini, HPText, Autostart, 1
  490.     IniRead, hpTextPosX, settings.ini, HPText, HPPosX, 576
  491.     IniRead, hpTextPosY, settings.ini, HPText, HPPosY, 66.5
  492.     IniRead, armourTextPosX, settings.ini, HPText, ArmourPosX, 576
  493.     IniRead, armourTextPosY, settings.ini, HPText, ArmourPosY, 44.5
  494.     IniRead, hpTextFont, settings.ini, HPText, Font, 1
  495.     IniRead, hpTextFontSize, settings.ini, HPText, FontSize, 0.3
  496.     IniRead, hpTextColor, settings.ini, HPText, HPColor, 1
  497.     IniRead, armourTextColor, settings.ini, HPText, ArmourColor, 1
  498.    
  499.     if (hpTextAutostart) {
  500.         createText(1)
  501.        
  502.         hpTextEnabled := true
  503.     }
  504.    
  505.     fpsText := -1
  506.    
  507.     IniRead, fpsTextAutostart, settings.ini, FPSText, Autostart, 1
  508.     IniRead, fpsTextPosX, settings.ini, FPSText, PosX, 20
  509.     IniRead, fpsTextPosY, settings.ini, FPSText, PosY, 376
  510.     IniRead, fpsTextFont, settings.ini, FPSText, Font, 3
  511.     IniRead, fpsTextFontSize, settings.ini, FPSText, FontSize, 0.4
  512.     IniRead, fpsTextColor, settings.ini, FPSText, Color, 1
  513.    
  514.     if (fpsTextAutostart) {
  515.         createText(3)
  516.        
  517.         fpsTextEnabled := true
  518.     }
  519.    
  520.     ; Sonstige Variablen
  521.     global tv := false
  522.     global tvName := ""
  523.     global afk := false
  524.     global oldHour := -1
  525.     global fishTime := 0
  526.     global timeout := true
  527.     global pbKillStreak := 0
  528.     global paydayMoney := 0
  529.     global pedStates := {}
  530.    
  531.     ; Tempomat-Variablen
  532.     global tempo := 80
  533.     global tempomat := false
  534.     global currentSpeed := 0
  535.    
  536.     ; Jobsystem-Variablen
  537.     global currentFish := 1
  538.     global fishTraps := []
  539.     global fishingFull := false
  540.     global drugStatus := false
  541.     global drugTime := 0
  542.     global drugGrowTime := -1
  543.    
  544.     ; Store-Rob-Variablen
  545.     global stores := []
  546.     global allStores := []
  547.     global updated := false
  548.    
  549.     global showNamechanges := false
  550.     global showFriendLabels := true
  551.    
  552.     global onlinePlayers := []
  553.     global onlineFriends := []
  554.     global onlineEnemies := []
  555.     global lspdData := []
  556.     global fbiData := []
  557.     global firstFriendsTimerRun := true
  558.     global firstEnemiesTimerRun := true
  559.     global gasstations := []
  560.    
  561.     global countdownRunning := false
  562.     global autoFindRunning := false
  563.     global autoShowRunning := false
  564.     global autoFindChatRunning := false
  565.    
  566.     global 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: (\S+)\$\n\t\tKonto: (\S+)\$\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\t\tHolzfäller: (\d+)(\n\n\n{(\S+)}(\S+)( \(noch (.+)\))?)?"
  567.    
  568.     SetTimer, ChatTimer, 100
  569.     SetTimer, TankTimer, 100
  570.     SetTimer, FillCustoms, 500
  571.     SetTimer, ChatlogSaveTimer, 500
  572.     SetTimer, LottoTimer, 1000
  573.     SetTimer, TempoTimer, 100
  574.     SetTimer, KillTimer, 100
  575.     SetTimer, SearchEnemyTimer, 2500
  576.     SetTimer, FriendsTimer, 1000
  577.     SetTimer, GasstationsTimer, 500
  578.     SetTimer, RefreshCops, 60000
  579.    
  580.     GoSub, RefreshCops
  581.    
  582.     Gui, Color, white
  583.     Gui, Font, S10 CDefault, Verdana
  584.    
  585.     Gui, Add, Picture, x10 y10 w600 h200, images\Banner.png
  586.    
  587.     Gui, Add, Button, x320 y230 w140 h40 gSettingsGUI, Einstellungen
  588.     Gui, Add, Button, x470 y230 w140 h40 gHotkeysGUI, Hotkeys
  589.     Gui, Add, Button, x320 y280 w140 h40 gHelpGUI, Hilfe
  590.     Gui, Add, Button, x470 y280 w140 h40 gNewsGUI, News
  591.     Gui, Add, Button, x470 y330 w140 h40 gRPGConnect, RPG Connect
  592.     Gui, Add, Button, x470 y450 w140 h40 gGuiClose, Schließen
  593.    
  594.     Gui, Add, Groupbox, x10 y220 w300 h270, Neuigkeiten (Version %version%)
  595.    
  596.     msg := URLDownloadToVar(baseURL . "downloads/updatelog.txt")
  597.    
  598.     StringReplace, update, msg, ', `r`n, All
  599.    
  600.     Gui, Add, Edit, x20 y240 w280 h240 ReadOnly, %update%
  601.    
  602.     Gui, Add, Groupbox, x320 y445 w140 h45, Versionsinfo
  603.    
  604. #IFDEF overlay
  605.     Gui, Add, Text, x330 y465 w120 h20, Overlay aktiv
  606. #ELSE
  607.     Gui, Add, Text, x330 y465 w120 h20, Kein Overlay
  608. #ENDIF
  609.    
  610.     Gui, Show, w620 h500, %projectName% - Version: %version%
  611. }
  612. return
  613.  
  614. GuiClose:
  615. {
  616. #IFNDEF nooverlay
  617.     if (statsOverlayEnabled) {
  618.         TextDestroy(statsOverlay)
  619.     }
  620.    
  621.     if (enemyOverlayEnabled) {
  622.         TextDestroy(enemyOverlay)
  623.     }
  624. #ENDIF
  625.    
  626.     deleteTextDraw(hpText)
  627.     deleteTextDraw(armourText)
  628.     deleteTextDraw(fpsText)
  629.    
  630.     for friendName, textLabelID in onlineFriends {
  631.         if (textLabelID != -1) {
  632.             deleteTextLabel(textLabelID)
  633.         }
  634.     }
  635.    
  636.     for playerName, textLabelID in onlinePlayers {
  637.         if (textLabelID != -1) {
  638.             deleteTextLabel(textLabelID)
  639.         }
  640.     }
  641.    
  642.     SQLiteDB.CloseDB()
  643.     ExitApp
  644. }
  645. return
  646.  
  647. RPGConnect:
  648. {
  649.     RegRead GTA_SA_EXE, HKEY_CURRENT_USER, Software\SAMP, gta_sa_exe
  650.     SplitPath, GTA_SA_EXE,, PFAD
  651.     run, %PFAD%\samp.exe server.rpg-city.de, %PFAD%
  652. }
  653. return
  654.  
  655. SettingsGUI:
  656. {
  657.     Gui, Settings: Destroy
  658.    
  659.     Gui, Settings: Color, white
  660.     Gui, Settings: Font, S10 CDefault, Verdana
  661.    
  662. #IFDEF nooverlay
  663.     Gui, Settings: Add, Button, x10 y695 w130 h40 voverlayButton, Overlay
  664.    
  665.     GuiControl, Settings: Disable, overlayButton
  666. #ELSE
  667.     Gui, Settings: Add, Button, x10 y695 w130 h40 gOverlaySettingsGUI, Overlays
  668. #ENDIF
  669.     Gui, Settings: Add, Button, x150 y695 w130 h40 gTextDrawSettingsGUI, TextDraws
  670.    
  671.     Gui, Settings: Add, Button, x340 y695 w130 h40 gSettingsSave, Speichern
  672.     Gui, Settings: Add, Button, x480 y695 w130 h40 gSettingsGuiClose, Schließen
  673.    
  674.     Gui, Settings: Add, GroupBox, x10 y10 w600 h170, Allgemeine Einstellungen
  675.    
  676.     Gui, Settings: Add, CheckBox, x20 y30 w170 h20 vlockSystem Checked%lockSystem%, Locksystem
  677.     Gui, Settings: Add, CheckBox, x20 y60 w170 h20 vfillSystem Checked%fillSystem%, Tanksystem
  678.     Gui, Settings: Add, CheckBox, x20 y90 w170 h20 vlottoSystem Checked%lottoSystem%, Lottosystem
  679.     Gui, Settings: Add, CheckBox, x20 y120 w170 h20 vantispamSystem Checked%antispamSystem%, Spamschutz-System
  680.     Gui, Settings: Add, CheckBox, x20 y150 w370 h20 vfishMode Checked%fishMode%, Fisch mit dem geringsten $-Wert wegwerfen
  681.    
  682.     Gui, Settings: Add, CheckBox, x190 y30 w200 h20 vmotorSystem Checked%motorSystem%, Motor aus beim Aussteigen
  683.     Gui, Settings: Add, CheckBox, x190 y60 w200 h20 vcustomsSystem Checked%customsSystem%, Zollsystem
  684.     Gui, Settings: Add, Text, x190 y90 w150 h20, Lottozahl (0 = zufällig)
  685.     Gui, Settings: Add, Edit, x350 y90 w40 h20 vlottoNumber, %lottoNumber%
  686.     Gui, Settings: Add, CheckBox, x190 y120 w200 h20 vstatsFormatted Checked%statsFormatted%, Statistik formatiert
  687.    
  688.     Gui, Settings: Add, CheckBox, x400 y30 w110 h20 vchatlogSaver Checked%chatlogSaver%, Chatlog-Save
  689.     Gui, Settings: Add, CheckBox, x530 y30 w70 h20 vadmin Checked%admin%, Admin
  690.     Gui, Settings: Add, Text, x400 y60 w110 h20, Primärfarbe
  691.     Gui, Settings: Add, Edit, x530 y60 w70 h20 vprimaryColor, %primaryColor%
  692.     Gui, Settings: Add, Text, x400 y90 w110 h20, Sekundärfarbe
  693.     Gui, Settings: Add, Edit, x530 y90 w70 h20 vsecondaryColor, %secondaryColor%
  694.     Gui, Settings: Add, Text, x400 y120 w110 h20, Eigener Prefix
  695.     Gui, Settings: Add, Edit, x530 y120 w70 h20 vownPrefix, %ownPrefix%
  696.     Gui, Settings: Add, CheckBox, x400 y150 w200 h20 vautoBuyCanister Checked%autoBuyCanister%, Kanister autom. kaufen
  697.    
  698.     Gui, Settings: Add, GroupBox, x10 y190 w600 h140, Kill- und Todeszähler
  699.     Gui, Settings: Add, CheckBox, x20 y210 w150 h20 vkillCounter Checked%killCounter%, Killzähler aktiv
  700.     Gui, Settings: Add, CheckBox, x190 y210 w180 h20 vkillMessageLocal Checked%killMessageLocal%, Spruch nur lokal senden
  701.     Gui, Settings: Add, CheckBox, x20 y240 w120 h20 vkillMessageActive Checked%killMessageActive%, Killspruch:
  702.     Gui, Settings: Add, Edit, x140 y240 w460 h20 vkillMessage, %killMessage%
  703.     Gui, Settings: Add, CheckBox, x20 y270 w150 h20 vdeathCounter Checked%deathCounter%, Todeszähler aktiv
  704.     Gui, Settings: Add, CheckBox, x190 y270 w180 h20 vdeathMessageLocal Checked%deathMessageLocal%, Spruch nur lokal senden
  705.     Gui, Settings: Add, CheckBox, x20 y300 w120 h20 vdeathMessageActive Checked%deathMessageActive%, Todesspruch:
  706.     Gui, Settings: Add, Edit, x140 y300 w460 h20 vdeathMessage, %deathMessage%
  707.    
  708.     Gui, Settings: Add, GroupBox, x10 y340 w600 h55, Store-Rob Funktionen
  709.     Gui, Settings: Add, Text, x20 y360 w200 h20, Sortierung des Store-Dialogs
  710.     Gui, Settings: Add, DropDownList, x230 y360 w130 h100 vsortStoresBy choose%sortStoresBy%, Standard|Store-Name|Entfernung|Status
  711.     Gui, Settings: Add, CheckBox, x370 y360 w210 h20 vrobcountdown checked%robcountdown%, Countdown beim Store-Rob
  712.    
  713.     Gui, Settings: Add, GroupBox, x10 y405 w600 h50, Gegner-Meldungen
  714.     Gui, Settings: Add, CheckBox, x20 y425 w150 h20 venemyAddedMessage checked%enemyAddedMessage%, Gegner hinzugefügt
  715.     Gui, Settings: Add, CheckBox, x190 y425 w170 h20 venemyUpdatedMessage checked%enemyUpdatedMessage%, Gegner geupdated
  716.     Gui, Settings: Add, CheckBox, x370 y425 w230 h20 venemyJoinLeaveMessage checked%enemyJoinLeaveMessage%, Server betreten/verlassen
  717.    
  718.     Gui, Settings: Add, GroupBox, x10 y465 w600 h50, Sonstige Meldungen
  719.     Gui, Settings: Add, CheckBox, x20 y485 w150 h20 vpacketMessages checked%packetMessages%, Paket-Nachrichten
  720.     Gui, Settings: Add, CheckBox, x190 y485 w170 h20 vpaintballMessages checked%paintballMessages%, Paintball-Nachrichten
  721.     Gui, Settings: Add, CheckBox, x370 y485 w230 h20 vfriendMessages checked%friendMessages%, Freunde-Nachrichten
  722.    
  723.     Gui, Settings: Add, GroupBox, x10 y525 w600 h160, Ausrüstungsprofile
  724.     userFriendlyEquipProfile1 := getUserFriendlyHotkeyName(equipProfile1NoMods)
  725.     userFriendlyEquipProfile2 := getUserFriendlyHotkeyName(equipProfile2NoMods)
  726.     userFriendlyEquipProfile3 := getUserFriendlyHotkeyName(equipProfile3NoMods)
  727.     Gui, 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.
  728.    
  729.     Gui, Settings: Add, Text, x30 y590 w70 h20, Profil 1:
  730.     Gui, Settings: Add, DropDownList, x100 y590 w75 h120 vprofile1_1, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  731.     Gui, Settings: Add, DropDownList, x183 y590 w75 h120 vprofile1_2, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  732.     Gui, Settings: Add, DropDownList, x266 y590 w75 h120 vprofile1_3, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  733.     Gui, Settings: Add, DropDownList, x349 y590 w75 h120 vprofile1_4, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  734.     Gui, Settings: Add, DropDownList, x432 y590 w75 h120 vprofile1_5, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  735.     Gui, Settings: Add, DropDownList, x515 y590 w75 h120 vprofile1_6, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  736.     GuiControl, Settings: Choose, profile1_1, %profile1_1%
  737.     GuiControl, Settings: Choose, profile1_2, %profile1_2%
  738.     GuiControl, Settings: Choose, profile1_3, %profile1_3%
  739.     GuiControl, Settings: Choose, profile1_4, %profile1_4%
  740.     GuiControl, Settings: Choose, profile1_5, %profile1_5%
  741.     GuiControl, Settings: Choose, profile1_6, %profile1_6%
  742.     Gui, Settings: Add, Text, x30 y620 w70 h20 , Profil 2:
  743.     Gui, Settings: Add, DropDownList, x100 y620 w75 h120 vprofile2_1, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  744.     Gui, Settings: Add, DropDownList, x183 y620 w75 h120 vprofile2_2, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  745.     Gui, Settings: Add, DropDownList, x266 y620 w75 h120 vprofile2_3, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  746.     Gui, Settings: Add, DropDownList, x349 y620 w75 h120 vprofile2_4, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  747.     Gui, Settings: Add, DropDownList, x432 y620 w75 h120 vprofile2_5, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  748.     Gui, Settings: Add, DropDownList, x515 y620 w75 h120 vprofile2_6, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  749.     GuiControl, Settings: Choose, profile2_1, %profile2_1%
  750.     GuiControl, Settings: Choose, profile2_2, %profile2_2%
  751.     GuiControl, Settings: Choose, profile2_3, %profile2_3%
  752.     GuiControl, Settings: Choose, profile2_4, %profile2_4%
  753.     GuiControl, Settings: Choose, profile2_5, %profile2_5%
  754.     GuiControl, Settings: Choose, profile2_6, %profile2_6%
  755.     Gui, Settings: Add, Text, x30 y650 w70 h20 , Profil 3:
  756.     Gui, Settings: Add, DropDownList, x100 y650 w75 h120 vprofile3_1, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  757.     Gui, Settings: Add, DropDownList, x183 y650 w75 h120 vprofile3_2, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  758.     Gui, Settings: Add, DropDownList, x266 y650 w75 h120 vprofile3_3, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  759.     Gui, Settings: Add, DropDownList, x349 y650 w75 h120 vprofile3_4, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  760.     Gui, Settings: Add, DropDownList, x432 y650 w75 h120 vprofile3_5, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  761.     Gui, Settings: Add, DropDownList, x515 y650 w75 h120 vprofile3_6, ||Deagle|Shotgun|AK47|MP5|Rifle|M4|Sniper|Baseballschläger|Golfschläger|Katana
  762.     GuiControl, Settings: Choose, profile3_1, %profile3_1%
  763.     GuiControl, Settings: Choose, profile3_2, %profile3_2%
  764.     GuiControl, Settings: Choose, profile3_3, %profile3_3%
  765.     GuiControl, Settings: Choose, profile3_4, %profile3_4%
  766.     GuiControl, Settings: Choose, profile3_5, %profile3_5%
  767.     GuiControl, Settings: Choose, profile3_6, %profile3_6%
  768.    
  769.     Menu, SettingsInformations, Add, &Informationen, SettingsInformations
  770.    
  771.     Gui, Settings: Menu, SettingsInformations
  772.    
  773.     Gui, Settings: Show, h745 w620, %projectName% - Einstellungen - Version %version%
  774. }
  775. return
  776.  
  777. SettingsInformations:
  778. {
  779.     MsgBox, 64, Informationen zu den Einstellungen,
  780.     (LTrim
  781.         Allgemeine Einstellungen:
  782.        
  783.         Locksystem - Fahrzeug beim Einsteigen abschließen
  784.         Motor aus beim Aussteigen - Motor beim Aussteigen abstellen
  785.         Chatlog-Save - Chatlog beim Beenden des Spiels speichern
  786.         Admin - Keine Delays - Achtung: Spamkick möglich!
  787.         Tanksystem - An den Tankstellen nur X zum Tanken drücken
  788.         Zollsystem - An den Zollstationen nur X zum Öffnen drücken
  789.         Lottosystem - Zur vollen Stunde mit X Lotterie-Ticket kaufen
  790.         Lottozahl - Deine Lottozahl - 0 = zufällig, 201 = deine ID
  791.         Spamschutz-System - Chat blockieren, wenn du spammst
  792.         Statistik formatiert - Statistik besser anzeigen
  793.         Primärfarbe - Hauptfarbe als Hex-Farbe - Standard: 2550A7
  794.         Sekundärfarbe - Nebenfarbe als Hex-Farbe - Standard: FF9900
  795.         Eigener Prefix - Dein eigener Prefix für den Keybinder - Standard (leer): {2550A7}|%projectName%|{FFFFFF}
  796.        
  797.        
  798.         Platzhalter für die Kill- und Todessprüche:
  799.        
  800.         [name] - Dein Name
  801.         [id] - Deine ID
  802.         [zone] - Deine Zone
  803.         [city] - Deine Stadt
  804.         [location] - Dein Autenthaltsort (Zone+Stadt)
  805.         [hp] - Deine HP
  806.         [armour] - Deine Armour
  807.         [kills] - Gesamte Kills
  808.         [daykills] - Tages-Kills
  809.         [deaths] - Gesamte Tode
  810.         [daydeaths] - Tages-Tode
  811.         [kd] - Gesamte K/D
  812.         [daykd] - Tages-K/D
  813.     )
  814. }
  815. return
  816.  
  817. SettingsSave:
  818. {
  819.     Gui, Settings: Submit, NoHide
  820.    
  821.     IniWrite, %lockSystem%, settings.ini, Einstellungen, Locksystem
  822.     IniWrite, %motorSystem%, settings.ini, Einstellungen, Motorsystem
  823.     IniWrite, %fillSystem%, settings.ini, Einstellungen, Tanksystem
  824.     IniWrite, %customsSystem%, settings.ini, Einstellungen, Zollsystem
  825.     IniWrite, %lottoSystem%, settings.ini, Einstellungen, Lottosystem
  826.     IniWrite, %lottoNumber%, settings.ini, Einstellungen, Lottozahl
  827.     IniWrite, %chatlogSaver%, settings.ini, Einstellungen, Chatlog
  828.     IniWrite, %admin%, settings.ini, Einstellungen, Admin
  829.     IniWrite, %primaryColor%, settings.ini, Einstellungen, Primärfarbe
  830.     IniWrite, %secondaryColor%, settings.ini, Einstellungen, Sekundärfarbe
  831.     IniWrite, %antispamSystem%, settings.ini, Einstellungen, Antispamsystem
  832.     IniWrite, %statsFormatted%, settings.ini, Einstellungen, StatistikFormatiert
  833.     IniWrite, %fishMode%, settings.ini, Einstellungen, FischModus
  834.     IniWrite, %autoBuyCanister%, settings.ini, Einstellungen, AutoKanister
  835.    
  836.     IniWrite, %ownPrefix%, settings.ini, Einstellungen, OwnPrefix
  837.    
  838.     if (ownPrefix != "") {
  839.         PREFIX := ownPrefix . " "
  840.     }
  841.    
  842.     IniWrite, %killCounter%, settings.ini, Einstellungen, Killzähler
  843.     IniWrite, %killMessageLocal%, settings.ini, Einstellungen, KillspruchLokal
  844.     IniWrite, %killMessageActive%, settings.ini, Einstellungen, KillspruchAktiv
  845.     IniWrite, %killMessage%, settings.ini, Einstellungen, Killspruch
  846.     IniWrite, %deathCounter%, settings.ini, Einstellungen, Todeszähler
  847.     IniWrite, %deathMessageLocal%, settings.ini, Einstellungen, TodesspruchLokal
  848.     IniWrite, %deathMessageActive%, settings.ini, Einstellungen, TodesspruchAktiv
  849.     IniWrite, %deathMessage%, settings.ini, Einstellungen, Todesspruch
  850.    
  851.     if (sortStoresBy == "Standard") {
  852.         sortStoresBy := 1
  853.     } else if (sortStoresBy == "Store-Name") {
  854.         sortStoresBy := 2
  855.     } else if (sortStoresBy == "Entfernung") {
  856.         sortStoresBy := 3
  857.     } else if (sortStoresBy == "Status") {
  858.         sortStoresBy := 4
  859.     }
  860.    
  861.     IniWrite, %sortStoresBy%, settings.ini, Einstellungen, SortStoresBy
  862.     IniWrite, %robcountdown%, settings.ini, Einstellungen, RobCountdown
  863.    
  864.     IniWrite, %enemyAddedMessage%, settings.ini, Einstellungen, GegnerHinzugefügtNachricht
  865.     IniWrite, %enemyUpdatedMessage%, settings.ini, Einstellungen, GegnerGeupdatetNachricht
  866.     IniWrite, %enemyJoinLeaveMessage%, settings.ini, Einstellungen, GegnerJoinLeaveNachricht
  867.    
  868.     IniWrite, %packetMessages%, settings.ini, Einstellungen, PaketNachrichten
  869.     IniWrite, %paintballMessages%, settings.ini, Einstellungen, PaintballNachrichten
  870.     IniWrite, %friendMessages%, settings.ini, Einstellungen, FreundeNachrichten
  871.    
  872.     IniWrite, %profile1_1%, settings.ini, Ausrüstungsprofile, Profil1_1
  873.     IniWrite, %profile1_2%, settings.ini, Ausrüstungsprofile, Profil1_2
  874.     IniWrite, %profile1_3%, settings.ini, Ausrüstungsprofile, Profil1_3
  875.     IniWrite, %profile1_4%, settings.ini, Ausrüstungsprofile, Profil1_4
  876.     IniWrite, %profile1_5%, settings.ini, Ausrüstungsprofile, Profil1_5
  877.     IniWrite, %profile1_6%, settings.ini, Ausrüstungsprofile, Profil1_6
  878.    
  879.     IniWrite, %profile2_1%, settings.ini, Ausrüstungsprofile, Profil2_1
  880.     IniWrite, %profile2_2%, settings.ini, Ausrüstungsprofile, Profil2_2
  881.     IniWrite, %profile2_3%, settings.ini, Ausrüstungsprofile, Profil2_3
  882.     IniWrite, %profile2_4%, settings.ini, Ausrüstungsprofile, Profil2_4
  883.     IniWrite, %profile2_5%, settings.ini, Ausrüstungsprofile, Profil2_5
  884.     IniWrite, %profile2_6%, settings.ini, Ausrüstungsprofile, Profil2_6
  885.    
  886.     IniWrite, %profile3_1%, settings.ini, Ausrüstungsprofile, Profil3_1
  887.     IniWrite, %profile3_2%, settings.ini, Ausrüstungsprofile, Profil3_2
  888.     IniWrite, %profile3_3%, settings.ini, Ausrüstungsprofile, Profil3_3
  889.     IniWrite, %profile3_4%, settings.ini, Ausrüstungsprofile, Profil3_4
  890.     IniWrite, %profile3_5%, settings.ini, Ausrüstungsprofile, Profil3_5
  891.     IniWrite, %profile3_6%, settings.ini, Ausrüstungsprofile, Profil3_6
  892.    
  893.     global PRIMCOL := "{" . primaryColor . "}"
  894.     global SECCOL := "{" . secondaryColor . "}"
  895.    
  896.     global PREFIX := PRIMCOL . "[" . SECCOL . projectName . PRIMCOL . "] {FFFFFF}"
  897.    
  898.     MsgBox, 64, Speicherung, Alle Eingaben und Daten wurden erfolgreich gespeichert!
  899.    
  900.     Gui, Settings: Destroy
  901. }
  902. return
  903.  
  904. SettingsGuiClose:
  905. {
  906.     Gui, Settings: Destroy
  907. }
  908. return
  909.  
  910. #IFNDEF nooverlay
  911. OverlaySettingsGUI:
  912. {
  913.     Gui, OverlaySettings: Destroy
  914.    
  915.     Gui, OverlaySettings: Color, white
  916.     Gui, OverlaySettings: Font, S10 CDefault, Verdana
  917.    
  918.     Gui, OverlaySettings: Add, Button, x10 y670 w160 h40 gOverlaySettingsSave, Speichern
  919.     Gui, OverlaySettings: Add, Button, x370 y670 w160 h40 gOverlaySettingsGuiClose, Schließen
  920.    
  921.     Gui, OverlaySettings: Add, GroupBox, x10 y10 w520 h260, Overlay-Inhalt
  922.     Gui, OverlaySettings: Add, Edit, x20 y30 w500 h230 vstatsOverlayContent, %statsOverlayContent%
  923.    
  924.     ; Statistik-Overlay Einstellungen
  925.     Gui, OverlaySettings: Add, GroupBox, x10 y280 w520 h170, Statistik-Overlay Einstellungen
  926.    
  927.     Gui, OverlaySettings: Add, Text, x20 y300 w200 h20, Beim Keybinderstart starten:
  928.     Gui, OverlaySettings: Add, CheckBox, x230 y300 w80 h20 vstatsOverlayAutostart checked%statsOverlayAutostart%, on / off
  929.    
  930.     Gui, OverlaySettings: Add, Text, x20 y330 w90 h20, Koordinaten:
  931.     Gui, OverlaySettings: Add, Text, x130 y330 w10 h20, x
  932.     Gui, OverlaySettings: Add, Text, x130 y360 w10 h20, y
  933.     Gui, OverlaySettings: Add, Text, x20 y390 w120 h20, Farben anzeigen:
  934.     Gui, OverlaySettings: Add, Text, x20 y420 w120 h20, Kursiv anzeigen:
  935.    
  936.     Gui, OverlaySettings: Add, Edit, x150 y330 w70 h20 vstatsOverlayPosX, %statsOverlayPosX%
  937.     Gui, OverlaySettings: Add, Edit, x150 y360 w70 h20 vstatsOverlayPosY, %statsOverlayPosY%
  938.     Gui, OverlaySettings: Add, CheckBox, x150 y390 w80 h20 vstatsOverlayColors checked%statsOverlayColors%, on / off
  939.     Gui, OverlaySettings: Add, CheckBox, x150 y420 w80 h20 vstatsOverlayItalic checked%statsOverlayItalic%, on / off
  940.    
  941.     Gui, OverlaySettings: Add, Text, x230 y330 w145 h20, Schriftart (z.B. Arial):
  942.     Gui, OverlaySettings: Add, Text, x230 y360 w140 h20, Schriftgröße:
  943.     Gui, OverlaySettings: Add, Text, x230 y390 w140 h20, Fett anzeigen:
  944.     Gui, OverlaySettings: Add, Text, x230 y420 w140 h20, Sekundärfarbe:
  945.    
  946.     Gui, OverlaySettings: Add, Edit, x380 y330 w140 h20 vstatsOverlayFont, %statsOverlayFont%
  947.     Gui, OverlaySettings: Add, Edit, x380 y360 w140 h20 vstatsOverlayFontSize, %statsOverlayFontSize%
  948.     Gui, OverlaySettings: Add, CheckBox, x380 y390 w140 h20 vstatsOverlayBold checked%statsOverlayBold%, on / off
  949.     Gui, OverlaySettings: Add, Edit, x380 y420 w140 h20 vstatsOverlayColor, %statsOverlayColor%
  950.    
  951.     ; Gegner-Overlay Einstellungen
  952.     Gui, OverlaySettings: Add, GroupBox, x10 y460 w520 h200, Gegner-Overlay Einstellungen
  953.    
  954.     Gui, OverlaySettings: Add, Text, x20 y480 w200 h20, Beim Keybinderstart starten:
  955.     Gui, OverlaySettings: Add, CheckBox, x230 y480 w80 h20 venemyOverlayAutostart checked%enemyOverlayAutostart%, on / off
  956.    
  957.     Gui, OverlaySettings: Add, Text, x20 y510 w90 h20, Koordinaten:
  958.     Gui, OverlaySettings: Add, Text, x130 y510 w10 h20, x
  959.     Gui, OverlaySettings: Add, Text, x130 y540 w10 h20, y
  960.     Gui, OverlaySettings: Add, Text, x20 y570 w120 h20, Farben anzeigen:
  961.     Gui, OverlaySettings: Add, Text, x20 y600 w120 h20, Kursiv anzeigen:
  962.     Gui, OverlaySettings: Add, Text, x20 y630 w120 h20, Cops anzeigen:
  963.    
  964.     Gui, OverlaySettings: Add, Edit, x150 y510 w70 h20 venemyOverlayPosX, %enemyOverlayPosX%
  965.     Gui, OverlaySettings: Add, Edit, x150 y540 w70 h20 venemyOverlayPosY, %enemyOverlayPosY%
  966.     Gui, OverlaySettings: Add, CheckBox, x150 y570 w80 h20 venemyOverlayColors checked%enemyOverlayColors%, on / off
  967.     Gui, OverlaySettings: Add, CheckBox, x150 y600 w80 h20 venemyOverlayItalic checked%enemyOverlayItalic%, on / off
  968.     Gui, OverlaySettings: Add, CheckBox, x150 y630 w80 h20 venemyOverlayShowCops checked%enemyOverlayShowCops%, on / off
  969.    
  970.     Gui, OverlaySettings: Add, Text, x230 y510 w145 h20, Schriftart (z.B. Arial):
  971.     Gui, OverlaySettings: Add, Text, x230 y540 w140 h20, Schriftgröße:
  972.     Gui, OverlaySettings: Add, Text, x230 y570 w140 h20, Fett anzeigen:
  973.     Gui, OverlaySettings: Add, Text, x230 y600 w140 h20, Sekundärfarbe:
  974.     Gui, OverlaySettings: Add, Text, x230 y630 w180 h20, Eigene Fraktion anzeigen:
  975.    
  976.     Gui, OverlaySettings: Add, Edit, x380 y510 w140 h20 venemyOverlayFont, %enemyOverlayFont%
  977.     Gui, OverlaySettings: Add, Edit, x380 y540 w140 h20 venemyOverlayFontSize, %enemyOverlayFontSize%
  978.     Gui, OverlaySettings: Add, CheckBox, x380 y570 w140 h20 venemyOverlayBold checked%enemyOverlayBold%, on / off
  979.     Gui, OverlaySettings: Add, Edit, x380 y600 w140 h20 venemyOverlayColor, %enemyOverlayColor%
  980.     Gui, OverlaySettings: Add, CheckBox, x420 y630 w100 h20 venemyOverlayShowOwnFraction checked%enemyOverlayShowOwnFraction%, on / off
  981.    
  982.     Menu, OverlaySettingsInformations, Add, &Informationen, OverlaySettingsInformations
  983.    
  984.     Gui, OverlaySettings: Menu, OverlaySettingsInformations
  985.    
  986.     Gui, OverlaySettings: Show, h720 w540, %projectName% - Overlay - Version: %version%
  987. }
  988. return
  989.  
  990. OverlaySettingsGuiClose:
  991. {
  992.     Gui, OverlaySettings: Destroy
  993. }
  994. return
  995.  
  996. OverlaySettingsSave:
  997. {
  998.     Gui, OverlaySettings: Submit, NoHide
  999.    
  1000.     savedStatsOverlayContent := StrReplace(statsOverlayContent, "`n", "~")
  1001.    
  1002.     IniWrite, %savedStatsOverlayContent%, settings.ini, StatsOverlay, Content
  1003.     IniWrite, %statsOverlayAutostart%, settings.ini, StatsOverlay, Autostart
  1004.     IniWrite, %statsOverlayPosX%, settings.ini, StatsOverlay, PosX
  1005.     IniWrite, %statsOverlayPosY%, settings.ini, StatsOverlay, PosY
  1006.     IniWrite, %statsOverlayColors%, settings.ini, StatsOverlay, Colors
  1007.     IniWrite, %statsOverlayItalic%, settings.ini, StatsOverlay, Italic
  1008.     IniWrite, %statsOverlayFont%, settings.ini, StatsOverlay, Font
  1009.     IniWrite, %statsOverlayFontSize%, settings.ini, StatsOverlay, FontSize
  1010.     IniWrite, %statsOverlayBold%, settings.ini, StatsOverlay, Bold
  1011.     IniWrite, %statsOverlayColor%, settings.ini, StatsOverlay, Color
  1012.    
  1013.     statsOverlayPrimColor := SECCOL
  1014.     statsOverlaySecColor := "{" . statsOverlayColor . "}"
  1015.     statsOverlayPositiveColor := "{00FF00}"
  1016.     statsOverlayNegativeColor := "{FF0000}"
  1017.    
  1018.     if (statsOverlayEnabled) {
  1019.         SetTimer, StatsOverlayTimer, Off
  1020.        
  1021.         TextDestroy(statsOverlay)
  1022.        
  1023.         createOverlay(1)
  1024.     }
  1025.    
  1026.     IniWrite, %enemyOverlayAutostart%, settings.ini, EnemyOverlay, Autostart
  1027.     IniWrite, %enemyOverlayPosX%, settings.ini, EnemyOverlay, PosX
  1028.     IniWrite, %enemyOverlayPosY%, settings.ini, EnemyOverlay, PosY
  1029.     IniWrite, %enemyOverlayColors%, settings.ini, EnemyOverlay, Colors
  1030.     IniWrite, %enemyOverlayItalic%, settings.ini, EnemyOverlay, Italic
  1031.     IniWrite, %enemyOverlayFont%, settings.ini, EnemyOverlay, Font
  1032.     IniWrite, %enemyOverlayFontSize%, settings.ini, EnemyOverlay, FontSize
  1033.     IniWrite, %enemyOverlayBold%, settings.ini, EnemyOverlay, Bold
  1034.     IniWrite, %enemyOverlayColor%, settings.ini, EnemyOverlay, Color
  1035.     IniWrite, %enemyOverlayShowCops%, settings.ini, EnemyOverlay, Cops
  1036.     IniWrite, %enemyOverlayShowOwnFraction%, settings.ini, EnemyOverlay, EigeneFraktion
  1037.    
  1038.     enemyOverlayPrimColor := SECCOL
  1039.     enemyOverlaySecColor := "{" . enemyOverlayColor . "}"
  1040.     enemyOverlayPositiveColor := "{00FF00}"
  1041.     enemyOverlayNegativeColor := "{FF0000}"
  1042.    
  1043.     if (enemyOverlayEnabled) {
  1044.         SetTimer, EnemyOverlayTimer, Off
  1045.        
  1046.         TextDestroy(enemyOverlay)
  1047.        
  1048.         createOverlay(2)
  1049.     }
  1050.    
  1051.     MsgBox, 64, Speicherung, Alle Eingaben und Daten wurden erfolgreich gespeichert!
  1052.    
  1053.     Gui, OverlaySettings: Destroy
  1054. }
  1055. return
  1056.  
  1057. OverlaySettingsInformations:
  1058. {
  1059.     Gui, OverlayVariables: Destroy
  1060.    
  1061.     Gui, OverlayVariables: Default
  1062.    
  1063.     Gui, OverlayVariables: Color, white
  1064.     Gui, OverlayVariables: Font, S10 CDefault, Verdana
  1065.    
  1066.     Gui, OverlayVariables: Add, ListView, x10 y10 r20 w460 gOverlayVariablesLV, Platzhalter|Beschreibung
  1067.     Gui, OverlayVariables: Add, Button, x310 y450 w160 h40 gOverlayVariablesGuiClose, Schließen
  1068.    
  1069.     LV_Add("", "-----------------", "Allgemeine Variablen")
  1070.     LV_Add("", "[primcol]", "Primärfarbe")
  1071.     LV_Add("", "[seccol]", "Sekundärfarbe")
  1072.     LV_Add("", "[white]", "Weiß")
  1073.     LV_Add("", "[name]", "Dein Name")
  1074.     LV_Add("", "[id]", "Deine ID")
  1075.     LV_Add("", "[ping]", "Dein Ping")
  1076.     LV_Add("", "[fps]", "Deine FPS")
  1077.     LV_Add("", "[zone]", "Deine Zone")
  1078.     LV_Add("", "[city]", "Deine Stadt")
  1079.     LV_Add("", "[hp]", "Deine HP")
  1080.     LV_Add("", "[armour]", "Deine Armour")
  1081.     LV_Add("", "[money]", "Geld auf der Hand")
  1082.     LV_Add("", "[bankmoney]", "Geld auf dem Konto")
  1083.     LV_Add("", "[allmoney]", "Gesamtgeld")
  1084.     LV_Add("", "[skin]", "Deine Skin-ID")
  1085.     LV_Add("", "[weaponid]", "Weapon-ID der aktuellen Waffe")
  1086.     LV_Add("", "[weapon]", "Name der aktuellen Waffe")
  1087.     LV_Add("", "[freezed]", "ja/nein, ob man gefreezed ist")
  1088.     LV_Add("", "[vhealth]", "Fahrzeugzustand in Prozent")
  1089.     LV_Add("", "[vmodelid]", "Fahrzeug-Modell-ID")
  1090.     LV_Add("", "[vmodel]", "Fahrzeug-Modell-Name")
  1091.     LV_Add("", "[vspeed]", "Fahrzeug-Geschwindigkeit")
  1092.     LV_Add("", "[fishmoney]", "Fisch-Verdienst")
  1093.     LV_Add("", "[fishtime]", "Fisch-Zeit")
  1094.     LV_Add("", "[date]", "Aktuelles Datum im Format TT.MM.JJJJ")
  1095.     LV_Add("", "[motor]", "Motor-Status")
  1096.     LV_Add("", "[lock]", "Lock-Status")
  1097.     LV_Add("", "[light]", "Licht-Status")
  1098.     LV_Add("", "[checkpoint]", "Distanz zum Checkpoint")
  1099.     LV_Add("", "[pdmoney]", "Geld am nächsten Payday (brutto)")
  1100.     LV_Add("", "[pdmoneynetto]", "Geld am nächsten Payday (netto)")
  1101.    
  1102.     LV_Add("", "-----------------", "Kill- und StoreRob-Variablen")
  1103.     LV_Add("", "[kills]", "Gesamte Kills")
  1104.     LV_Add("", "[kills]", "Gesamte Kills")
  1105.     LV_Add("", "[daykills]", "Tages-Kills")
  1106.     LV_Add("", "[deaths]", "Gesamte Tode")
  1107.     LV_Add("", "[daydeaths]", "Tages-Tode")
  1108.     LV_Add("", "[kd]", "Gesamte K/D")
  1109.     LV_Add("", "[daykd]", "Tages-K/D")
  1110.     LV_Add("", "[stores]", "Gesamte Anzahl ausgeraubter Stores")
  1111.     LV_Add("", "[daystores]", "Heutige Anzahl ausgeraubter Stores")
  1112.     LV_Add("", "[storemoney]", "Durch Überfälle verdientes Geld (gesamt)")
  1113.     LV_Add("", "[daystoremoney]", "Durch Überfälle verdientes Geld (heute)")
  1114.    
  1115.     LV_Add("", "-----------------", "Jobsystem-Variablen")
  1116.     LV_Add("", "[garbagexp]", "Müllmann-XP")
  1117.     LV_Add("", "[garbagekubik]", "Müllmann-Kubik")
  1118.     LV_Add("", "[garbagemoney]", "Müllmann-Verdienst")
  1119.     LV_Add("", "[fishingxp]", "Hochseefischer-XP")
  1120.     LV_Add("", "[fishingmoney]", "Hochseefischer-Verdienst")
  1121.     LV_Add("", "[truckerxp]", "Trucker-XP")
  1122.     LV_Add("", "[truckermoney]", "Trucker-Verdienst")
  1123.     LV_Add("", "[trainxp]", "Zugfahrer-XP")
  1124.     LV_Add("", "[trainmoney]", "Zugfahrer-Verdienst")
  1125.     LV_Add("", "[gardenerxp]", "Gärtner-XP")
  1126.     LV_Add("", "[gardenermoney]", "Gärtner-Verdienst")
  1127.     LV_Add("", "[gardenermaxmoney]", "Höchster Verdienst als Gärtner")
  1128.     LV_Add("", "[farmerxp]", "Farmer-XP")
  1129.     LV_Add("", "[farmermoney]", "Farmer-Verdienst")
  1130.     LV_Add("", "[farmermaxmoney]", "Höchster Verdienst als Farmer")
  1131.     LV_Add("", "[busrounds]", "Als Busfahrer gefahrene Runden")
  1132.     LV_Add("", "[busmoney]", "Busfahrer-Verdienst")
  1133.     LV_Add("", "[drugsbought]", "Anzahl der gekauften Drogen")
  1134.     LV_Add("", "[drugsmoney]", "Drogen-Verdienst")
  1135.     LV_Add("", "[drugxp]", "Drogen-XP")
  1136.     LV_Add("", "[drugs]", "Anzahl der gefarmten Drogen")
  1137.     LV_Add("", "[drugstatus]", "Zeigt den Drogenstatus mit Zeit an")
  1138.     LV_Add("", "[matsbought]", "Anzahl der gekauften Materialien")
  1139.     LV_Add("", "[matsmoney]", "Materialien-Verdienst")
  1140.     LV_Add("", "[matsxp]", "Materialien-XP")
  1141.     LV_Add("", "[mats]", "Anzahl der gefarmten Materialien")
  1142.     LV_Add("", "[waffenstahl]", "Anzahl des gefarmten Waffenstahls")
  1143.    
  1144.     LV_ModifyCol()
  1145.    
  1146.     Gui, OverlayVariables: Show, h500 w480, %projectName% - Overlay-Variablen - Version: %version%
  1147. }
  1148. return
  1149.  
  1150. OverlayVariablesLV:
  1151. {
  1152.     if A_GuiEvent = DoubleClick
  1153.     {
  1154.         LV_GetText(RowText, A_EventInfo)
  1155.         clipboard := RowText
  1156.         ToolTip, Die Variable "%RowText%" wurde in die Zwischenablage kopiert!
  1157.         SetTimer, RemoveToolTip, 1000
  1158.     }
  1159. }
  1160. return
  1161.  
  1162. RemoveToolTip:
  1163. {
  1164.     SetTimer, RemoveToolTip, Off
  1165.     ToolTip
  1166. }
  1167. return
  1168.  
  1169. OverlayVariablesGuiClose:
  1170. {
  1171.     Gui, OverlayVariables: Destroy
  1172. }
  1173. return
  1174. #ENDIF
  1175.  
  1176. TextDrawSettingsGUI:
  1177. {
  1178.     Gui, TextDrawSettings: Destroy
  1179.    
  1180.     Gui, TextDrawSettings: Color, white
  1181.     Gui, TextDrawSettings: Font, S10 CDefault, Verdana
  1182.    
  1183.     Gui, TextDrawSettings: Add, Button, x10 y340 w160 h40 gTextDrawSettingsSave, Speichern
  1184.     Gui, TextDrawSettings: Add, Button, x370 y340 w160 h40 gTextDrawSettingsGuiClose, Schließen
  1185.    
  1186.     ; HP- und Armour-TextDraw Einstellungen
  1187.     Gui, TextDrawSettings: Add, GroupBox, x10 y10 w520 h170, HP- und Armour-TextDraw Einstellungen
  1188.    
  1189.     Gui, TextDrawSettings: Add, Text, x20 y30 w200 h20, Beim Keybinderstart starten:
  1190.     Gui, TextDrawSettings: Add, CheckBox, x230 y30 w80 h20 vhpTextAutostart checked%hpTextAutostart%, on / off
  1191.    
  1192.     Gui, TextDrawSettings: Add, Text, x20 y60 w100 h50, Koordinaten:`n(HP- TextDraw)
  1193.     Gui, TextDrawSettings: Add, Text, x130 y60 w10 h20, x
  1194.     Gui, TextDrawSettings: Add, Text, x130 y90 w10 h20, y
  1195.     Gui, TextDrawSettings: Add, Text, x20 y120 w100 h50, Koordinaten:`n(Armour- TextDraw)
  1196.     Gui, TextDrawSettings: Add, Text, x130 y120 w10 h20, x
  1197.     Gui, TextDrawSettings: Add, Text, x130 y150 w10 h20, y
  1198.    
  1199.     Gui, TextDrawSettings: Add, Edit, x150 y60 w70 h20 vhpTextPosX, %hpTextPosX%
  1200.     Gui, TextDrawSettings: Add, Edit, x150 y90 w70 h20 vhpTextPosY, %hpTextPosY%
  1201.     Gui, TextDrawSettings: Add, Edit, x150 y120 w70 h20 varmourTextPosX, %armourTextPosX%
  1202.     Gui, TextDrawSettings: Add, Edit, x150 y150 w70 h20 varmourTextPosY, %armourTextPosY%
  1203.    
  1204.     Gui, TextDrawSettings: Add, Text, x230 y60 w140 h20, Schriftart (0-3):
  1205.     Gui, TextDrawSettings: Add, Text, x230 y90 w140 h20, Schriftgröße:
  1206.     Gui, TextDrawSettings: Add, Text, x230 y120 w140 h20, Farbe HP
  1207.     Gui, TextDrawSettings: Add, Text, x230 y150 w140 h20, Farbe Armour
  1208.    
  1209.     Gui, TextDrawSettings: Add, Edit, x380 y60 w140 h20
  1210.     Gui, TextDrawSettings: Add, UpDown, vhpTextFont Range0-3, %hpTextFont%
  1211.     Gui, TextDrawSettings: Add, Edit, x380 y90 w140 h20 vhpTextFontSize, %hpTextFontSize%
  1212.     Gui, TextDrawSettings: Add, DropDownList, x380 y120 w140 h140 vhpTextColor choose%hpTextColor%, Weiß|Schwarz|Rot|Grün|Blau|Gelb|Lila
  1213.     Gui, TextDrawSettings: Add, DropDownList, x380 y150 w140 h140 varmourTextColor choose%armourTextColor%, Weiß|Schwarz|Rot|Grün|Blau|Gelb|Lila
  1214.    
  1215.     ; FPS-TextDraw Einstellungen
  1216.     Gui, TextDrawSettings: Add, GroupBox, x10 y190 w520 h140, FPS-TextDraw Einstellungen
  1217.    
  1218.     Gui, TextDrawSettings: Add, Text, x20 y210 w200 h20, Beim Keybinderstart starten:
  1219.     Gui, TextDrawSettings: Add, CheckBox, x230 y210 w80 h20 vfpsTextAutostart checked%fpsTextAutostart%, on / off
  1220.    
  1221.     Gui, TextDrawSettings: Add, Text, x20 y240 w100 h50, Koordinaten:
  1222.     Gui, TextDrawSettings: Add, Text, x130 y240 w10 h20, x
  1223.     Gui, TextDrawSettings: Add, Text, x130 y270 w10 h20, y
  1224.    
  1225.     Gui, TextDrawSettings: Add, Edit, x150 y240 w70 h20 vfpsTextPosX, %fpsTextPosX%
  1226.     Gui, TextDrawSettings: Add, Edit, x150 y270 w70 h20 vfpsTextPosY, %fpsTextPosY%
  1227.    
  1228.     Gui, TextDrawSettings: Add, Text, x230 y240 w140 h20, Schriftart (0-3):
  1229.     Gui, TextDrawSettings: Add, Text, x230 y270 w140 h20, Schriftgröße:
  1230.     Gui, TextDrawSettings: Add, Text, x230 y300 w140 h20, Farbe
  1231.    
  1232.     Gui, TextDrawSettings: Add, Edit, x380 y240 w140 h20
  1233.     Gui, TextDrawSettings: Add, UpDown, vfpsTextFont Range0-3, %fpsTextFont%
  1234.     Gui, TextDrawSettings: Add, Edit, x380 y270 w140 h20 vfpsTextFontSize, %fpsTextFontSize%
  1235.     Gui, TextDrawSettings: Add, DropDownList, x380 y300 w140 h140 vfpsTextColor choose%fpsTextColor%, Weiß|Schwarz|Rot|Grün|Blau|Gelb|Lila
  1236.    
  1237.     Gui, TextDrawSettings: Show, h390 w540, %projectName% - TextDraws - Version: %version%
  1238. }
  1239. return
  1240.  
  1241. TextDrawSettingsGuiClose:
  1242. {
  1243.     Gui, TextDrawSettings: Destroy
  1244. }
  1245. return
  1246.  
  1247. TextDrawSettingsSave:
  1248. {
  1249.     Gui, TextDrawSettings: Submit, NoHide
  1250.    
  1251.     IniWrite, %hpTextAutostart%, settings.ini, HPText, Autostart
  1252.     IniWrite, %hpTextPosX%, settings.ini, HPText, HPPosX
  1253.     IniWrite, %hpTextPosY%, settings.ini, HPText, HPPosY
  1254.     IniWrite, %armourTextPosX%, settings.ini, HPText, ArmourPosX
  1255.     IniWrite, %armourTextPosY%, settings.ini, HPText, ArmourPosY
  1256.     IniWrite, %hpTextFont%, settings.ini, HPText, Font
  1257.     IniWrite, %hpTextFontSize%, settings.ini, HPText, FontSize
  1258.    
  1259.     if (hpTextColor == "Weiß") {
  1260.         hpTextColor := 1
  1261.     } else if (hpTextColor == "Schwarz") {
  1262.         hpTextColor := 2
  1263.     } else if (hpTextColor == "Rot") {
  1264.         hpTextColor := 3
  1265.     } else if (hpTextColor == "Grün") {
  1266.         hpTextColor := 4
  1267.     } else if (hpTextColor == "Blau") {
  1268.         hpTextColor := 5
  1269.     } else if (hpTextColor == "Gelb") {
  1270.         hpTextColor := 6
  1271.     } else if (hpTextColor == "Lila") {
  1272.         hpTextColor := 7
  1273.     }
  1274.    
  1275.     if (armourTextColor == "Weiß") {
  1276.         armourTextColor := 1
  1277.     } else if (armourTextColor == "Schwarz") {
  1278.         armourTextColor := 2
  1279.     } else if (armourTextColor == "Rot") {
  1280.         armourTextColor := 3
  1281.     } else if (armourTextColor == "Grün") {
  1282.         armourTextColor := 4
  1283.     } else if (armourTextColor == "Blau") {
  1284.         armourTextColor := 5
  1285.     } else if (armourTextColor == "Gelb") {
  1286.         armourTextColor := 6
  1287.     } else if (armourTextColor == "Lila") {
  1288.         armourTextColor := 7
  1289.     }
  1290.    
  1291.     IniWrite, %hpTextColor%, settings.ini, HPText, HPColor
  1292.     IniWrite, %armourTextColor%, settings.ini, HPText, ArmourColor
  1293.    
  1294.     SetTimer, HealthTextDrawTimer, Off
  1295.    
  1296.     deleteTextDraw(hpText)
  1297.     deleteTextDraw(armourText)
  1298.    
  1299.     if (hpTextEnabled) {
  1300.         createText(1)
  1301.     }
  1302.    
  1303.     IniWrite, %fpsTextAutostart%, settings.ini, FPSText, Autostart
  1304.     IniWrite, %fpsTextPosX%, settings.ini, FPSText, PosX
  1305.     IniWrite, %fpsTextPosY%, settings.ini, FPSText, PosY
  1306.     IniWrite, %fpsTextFont%, settings.ini, FPSText, Font
  1307.     IniWrite, %fpsTextFontSize%, settings.ini, FPSText, FontSize
  1308.    
  1309.     if (fpsTextColor == "Weiß") {
  1310.         fpsTextColor := 1
  1311.     } else if (fpsTextColor == "Schwarz") {
  1312.         fpsTextColor := 2
  1313.     } else if (fpsTextColor == "Rot") {
  1314.         fpsTextColor := 3
  1315.     } else if (fpsTextColor == "Grün") {
  1316.         fpsTextColor := 4
  1317.     } else if (fpsTextColor == "Blau") {
  1318.         fpsTextColor := 5
  1319.     } else if (fpsTextColor == "Gelb") {
  1320.         fpsTextColor := 6
  1321.     } else if (fpsTextColor == "Lila") {
  1322.         fpsTextColor := 7
  1323.     }
  1324.    
  1325.     IniWrite, %fpsTextColor%, settings.ini, FPSText, Color
  1326.    
  1327.     SetTimer, FPSTextDrawTimer, Off
  1328.    
  1329.     deleteTextDraw(fpsText)
  1330.    
  1331.     if (fpsTextEnabled) {
  1332.         createText(3)
  1333.     }
  1334.    
  1335.     MsgBox, 64, Speicherung, Alle Eingaben und Daten wurden erfolgreich gespeichert!
  1336.    
  1337.     Gui, TextDrawSettings: Destroy
  1338. }
  1339. return
  1340.  
  1341. HotkeysGUI:
  1342. {
  1343.     Gui, Hotkeys: Destroy
  1344.    
  1345.     Gui, Hotkeys: Color, white
  1346.     Gui, Hotkeys: Font, S10 CDefault, Verdana
  1347.    
  1348.     Gui, Hotkeys: Add, Button, x10 y400 w140 h40 gResetHotkeys, Werkseinstellungen
  1349.     Gui, Hotkeys: Add, Button, x160 y400 w140 h40 gOwnHotkeysGUI, Eigene Hotkeys
  1350.     Gui, Hotkeys: Add, Button, x310 y400 w110 h40 gHotkeysGuiClose, Schließen
  1351.    
  1352.     Gui, Hotkeys: Add, GroupBox, x10 y10 w410 h380, Hotkeys
  1353.    
  1354.     Gui, Hotkeys: Add, Text, x20 y30 w220 h20, Motorsystem
  1355.     Gui, Hotkeys: Add, Text, x20 y60 w220 h20, Jobsystem
  1356.     Gui, Hotkeys: Add, Text, x20 y90 w220 h20, Statistik anzeigen
  1357.     Gui, Hotkeys: Add, Text, x20 y120 w220 h20, Tempomat starten/stoppen
  1358.     Gui, Hotkeys: Add, Text, x20 y150 w220 h20, Ausrüstungsprofil 1
  1359.     Gui, Hotkeys: Add, Text, x20 y180 w220 h20, Ausrüstungsprofil 2
  1360.     Gui, Hotkeys: Add, Text, x20 y210 w220 h20, Ausrüstungsprofil 3
  1361.     Gui, Hotkeys: Add, Text, x20 y240 w220 h20, Robstore-Hotkey
  1362.     Gui, Hotkeys: Add, Text, x20 y270 w220 h20, Store-Dialog-Hotkey
  1363.     Gui, Hotkeys: Add, Text, x20 y300 w220 h20, Letzte Eingabe wiederholen
  1364.     Gui, Hotkeys: Add, Text, x20 y330 w220 h20, Automatische Systeme beenden
  1365.     Gui, Hotkeys: Add, Text, x20 y360 w220 h20, Keybinder pausieren
  1366.    
  1367.     Gui, Hotkeys: Add, Hotkey, x260 y30 w150 h20 vmotorSystemHotkey gSaveHotkeyLabel, %motorSystemNoMods%
  1368.     Gui, Hotkeys: Add, Hotkey, x260 y60 w150 h20 vjobexecuteHotkey gSaveHotkeyLabel, %jobexecuteNoMods%
  1369.     Gui, Hotkeys: Add, Hotkey, x260 y90 w150 h20 vstatsHotkey gSaveHotkeyLabel, %statsNoMods%
  1370.     Gui, Hotkeys: Add, Hotkey, x260 y120 w150 h20 vtempomatHotkey gSaveHotkeyLabel, %tempomatNoMods%
  1371.     Gui, Hotkeys: Add, Hotkey, x260 y150 w150 h20 vequipProfile1Hotkey gSaveHotkeyLabel, %equipProfile1NoMods%
  1372.     Gui, Hotkeys: Add, Hotkey, x260 y180 w150 h20 vequipProfile2Hotkey gSaveHotkeyLabel, %equipProfile2NoMods%
  1373.     Gui, Hotkeys: Add, Hotkey, x260 y210 w150 h20 vequipProfile3Hotkey gSaveHotkeyLabel, %equipProfile3NoMods%
  1374.     Gui, Hotkeys: Add, Hotkey, x260 y240 w150 h20 vrobstoreHotkey gSaveHotkeyLabel, %robstoreNoMods%
  1375.     Gui, Hotkeys: Add, Hotkey, x260 y270 w150 h20 vstoresHotkey gSaveHotkeyLabel, %storesNoMods%
  1376.     Gui, Hotkeys: Add, Hotkey, x260 y300 w150 h20 vrepeatHotkey gSaveHotkeyLabel, %repeatNoMods%
  1377.     Gui, Hotkeys: Add, Hotkey, x260 y330 w150 h20 vstopAutomaticSystemsHotkey gSaveHotkeyLabel, %stopAutomaticSystemsNoMods%
  1378.     Gui, Hotkeys: Add, Hotkey, x260 y360 w150 h20 vpauseHotkey gSaveHotkeyLabel, %pauseNoMods%
  1379.    
  1380.     Menu, HotkeyInformations, Add, &Informationen, HotkeyInformations
  1381.    
  1382.     Gui, Hotkeys: Menu, HotkeyInformations
  1383.    
  1384.     Gui, Hotkeys: Show, h450 w430, %projectName% - Hotkeys - Version: %version%
  1385. }
  1386. return
  1387.  
  1388. HotkeysGuiClose:
  1389. {
  1390.     Gui, Hotkeys: Destroy
  1391. }
  1392. return
  1393.  
  1394. HotkeyInformations:
  1395. {
  1396.     MsgBox, 64, Informationen zu Hotkeys,
  1397.     (LTrim
  1398.         Hier können die Hotkeys selbstständig definiert werden.
  1399.        
  1400.         Manche 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).
  1401.         Stattdessen können diese alternativ in der Hotkeys.ini eingetragen werden.
  1402.         Beispielsweise können so auch die Maustasten "xButton1" und "xButton2" belegt werden, was hier im GUI nicht möglich ist.
  1403.        
  1404.         Ein Speichern ist nicht notwendig, da dies automatisch geschieht.
  1405.         Solltest du aber manuelle Änderungen in der Hotkeys.ini durchgeführt haben, musst du den Keybinder neustarten!
  1406.     )
  1407. }
  1408. return
  1409.  
  1410. ResetHotkeys:
  1411. {
  1412.     FileDelete, Hotkeys.ini
  1413.     MsgBox, 64, Zurücksetzen erfolgreich, Die Hotkeys wurden erfolgreich auf die Standardbelegungen zurückgesetzt, der Keybinder startet nun neu!
  1414.     Reload
  1415. }
  1416. return
  1417.  
  1418. SaveHotkeyLabel:
  1419. {
  1420.     Gui, Hotkeys: Submit, NoHide
  1421.    
  1422.     name := SubStr(A_GuiControl, 1, -6)
  1423.     hk := %A_GuiControl%
  1424.    
  1425.     if hk in +,^,!,+^,+!,^!,+^!
  1426.         return
  1427.    
  1428.     if (registeredHotkeys.HasKey(name)) {
  1429.         oldKey := registeredHotkeys[name]
  1430.        
  1431.         Hotkey, %oldKey%, %name%Label, Off
  1432.        
  1433.         registeredHotkeys.Delete(name)
  1434.     }
  1435.    
  1436.     %name%NoMods := ""
  1437.    
  1438.     if (hk == "") {
  1439.         IniWrite, ---, Hotkeys.ini, Hotkeys, %name%
  1440.     } else {
  1441.         alreadyRegistered := false
  1442.        
  1443.         for key, value in registeredHotkeys {
  1444.             hk2 := StrReplace(hk, "~", "")
  1445.             value2 := StrReplace(value, "~", "")
  1446.            
  1447.             if (hk2 = value2 && StrLen(hk2) == StrLen(value2)) {
  1448.                 alreadyRegistered := true
  1449.                 alreadyRegisteredKey := key
  1450.                 break
  1451.             }
  1452.         }
  1453.        
  1454.         if (!InStr(hk, "F") && !InStr(hk, "!"))
  1455.             hk := "~" . hk
  1456.        
  1457.         if (!alreadyRegistered) {
  1458.             Hotkey, %hk%, %name%Label
  1459.             StringReplace, %name%NoMods, hk, ~
  1460.             IniWrite, %hk%, Hotkeys.ini, Hotkeys, %name%
  1461.            
  1462.             registeredHotkeys[name] := hk
  1463.         } else {
  1464.             IniWrite, ---, Hotkeys.ini, Hotkeys, %name%
  1465.             GuiControl, Hotkeys: , %A_GuiControl%,
  1466.            
  1467.             if (RegExMatch(alreadyRegisteredKey, "ownHotkey(\d+)", key_)) {
  1468.                 hotkeyName := "eigenen Hotkey " . key_1
  1469.             } else {
  1470.                 hotkeyName := "Hotkey " . alreadyRegisteredKey
  1471.             }
  1472.            
  1473.             message := "Der Hotkey für " . name . " (" . getUserFriendlyHotkeyName(hk) . ") konnte nicht aktiviert werden, da er bereits für den " . hotkeyName . " registriert ist!"
  1474.            
  1475.             MsgBox, 64, Speicherung, %message%
  1476.         }
  1477.     }
  1478. }
  1479. return
  1480.  
  1481. OwnHotkeysGUI:
  1482. {
  1483.     Gui, OwnHotkeys: Destroy
  1484.    
  1485.     Gui, OwnHotkeys: Color, white
  1486.     Gui, OwnHotkeys: Font, S10 CDefault, Verdana
  1487.    
  1488.     Gui, OwnHotkeys: Add, Button, x10 y530 w130 h40 gOwnHotkeysSave, Speichern
  1489.     Gui, OwnHotkeys: Add, Button, x870 y530 w130 h40 gOwnHotkeysGuiClose, Schließen
  1490.    
  1491.     Gui, OwnHotkeys: Add, Tab, x10 y10 w990 h510, Seite 1|Seite 2|Seite 3
  1492.    
  1493.     Gui, OwnHotkeys: Tab, Seite 1
  1494.     Loop, 8 {
  1495.         index := A_Index
  1496.         active := ownHotkey%index%Active
  1497.         y1 := -20 + (A_Index * 60)
  1498.         y2 := 10 + (A_Index * 60)
  1499.        
  1500.         Gui, OwnHotkeys: Add, CheckBox, x20 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
  1501.         Gui, OwnHotkeys: Add, Hotkey, x20 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
  1502.         Gui, OwnHotkeys: Add, Edit, x130 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
  1503.     }
  1504.     Loop, 8 {
  1505.         index := A_Index + 8
  1506.         active := ownHotkey%index%Active
  1507.         y1 := -20 + (A_Index * 60)
  1508.         y2 := 10 + (A_Index * 60)
  1509.        
  1510.         Gui, OwnHotkeys: Add, CheckBox, x510 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
  1511.         Gui, OwnHotkeys: Add, Hotkey, x510 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
  1512.         Gui, OwnHotkeys: Add, Edit, x620 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
  1513.     }
  1514.    
  1515.     Gui, OwnHotkeys: Tab, Seite 2
  1516.     Loop, 8 {
  1517.         index := A_Index + 16
  1518.         active := ownHotkey%index%Active
  1519.         y1 := -20 + (A_Index * 60)
  1520.         y2 := 10 + (A_Index * 60)
  1521.        
  1522.         Gui, OwnHotkeys: Add, CheckBox, x20 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
  1523.         Gui, OwnHotkeys: Add, Hotkey, x20 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
  1524.         Gui, OwnHotkeys: Add, Edit, x130 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
  1525.     }
  1526.     Loop, 8 {
  1527.         index := A_Index + 24
  1528.         active := ownHotkey%index%Active
  1529.         y1 := -20 + (A_Index * 60)
  1530.         y2 := 10 + (A_Index * 60)
  1531.        
  1532.         Gui, OwnHotkeys: Add, CheckBox, x510 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
  1533.         Gui, OwnHotkeys: Add, Hotkey, x510 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
  1534.         Gui, OwnHotkeys: Add, Edit, x620 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
  1535.     }
  1536.    
  1537.     Gui, OwnHotkeys: Tab, Seite 3
  1538.     Loop, 8 {
  1539.         index := A_Index + 32
  1540.         active := ownHotkey%index%Active
  1541.         y1 := -20 + (A_Index * 60)
  1542.         y2 := 10 + (A_Index * 60)
  1543.        
  1544.         Gui, OwnHotkeys: Add, CheckBox, x20 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
  1545.         Gui, OwnHotkeys: Add, Hotkey, x20 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
  1546.         Gui, OwnHotkeys: Add, Edit, x130 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
  1547.     }
  1548.     Loop, 8 {
  1549.         index := A_Index + 40
  1550.         active := ownHotkey%index%Active
  1551.         y1 := -20 + (A_Index * 60)
  1552.         y2 := 10 + (A_Index * 60)
  1553.        
  1554.         Gui, OwnHotkeys: Add, CheckBox, x510 y%y1% w100 h20 vownHotkey%index%Active Checked%active%, Hotkey %index%
  1555.         Gui, OwnHotkeys: Add, Hotkey, x510 y%y2% w100 h20 vownHotkey%index%,% ownHotkey%index%NoMods
  1556.         Gui, OwnHotkeys: Add, Edit, x620 y%y1% w370 h50 vownHotkey%index%Text,% ownHotkey%index%Text
  1557.     }
  1558.    
  1559.     Menu, OwnHotkeysInformations, Add, &Informationen, OwnHotkeysInformations
  1560.    
  1561.     Gui, OwnHotkeys: Menu, OwnHotkeysInformations
  1562.    
  1563.     Gui, OwnHotkeys: Show, h580 w1010, %projectName% - Eigene Hotkeys - Version %version%
  1564. }
  1565. return
  1566.  
  1567. OwnHotkeysInformations:
  1568. {
  1569.     MsgBox, 64, Informationen zu eigenen Hotkeys,
  1570.     (LTrim
  1571.         Hier können eigene Hotkeys definiert werden.
  1572.        
  1573.         Das 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.
  1574.        
  1575.         Es können folgende Platzhalter verwendet werden:
  1576.         [name] - Dein Name
  1577.         [id] - Deine ID
  1578.         [ping] - Dein Ping
  1579.         [fps] - Deine FPS
  1580.         [hp] - Deine HP
  1581.         [armour] - Deine Armour
  1582.         [zone] - Deine Zone
  1583.         [city] - Deine Stadt
  1584.         [location] - Dein Autenthaltsort (Zone+Stadt)
  1585.         [money] - Dein Bargeld
  1586.         [skin] - Deine Skin-ID
  1587.         [weaponid] - Weapon-ID der aktuellen Waffe
  1588.         [weapon] - Name der aktuellen Waffe
  1589.         [freezed] - ja/nein, ob man gefreezed ist
  1590.         [vhealth] - Fahrzeugzustand in Prozent
  1591.         [vmodelid] - Fahrzeug-Modell-ID
  1592.         [vmodel] - Fahrzeug-Modell-Name
  1593.         [vspeed] - Fahrzeug-Geschwindigkeit
  1594.         [fishtime] - Fisch-Zeit
  1595.         [kills] - Gesamte Kills
  1596.         [daykills] - Tages-Kills
  1597.         [deaths] - Gesamte Tode
  1598.         [daydeaths] - Tages-Tode
  1599.         [kd] - Gesamte K/D
  1600.         [daykd] - Tages-K/D
  1601.         [stores] - Gesamte Anzahl ausgeraubter Stores
  1602.         [daystores] - Heutige Anzahl ausgeraubter Stores
  1603.         [storemoney] - Durch Überfälle verdientes Geld (gesamt)
  1604.         [daystoremoney] - Durch Überfälle verdientes Geld (heute)
  1605.        
  1606.         [motor] - Führt das Motor-System aus
  1607.         [usepak] - Benutzt ein Erste-Hilfe-Paket (nur wenn weniger als 95 HP)
  1608.         [eatfish] - Isst den nächsten Fisch (Nummer wird auch erhöht)
  1609.        
  1610.         [sleep Zeit] - Macht eine Pause, Zeitangabe in Millisekunden, [sleep 1000] = 1 Sekunde Pause
  1611.         [local] - Führt die Nachricht dahinter lokal aus (nur die aktuelle Zeile)
  1612.     )
  1613. }
  1614. return
  1615.  
  1616. OwnHotkeysSave:
  1617. {
  1618.     Gui, OwnHotkeys: Submit, NoHide
  1619.    
  1620.     saveErrors := ""
  1621.    
  1622.     Loop, %ownHotkeyCount% {
  1623.         outerIndex := A_Index
  1624.        
  1625.         savedOwnHotkey%outerIndex%Text := StrReplace(ownHotkey%outerIndex%Text, "`n", "~")
  1626.        
  1627.         IniWrite,% ownHotkey%outerIndex%Active, ownhotkeys.ini, %outerIndex%, Active
  1628.         IniWrite,% savedOwnHotkey%outerIndex%Text, ownhotkeys.ini, %outerIndex%, Text
  1629.        
  1630.         name := "ownHotkey" . outerIndex
  1631.         hk := %name%
  1632.        
  1633.         if hk in +,^,!,+^,+!,^!,+^!
  1634.             return
  1635.        
  1636.         if (registeredHotkeys.HasKey(name)) {
  1637.             oldKey := registeredHotkeys[name]
  1638.            
  1639.             Hotkey, %oldKey%, %name%Label, Off
  1640.         }
  1641.        
  1642.         %name%NoMods := ""
  1643.        
  1644.         if (hk == "") {
  1645.             if (registeredHotkeys.HasKey(name)) {
  1646.                 registeredHotkeys.Delete(name)
  1647.             }
  1648.            
  1649.             IniDelete, ownhotkeys.ini, %outerIndex%, Hotkey
  1650.         } else {
  1651.             alreadyRegistered := false
  1652.            
  1653.             for key, value in registeredHotkeys {
  1654.                 hk2 := StrReplace(hk, "~", "")
  1655.                 value2 := StrReplace(value, "~", "")
  1656.                
  1657.                 if (hk2 = value2 && StrLen(hk2) == StrLen(value2)) {
  1658.                     if (name != key) {
  1659.                         alreadyRegistered := true
  1660.                         alreadyRegisteredKey := key
  1661.                         break
  1662.                     }
  1663.                 }
  1664.             }
  1665.            
  1666.             if (!InStr(hk, "F") && !InStr(hk, "!"))
  1667.                 hk := "~" . hk
  1668.            
  1669.             StringReplace, %name%NoMods, hk, ~
  1670.             IniWrite, %hk%, ownhotkeys.ini, %outerIndex%, Hotkey
  1671.            
  1672.             if (!alreadyRegistered) {
  1673.                 if (ownHotkey%outerIndex%Active) {
  1674.                     Hotkey, %hk%, %name%Label
  1675.                    
  1676.                     registeredHotkeys[name] := hk
  1677.                 }
  1678.             } else {
  1679.                 if (RegExMatch(alreadyRegisteredKey, "ownHotkey(\d+)", key_)) {
  1680.                     hotkeyName := "Eigener Hotkey " . key_1
  1681.                 } else {
  1682.                     hotkeyName := alreadyRegisteredKey
  1683.                 }
  1684.                
  1685.                 saveErrors .= "`nEigener Hotkey " . outerIndex . " (" . getUserFriendlyHotkeyName(hk) . ") belegt bei: " . hotkeyName
  1686.             }
  1687.         }
  1688.     }
  1689.    
  1690.     if (saveErrors != "") {
  1691.         message := "Die Daten wurden gespeichert, jedoch können folgende Hotkeys nicht aktiviert werden, da sie bereits belegt sind:`n" . saveErrors
  1692.     } else {
  1693.         message := "Alle Eingaben und Daten wurden erfolgreich gespeichert!"
  1694.     }
  1695.    
  1696.     MsgBox, 64, Speicherung, %message%
  1697.    
  1698.     Gui, OwnHotkeys: Destroy
  1699. }
  1700. return
  1701.  
  1702. OwnHotkeysGuiClose:
  1703. {
  1704.     Gui, OwnHotkeys: Destroy
  1705. }
  1706. return
  1707.  
  1708. ownHotkey1Label:
  1709.     ownHotkey(1)
  1710. return
  1711. ownHotkey2Label:
  1712.     ownHotkey(2)
  1713. return
  1714. ownHotkey3Label:
  1715.     ownHotkey(3)
  1716. return
  1717. ownHotkey4Label:
  1718.     ownHotkey(4)
  1719. return
  1720. ownHotkey5Label:
  1721.     ownHotkey(5)
  1722. return
  1723. ownHotkey6Label:
  1724.     ownHotkey(6)
  1725. return
  1726. ownHotkey7Label:
  1727.     ownHotkey(7)
  1728. return
  1729. ownHotkey8Label:
  1730.     ownHotkey(8)
  1731. return
  1732. ownHotkey9Label:
  1733.     ownHotkey(9)
  1734. return
  1735. ownHotkey10Label:
  1736.     ownHotkey(10)
  1737. return
  1738. ownHotkey11Label:
  1739.     ownHotkey(11)
  1740. return
  1741. ownHotkey12Label:
  1742.     ownHotkey(12)
  1743. return
  1744. ownHotkey13Label:
  1745.     ownHotkey(13)
  1746. return
  1747. ownHotkey14Label:
  1748.     ownHotkey(14)
  1749. return
  1750. ownHotkey15Label:
  1751.     ownHotkey(15)
  1752. return
  1753. ownHotkey16Label:
  1754.     ownHotkey(16)
  1755. return
  1756. ownHotkey17Label:
  1757.     ownHotkey(17)
  1758. return
  1759. ownHotkey18Label:
  1760.     ownHotkey(18)
  1761. return
  1762. ownHotkey19Label:
  1763.     ownHotkey(19)
  1764. return
  1765. ownHotkey20Label:
  1766.     ownHotkey(20)
  1767. return
  1768. ownHotkey21Label:
  1769.     ownHotkey(21)
  1770. return
  1771. ownHotkey22Label:
  1772.     ownHotkey(22)
  1773. return
  1774. ownHotkey23Label:
  1775.     ownHotkey(23)
  1776. return
  1777. ownHotkey24Label:
  1778.     ownHotkey(24)
  1779. return
  1780. ownHotkey25Label:
  1781.     ownHotkey(25)
  1782. return
  1783. ownHotkey26Label:
  1784.     ownHotkey(26)
  1785. return
  1786. ownHotkey27Label:
  1787.     ownHotkey(27)
  1788. return
  1789. ownHotkey28Label:
  1790.     ownHotkey(28)
  1791. return
  1792. ownHotkey29Label:
  1793.     ownHotkey(29)
  1794. return
  1795. ownHotkey30Label:
  1796.     ownHotkey(30)
  1797. return
  1798. ownHotkey31Label:
  1799.     ownHotkey(31)
  1800. return
  1801. ownHotkey32Label:
  1802.     ownHotkey(32)
  1803. return
  1804. ownHotkey33Label:
  1805.     ownHotkey(33)
  1806. return
  1807. ownHotkey34Label:
  1808.     ownHotkey(34)
  1809. return
  1810. ownHotkey35Label:
  1811.     ownHotkey(35)
  1812. return
  1813. ownHotkey36Label:
  1814.     ownHotkey(36)
  1815. return
  1816. ownHotkey37Label:
  1817.     ownHotkey(37)
  1818. return
  1819. ownHotkey38Label:
  1820.     ownHotkey(38)
  1821. return
  1822. ownHotkey39Label:
  1823.     ownHotkey(39)
  1824. return
  1825. ownHotkey40Label:
  1826.     ownHotkey(40)
  1827. return
  1828. ownHotkey41Label:
  1829.     ownHotkey(41)
  1830. return
  1831. ownHotkey42Label:
  1832.     ownHotkey(42)
  1833. return
  1834. ownHotkey43Label:
  1835.     ownHotkey(43)
  1836. return
  1837. ownHotkey44Label:
  1838.     ownHotkey(44)
  1839. return
  1840. ownHotkey45Label:
  1841.     ownHotkey(45)
  1842. return
  1843. ownHotkey46Label:
  1844.     ownHotkey(46)
  1845. return
  1846. ownHotkey47Label:
  1847.     ownHotkey(47)
  1848. return
  1849. ownHotkey48Label:
  1850.     ownHotkey(48)
  1851. return
  1852.  
  1853. ownHotkey(id) {
  1854.     global
  1855.    
  1856.     if (isInChat())
  1857.         return
  1858.    
  1859.     if (!ownHotkey%id%Active)
  1860.         return
  1861.    
  1862.     if (ownHotkey%id%Text == "")
  1863.         return
  1864.    
  1865.     chatActionsArray := StrSplit(ownHotkey%id%Text, "`n")
  1866.    
  1867.     Loop % chatActionsArray.MaxIndex()
  1868.     {
  1869.         sendLine(chatActionsArray[A_Index])
  1870.     }
  1871. }
  1872.  
  1873. sendLine(line, local := false) {
  1874.     global fishTime
  1875.    
  1876.     IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
  1877.     IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
  1878.     IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
  1879.     IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
  1880.    
  1881.     IniRead, storeRobCount, stats.ini, StoreRob, Anzahl, 0
  1882.     IniRead, storeRobCountToday, stats.ini, StoreRob, Anzahl[%A_DD%:%A_MM%:%A_YYYY%], 0
  1883.     IniRead, storeRobMoney, stats.ini, StoreRob, Geld, 0
  1884.     IniRead, storeRobMoneyToday, stats.ini, StoreRob, Geld[%A_DD%:%A_MM%:%A_YYYY%], 0
  1885.    
  1886.     allKD := Round(alltimeKills / alltimeDeaths, 2)
  1887.     dayKD := Round(dayKills / dayDeaths, 2)
  1888.    
  1889.     line := StrReplace(line, "[name]", getUsername())
  1890.     line := StrReplace(line, "[id]", getId())
  1891.     line := StrReplace(line, "[ping]", getPlayerPingById(getId()))
  1892.     line := StrReplace(line, "[fps]", getFPS())
  1893.     line := StrReplace(line, "[zone]", getPlayerZone())
  1894.     line := StrReplace(line, "[city]", getPlayerCity())
  1895.     line := StrReplace(line, "[location]", getLocation())
  1896.     line := StrReplace(line, "[hp]", getPlayerHealth())
  1897.     line := StrReplace(line, "[armour]", getPlayerArmor())
  1898.     line := StrReplace(line, "[money]", FormatNumber(getPlayerMoney()))
  1899.     line := StrReplace(line, "[skin]", getPlayerSkinId())
  1900.     line := StrReplace(line, "[weaponid]", getPlayerWeaponId())
  1901.     line := StrReplace(line, "[weapon]", getPlayerWeaponName())
  1902.     line := StrReplace(line, "[freezed]", (IsPlayerFreezed() ? "ja" : "nein"))
  1903.     line := StrReplace(line, "[vhealth]", getVehicleHealth())
  1904.     line := StrReplace(line, "[vmodelid]", getVehicleModelId())
  1905.     line := StrReplace(line, "[vmodel]", getVehicleModelName())
  1906.     line := StrReplace(line, "[vspeed]", round(getVehicleSpeed()))
  1907.     line := StrReplace(line, "[fishtime]", formatTime(fishTime))
  1908.     line := StrReplace(line, "[kills]", FormatNumber(alltimeKills))
  1909.     line := StrReplace(line, "[daykills]", FormatNumber(daykills))
  1910.     line := StrReplace(line, "[deaths]", FormatNumber(alltimeDeaths))
  1911.     line := StrReplace(line, "[tode]", FormatNumber(alltimeDeaths))
  1912.     line := StrReplace(line, "[daydeaths]", FormatNumber(dayDeaths))
  1913.     line := StrReplace(line, "[kd]", allKD)
  1914.     line := StrReplace(line, "[daykd]", dayKD)
  1915.     line := StrReplace(line, "[stores]", FormatNumber(storeRobCount))
  1916.     line := StrReplace(line, "[daystores]", FormatNumber(storeRobCountToday))
  1917.     line := StrReplace(line, "[storemoney]", FormatNumber(storeRobMoney))
  1918.     line := StrReplace(line, "[daystoremoney]", FormatNumber(storeRobMoneyToday))
  1919.    
  1920.     if (RegExMatch(line, "(.*)\[sleep (\d+)\](.*)", line_)) {
  1921.         if (line_1 != "")
  1922.             sendLine(line_1, local)
  1923.        
  1924.         Sleep, %line_2%
  1925.        
  1926.         if (line_3 != "")
  1927.             sendLine(line_3, local)
  1928.     } else if (RegExMatch(line, "(.*)\[local\](.*)", line_)) {
  1929.         if (line_1 != "")
  1930.             sendLine(line_1, local)
  1931.        
  1932.         if (line_2 != "")
  1933.             sendLine(line_2, true)
  1934.     } else if (RegExMatch(line, "(.*)\[usepak\](.*)", line_)) {
  1935.         if (line_1 != "")
  1936.             sendLine(line_1, local)
  1937.        
  1938.         GoSub, firstAidLabel
  1939.        
  1940.         if (line_2 != "")
  1941.             sendLine(line_2, local)
  1942.     } else if (RegExMatch(line, "(.*)\[eatfish\](.*)", line_)) {
  1943.         if (line_1 != "")
  1944.             sendLine(line_1, local)
  1945.        
  1946.         GoSub, eatFishLabel
  1947.        
  1948.         if (line_2 != "")
  1949.             sendLine(line_2, local)
  1950.     } else if (RegExMatch(line, "(.*)\[motor\](.*)", line_)) {
  1951.         if (line_1 != "")
  1952.             sendLine(line_1, local)
  1953.        
  1954.         GoSub, motorSystemLabel
  1955.        
  1956.         if (line_2 != "")
  1957.             sendLine(line_2, local)
  1958.     } else {
  1959.         if (local) {
  1960.             SendClientMessage(PREFIX . line)
  1961.         } else {
  1962.             SendChat(line)
  1963.         }
  1964.     }
  1965. }
  1966.  
  1967. HelpGUI:
  1968. {
  1969.     Gui, Help: Destroy
  1970.    
  1971.     cheatsheet := URLDownloadToVar(baseURL . "downloads/Cheatsheet.txt")
  1972.    
  1973.     StringReplace, cheatsheet, cheatsheet, ', `r`n, All
  1974.    
  1975.     Gui, Help: Color, white
  1976.     Gui, Help: Font, S10 CDefault, Verdana
  1977.    
  1978.     Gui, Help: Add, Button, x240 y450 w220 h40 gSaveCheatsheet, Speichern (Cheatsheet.txt)
  1979.     Gui, Help: Add, Button, x470 y450 w140 h40 gHelpGuiClose, Schließen
  1980.    
  1981.     Gui, Help: Add, Groupbox, x10 y10 w600 h430, Befehle und Funktionen des Keybinders (Standardkonfiguration)
  1982.     Gui, Help: Add, Edit, x20 y30 w580 h400 ReadOnly, %cheatsheet%
  1983.    
  1984.     Gui, Help: Show, w620 h500, %projectName% - Hilfe - Version: %version%
  1985. }
  1986. return
  1987.  
  1988. SaveCheatsheet:
  1989. {
  1990.     IfExist, Cheatsheet.txt
  1991.     {
  1992.         FileDelete, Cheatsheet.txt
  1993.     }
  1994.    
  1995.     FileAppend, %cheatsheet%, Cheatsheet.txt
  1996.    
  1997.     MsgBox, 0, Speichern erfolgreich, Das Cheatsheet mit den Befehlen und Hotkeys wurde erfolgreich im Ordner des Keybinders gespeichert!
  1998. }
  1999.  
  2000. HelpGuiClose:
  2001. {
  2002.     Gui, Help: Destroy
  2003. }
  2004. return
  2005.  
  2006. NewsGUI:
  2007. {
  2008.     Gui, News: Destroy
  2009.    
  2010.     msg := URLDownloadToVar(baseURL . "downloads/news.txt")
  2011.    
  2012.     StringReplace, news, msg, ', `r`n, All
  2013.    
  2014.     Gui, News: Color, white
  2015.     Gui, News: Font, S10 CDefault, Verdana
  2016.    
  2017.     Gui, News: Add, Button, x470 y450 w140 h40 gNewsGuiClose, Schließen
  2018.    
  2019.     Gui, News: Add, Groupbox, x10 y10 w600 h430, Neuigkeiten und Informationen
  2020.     Gui, News: Add, Edit, x20 y30 w580 h400 ReadOnly, %news%
  2021.    
  2022.     Gui, News: Show, w620 h500, %projectName% - News - Version: %version%
  2023. }
  2024. return
  2025.  
  2026. NewsGuiClose:
  2027. {
  2028.     Gui, News: Destroy
  2029. }
  2030. return
  2031.  
  2032. ; ----------- ;
  2033. ;    Timer    ;
  2034. ; ----------- ;
  2035. AntiDecompile:
  2036. {
  2037.     if (WinExist("Cheat Engine") || WinExist("OllyDbg") || WinExist("Process Hacker") || WinExist("Resource Hacker") || WinExist("ArtMoney") || WinExist("Exe2ahk")) {
  2038.         ExitApp
  2039.     }
  2040. }
  2041. return
  2042.  
  2043. FillCustoms:
  2044. {
  2045.     if (timeout) {
  2046.         if (isPlayerInAnyVehicle() && isPlayerDriver()) {
  2047.             if (fillSystem
  2048.                 && (isPlayerInRangeOfPoint(700, -1930, 0, 10) ; Verona Beach
  2049.                 || isPlayerInRangeOfPoint(1833, -2431, 14, 10) ; LS Airport
  2050.                 || isPlayerInRangeOfPoint(615, 1689, 7, 10) ; Bone County
  2051.                 || isPlayerInRangeOfPoint(-1328, 2677, 40, 10) ; Tierra Robada
  2052.                 || isPlayerInRangeOfPoint(1596, 2199, 11, 10) ; Redsands West
  2053.                 || isPlayerInRangeOfPoint(2202, 2474, 11, 10) ; Emerald Isle
  2054.                 || isPlayerInRangeOfPoint(2114, 920, 11, 10) ; The Strip
  2055.                 || isPlayerInRangeOfPoint(-2408, 976, 45, 10) ; Juniper Hill
  2056.                 || isPlayerInRangeOfPoint(-2029, 156, 29, 10) ; Doherty
  2057.                 || isPlayerInRangeOfPoint(-1676, 414, 7, 10) ; Easter Basin
  2058.                 || isPlayerInRangeOfPoint(1004, -939, 43, 10) ; Temple
  2059.                 || isPlayerInRangeOfPoint(1944, -1773, 14, 10) ; Idlewood
  2060.                 || isPlayerInRangeOfPoint(-90, -1169, 3, 10) ; Flint County
  2061.                 || isPlayerInRangeOfPoint(-1605, -2714, 49, 10) ; Whetstone
  2062.                 || isPlayerInRangeOfPoint(-2243, -2560, 32, 10) ; Angel Pine
  2063.                 || isPlayerInRangeOfPoint(1381, 457, 20, 10) ; Montgomery
  2064.                 || isPlayerInRangeOfPoint(70, 1218, 19, 10))) { ; Fort Carson
  2065.                 SendClientMessage(PREFIX . "Du kannst dein Fahrzeug jetzt durch Drücken der Taste " . SECCOL . "X {FFFFFF}betanken!")
  2066.                
  2067.                 KeyWait, X, D, T10
  2068.                
  2069.                 if (!ErrorLevel) {
  2070.                     timeout := false
  2071.                    
  2072.                     if (getVehicleEngineState()) {
  2073.                         SendChat("/motor")
  2074.                     }
  2075.                    
  2076.                     SendChat("/fill")
  2077.                     Sleep, 10000
  2078.                     SendChat("/motor")
  2079.                     SendChat("/licht")
  2080.                    
  2081.                     tankTimeout := 0
  2082.                    
  2083.                     if (autoBuyCanister) {
  2084.                         SendClientMessage(PREFIX . "Möchtest du noch einen Kanister kaufen? Steig aus dem Fahrzeug aus und drücke " . SECCOL . "X{FFFFFF}!")
  2085.                        
  2086.                         KeyWait, X, D, T10
  2087.                        
  2088.                         if (!ErrorLevel) {
  2089.                             SendChat("/kanister")
  2090.                         }
  2091.                     }
  2092.                    
  2093.                     SetTimer, FillCustomsTimer, 5000
  2094.                 } else {
  2095.                     timeout := true
  2096.                 }
  2097.             } else if (customsSystem
  2098.                 && (isPlayerInRangeOfPoint(1733.47, 546.37, 26, 10) ; Zoll 1
  2099.                 || isPlayerInRangeOfPoint(1741.11, 543.47, 26, 10) ; Zoll 1
  2100.                 || isPlayerInRangeOfPoint(1744.03, 523.63, 27, 10) ; Zoll 1
  2101.                 || isPlayerInRangeOfPoint(1752.71, 521.69, 27, 10) ; Zoll 1
  2102.                 || isPlayerInRangeOfPoint(512.54, 476.62, 18, 10) ; Zoll 2
  2103.                 || isPlayerInRangeOfPoint(529.22, 467.21, 18, 10) ; Zoll 2
  2104.                 || isPlayerInRangeOfPoint(-159.79, 414.18, 11, 10) ; Zoll 3
  2105.                 || isPlayerInRangeOfPoint(-157.44, 392.24, 11, 10) ; Zoll 3
  2106.                 || isPlayerInRangeOfPoint(-1408.23, 824.19, 47, 10) ; Zoll 4
  2107.                 || isPlayerInRangeOfPoint(-1414.77, 803.59, 47, 10) ; Zoll 4
  2108.                 || isPlayerInRangeOfPoint(-2695.05, 1284.63, 55, 10) ; Zoll 5
  2109.                 || isPlayerInRangeOfPoint(-2686.34, 1284.24, 55, 10) ; Zoll 5
  2110.                 || isPlayerInRangeOfPoint(-2676.62, 1265.37, 55, 10) ; Zoll 5
  2111.                 || isPlayerInRangeOfPoint(-2668.18, 1264.91, 55, 10) ; Zoll 5
  2112.                 || isPlayerInRangeOfPoint(-963.08, -343.05, 36, 10) ; Zoll 6
  2113.                 || isPlayerInRangeOfPoint(-968.00, -322.33, 36, 10) ; Zoll 6
  2114.                 || isPlayerInRangeOfPoint(-71.76, -892.47, 15, 10) ; Zoll 7
  2115.                 || isPlayerInRangeOfPoint(-68.74, -867.96, 15, 10) ; Zoll 7
  2116.                 || isPlayerInRangeOfPoint(100.20, -1284.37, 14, 10) ; Zoll 8
  2117.                 || isPlayerInRangeOfPoint(94.40, -1277.82, 14, 10) ; Zoll 8
  2118.                 || isPlayerInRangeOfPoint(97.19, -1254.11, 14, 10) ; Zoll 8
  2119.                 || isPlayerInRangeOfPoint(94.69, -1245.59, 14, 10) ; Zoll 8
  2120.                 || isPlayerInRangeOfPoint(42.71, -1537.98, 5, 10) ; Zoll 9
  2121.                 || isPlayerInRangeOfPoint(58.02, -1524.93, 5, 10))) { ; Zoll 9
  2122.                 SendClientMessage(PREFIX . "Du kannst den Zoll jetzt durch Drücken der Taste " . SECCOL . "X {FFFFFF}öffnen!")
  2123.                
  2124.                 KeyWait, X, D, T10
  2125.                
  2126.                 if (!ErrorLevel) {
  2127.                     timeout := false
  2128.                    
  2129.                     Sleep, 100
  2130.                     SendChat("/zoll")
  2131.                     Sleep, 200
  2132.                     chat := readChatLine(0)
  2133.                    
  2134.                     if (RegExMatch(chat, "Es ist keine Zollstation in deiner Nähe\.")) {
  2135.                         Sleep, 800
  2136.                        
  2137.                         SendChat("/zoll")
  2138.                     }
  2139.                    
  2140.                     tankTimeout := 0
  2141.                     SetTimer, FillCustomsTimer, 5000
  2142.                 } else {
  2143.                     timeout := true
  2144.                 }
  2145.             }
  2146.         }
  2147.     }
  2148. }
  2149. return
  2150.  
  2151. FillCustomsTimer:
  2152. {
  2153.     tankTimeout++
  2154.    
  2155.     if (tankTimeout >= 4) {
  2156.         SetTimer, FillCustomsTimer, off
  2157.         timeout := true
  2158.     }
  2159. }
  2160. return
  2161.  
  2162. TankTimer:
  2163. {
  2164.     if (isPlayerInAnyVehicle() && isPlayerDriver()) {
  2165.         if (!updateTextDraws())
  2166.             return
  2167.        
  2168.         oReplace := ["~s~", "~r~", "~w~", "~h~", "~g~", "~y~", "~n~", "~b~", "  ", "   "]
  2169.        
  2170.         For i, o in oTextDraws
  2171.         {
  2172.             Loop % oReplace.MaxIndex() {
  2173.                 o := StrReplace(o, oReplace[A_Index], " ")
  2174.             }
  2175.            
  2176.             if (RegExMatch(o, "Tank: (\S+)\/(\d+) L", tank_)) {
  2177.                 if (tank_1 <= 5 && oldTank != Ceil(tank_1)) {
  2178.                     SendClientMessage(PREFIX . "Achtung! Dein Tank ist fast leer, es befinde" . (tank_1 == 1 ? "t" : "n") . " sich nur noch " . SECCOL . tank_1 . " Liter {FFFFFF}darin.")
  2179.                     oldTank := Ceil(tank_1)
  2180.                     break
  2181.                 }
  2182.             }
  2183.         }
  2184.     }
  2185. }
  2186. return
  2187.  
  2188. findLinie() {
  2189.     busLine := 0
  2190.     distance := 10000000
  2191.     coords := getCoordinates()
  2192.    
  2193.     global oTextLabelData
  2194.    
  2195.     if (!updateTextLabelData())
  2196.         return
  2197.    
  2198.     vehicleID := getVehicleID()
  2199.    
  2200.     for i, o in oTextLabelData {
  2201.         if (o.VEHICLEID == vehicleID) {
  2202.             if (RegExMatch(o.TEXT, "Linie (\d+)\n(.+)", label_)) {
  2203.                 busLine := label_1
  2204.             }
  2205.            
  2206.             break
  2207.         }
  2208.     }
  2209.    
  2210.     return busLine
  2211. }
  2212.  
  2213. ChatlogSaveTimer:
  2214. {
  2215.     if (chatlogSaver) {
  2216.         WinWait, GTA:SA:MP, , 1
  2217.        
  2218.         if (ErrorLevel) {
  2219.             return
  2220.         }
  2221.        
  2222.         WinWaitClose, GTA:SA:MP, , 1
  2223.        
  2224.         if (ErrorLevel) {
  2225.             return
  2226.         }
  2227.        
  2228.         FileCreateDir, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups
  2229.         FormatTime, time, %A_Now%, dd.MM.yy - HH.mm
  2230.         FileCopy, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups\chatlog %time% Uhr.txt, 0
  2231.        
  2232.         MsgBox, Der Chatlog wurde gespeichert.
  2233.        
  2234.         FormatTime, time, , dd.MM.yyyy HH:mm:ss
  2235.         FileAppend, [%time%] Der Chatlog wurde gespeichert. Beginne von Vorne.`n, log.txt
  2236.     }
  2237. }
  2238. return
  2239.  
  2240. LottoTimer:
  2241. {
  2242.     if (lottoSystem) {
  2243.         if (A_Min == 0 && A_Hour != oldHour) {
  2244.             SendChat("/lotto")
  2245.            
  2246.             SendClientMessage(PREFIX . "Möchtest du dir ein Lottoticket kaufen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
  2247.            
  2248.             oldHour := A_Hour
  2249.            
  2250.             KeyWait, X, D, T10
  2251.            
  2252.             if (!ErrorLevel) {
  2253.                 if (lottoNumber == 0) {
  2254.                     Random, randomNumber, 1, 200
  2255.                    
  2256.                     SendChat("/lotto " . randomNumber)
  2257.                 } else if (lottoNumber == 201) {
  2258.                     SendChat("/lotto " . getId())
  2259.                 } else {
  2260.                     SendChat("/lotto " . lottoNumber)
  2261.                 }
  2262.             }
  2263.         }
  2264.     }
  2265. }
  2266. return
  2267.  
  2268. isConnected() {
  2269.     coords := getCoordinates()
  2270.    
  2271.     if ((coords[1] == 384 && coords[2] == -1557 && coords[3] == 20) || (Round(coords[1]) == 1531 && Round(coords[2]) == -1734 && Round(coords[3]) == 13)) {
  2272.         return false
  2273.     }
  2274.    
  2275.     return true
  2276. }
  2277.  
  2278. KillTimer:
  2279. {
  2280.     data := getKills()
  2281.    
  2282.     if (data && isConnected()) {
  2283.         For index, object in data
  2284.         {
  2285.             IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
  2286.             IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
  2287.             IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
  2288.             IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
  2289.            
  2290.             if (object.victim.local) {
  2291.                 Sleep, 100
  2292.                
  2293.                 chat0 := readChatLine(0)
  2294.                 chat1 := readChatLine(1)
  2295.                 chat2 := readChatLine(2)
  2296.                
  2297.                 if (RegExMatch(chat0 . chat1 . chat2, "Paintball: (\S+) wurde von (\S+) getötet\.")) {
  2298.                     return
  2299.                 }
  2300.                
  2301.                 alltimeDeaths++
  2302.                 dayDeaths++
  2303.                
  2304.                 allKD := Round(alltimeKills / alltimeDeaths, 2)
  2305.                 dayKD := Round(dayKills / dayDeaths, 2)
  2306.                
  2307.                 IniWrite, %alltimeDeaths%, stats.ini, Gesamt, Tode
  2308.                 IniWrite, %dayDeaths%, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%]
  2309.                
  2310.                 if (killCounter) {
  2311.                     SendClientMessage(PREFIX . "Tode: " . SECCOL . FormatNumber(alltimeDeaths) . " {FFFFFF}Tages-Tode: " . SECCOL . FormatNumber(dayDeaths) . " {FFFFFF}K/D: " . SECCOL . allKD . " {FFFFFF}Tages-K/D: " . SECCOL . dayKD)
  2312.                 }
  2313.                
  2314.                 if (deathMessageActive && deathMessage != "") {
  2315.                     deathMessageText := deathMessage
  2316.                     deathMessageText := StrReplace(deathMessageText, "[name]", getUsername())
  2317.                     deathMessageText := StrReplace(deathMessageText, "[id]", getId())
  2318.                     deathMessageText := StrReplace(deathMessageText, "[zone]", getPlayerZone())
  2319.                     deathMessageText := StrReplace(deathMessageText, "[city]", getPlayerCity())
  2320.                     deathMessageText := StrReplace(deathMessageText, "[hp]", getPlayerHealth())
  2321.                     deathMessageText := StrReplace(deathMessageText, "[armour]", getPlayerArmor())
  2322.                     deathMessageText := StrReplace(deathMessageText, "[kills]", FormatNumber(alltimeKills))
  2323.                     deathMessageText := StrReplace(deathMessageText, "[daykills]", FormatNumber(daykills))
  2324.                     deathMessageText := StrReplace(deathMessageText, "[deaths]", FormatNumber(alltimeDeaths))
  2325.                     deathMessageText := StrReplace(deathMessageText, "[tode]", FormatNumber(alltimeDeaths))
  2326.                     deathMessageText := StrReplace(deathMessageText, "[daydeaths]", FormatNumber(dayDeaths))
  2327.                     deathMessageText := StrReplace(deathMessageText, "[kd]", allKD)
  2328.                     deathMessageText := StrReplace(deathMessageText, "[daykd]", dayKD)
  2329.                    
  2330.                     if (deathMessageLocal) {
  2331.                         SendClientMessage(PREFIX . deathMessageText)
  2332.                     } else {
  2333.                         SendChat(deathMessageText)
  2334.                     }
  2335.                 }
  2336.             } else if (object.murderer.local) {
  2337.                 ; Funktioniert nicht besonders gut
  2338.                 /*
  2339.                 Sleep, 100
  2340.                
  2341.                 chat0 := readChatLine(0)
  2342.                 chat1 := readChatLine(1)
  2343.                 chat2 := readChatLine(2)
  2344.                
  2345.                 if (RegExMatch(chat0 . chat1 . chat2, "Paintball: (\S+) wurde von (\S+) getötet\.")) {
  2346.                     return
  2347.                 }
  2348.                 */
  2349.             }
  2350.         }
  2351.     }
  2352.    
  2353.     chat := readChatLine(0) . readChatLine(1) . readChatLine(2)
  2354.     gameText := getGameText(3, 28)
  2355.    
  2356.     if (InStr(chat, "( Mord ). Zeuge: ") || InStr(gameText, "~g~Gang") || InStr(gameText, "~g~Team")) {
  2357.         if (InStr(chat, "Kills: ") && InStr(chat, "Tages-Kills: ") && InStr(chat, "K/D: ")) {
  2358.             return
  2359.         }
  2360.        
  2361.         IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
  2362.         IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
  2363.         IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
  2364.         IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
  2365.        
  2366.         alltimeKills++
  2367.         dayKills++
  2368.        
  2369.         allKD := Round(alltimeKills / alltimeDeaths, 2)
  2370.         dayKD := Round(dayKills / dayDeaths, 2)
  2371.        
  2372.         IniWrite, %alltimeKills%, stats.ini, Gesamt, Kills
  2373.         IniWrite, %dayKills%, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%]
  2374.        
  2375.         if (deathCounter) {
  2376.             SendClientMessage(PREFIX . "Kills: " . SECCOL . FormatNumber(alltimeKills) . " {FFFFFF}Tages-Kills: " . SECCOL . FormatNumber(dayKills) . " {FFFFFF}K/D: " . SECCOL . allKD . " {FFFFFF}Tages-K/D: " . SECCOL . dayKD)
  2377.         }
  2378.        
  2379.         if (killMessageActive && killMessage != "") {
  2380.             killMessageText := killMessage
  2381.             killMessageText := StrReplace(killMessageText, "[name]", getUsername())
  2382.             killMessageText := StrReplace(killMessageText, "[id]", getId())
  2383.             killMessageText := StrReplace(killMessageText, "[zone]", getPlayerZone())
  2384.             killMessageText := StrReplace(killMessageText, "[city]", getPlayerCity())
  2385.             killMessageText := StrReplace(killMessageText, "[hp]", getPlayerHealth())
  2386.             killMessageText := StrReplace(killMessageText, "[armour]", getPlayerArmor())
  2387.             killMessageText := StrReplace(killMessageText, "[kills]", FormatNumber(alltimeKills))
  2388.             killMessageText := StrReplace(killMessageText, "[daykills]", FormatNumber(daykills))
  2389.             killMessageText := StrReplace(killMessageText, "[deaths]", FormatNumber(alltimeDeaths))
  2390.             killMessageText := StrReplace(killMessageText, "[tode]", FormatNumber(alltimeDeaths))
  2391.             killMessageText := StrReplace(killMessageText, "[daydeaths]", FormatNumber(dayDeaths))
  2392.             killMessageText := StrReplace(killMessageText, "[kd]", allKD)
  2393.             killMessageText := StrReplace(killMessageText, "[daykd]", dayKD)
  2394.            
  2395.             if (killMessageLocal) {
  2396.                 SendClientMessage(PREFIX . killMessageText)
  2397.             } else {
  2398.                 SendChat(killMessageText)
  2399.             }
  2400.            
  2401.             if (InStr(gameText, "~g~Gang") || InStr(gameText, "~g~Team")) {
  2402.                 Sleep, 5500
  2403.             }
  2404.         }
  2405.     }
  2406. }
  2407. return
  2408.  
  2409. ChatTimer:
  2410. {
  2411.     IfWinNotActive, GTA:SA:MP
  2412.         return
  2413.    
  2414.     if (chatLogFile.Length < chatLogLines.Length()) {
  2415.         chatLogFile := FileOpen(A_MyDocuments . "\GTA San Andreas User Files\SAMP\chatlog.txt", "r")
  2416.         chatLogLines := []
  2417.     }
  2418.    
  2419.     while (!chatLogFile.AtEOF) {
  2420.         line := chatLogFile.ReadLine()
  2421.         line := RegExReplace(line, "U)^\[\d{2}:\d{2}:\d{2}\] ")
  2422.         line := StrReplace(line, "`r`n")
  2423.         line := StrReplace(line, "`r")
  2424.         line := RegExReplace(line, "{\S{6}}", "")
  2425.        
  2426.         if (line != "") {
  2427.             chatLogLines.Push(line)
  2428.            
  2429.             if (!firstChatLogRun) {
  2430.                 handleChatMessage(line, chatLogLines.Length(), chatLogLines)
  2431.             }
  2432.         }
  2433.     }
  2434.    
  2435.     firstChatLogRun := false
  2436. }
  2437. return
  2438.  
  2439. handleChatMessage(message, index, arr) {
  2440.     global
  2441.    
  2442.     if (RegExMatch(message, "^WARNUNG: Hör auf zu Spamen, sonst wirst du gekickt!$")) {
  2443.         if (antispamSystem) {
  2444.             blockChatInput()
  2445.             SendClientMessage(PREFIX . "Spamschutz-System {00FF00}aktiviert{FFFFFF}!")
  2446.            
  2447.             SetTimer, SpamTimer, -1500
  2448.         }
  2449.     } else if (RegExMatch(message, "^\* Du kannst mit \/service einen Wheelman rufen, der dich befreien kann \(für bis zu (\d+)\$\)\.$")) {
  2450.         SetTimer, WheelmanTimer, -1
  2451.     } else if (RegExMatch(message, "^\* Sanitäter (\S+) bietet dir ein Erste-Hilfe-Paket für \$(\d+) an\. Benutze \/accept Paket$", message_)) {
  2452.         medicName := message_1
  2453.        
  2454.         SetTimer, PaketTimer, -1
  2455.     } else if (RegExMatch(message, "^\* \$(\d+) werden am nächsten Payday Gutgeschrieben\.$", stats_)) {
  2456.         IniRead, pilotXP, stats.ini, Pilot, XP, 0
  2457.         IniRead, pilotMoney, stats.ini, Pilot, Geld, 0
  2458.        
  2459.         pilotXP++
  2460.         pilotMoney += stats_1
  2461.         paydayMoney += stats_1
  2462.        
  2463.         IniWrite, %pilotXP%, stats.ini, Pilot, XP
  2464.         IniWrite, %pilotMoney%, stats.ini, Pilot, Geld
  2465.        
  2466.         SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(pilotXP) . " {FFFFFF}Runden geflogen und hast ingesamt " . SECCOL . FormatNumber(pilotMoney) . "$ {FFFFFF}(brutto) verdient.")
  2467.     } else if (RegExMatch(message, "^Du hast (\S+) Kubikmeter Müll abgeliefert und erhälst am nächsten Payday (\d+)\$\.$", stats_)) {
  2468.         IniRead, garbageXP, stats.ini, Müllmann, XP, 0
  2469.         IniRead, garbageKubik, stats.ini, Müllmann, Kubik, 0
  2470.         IniRead, garbageMoney, stats.ini, Müllmann, Geld, 0
  2471.        
  2472.         garbageXP++
  2473.         garbageKubik += stats_1
  2474.         garbageMoney += stats_2
  2475.         paydayMoney += stats_2
  2476.        
  2477.         IniWrite, %garbageXP%, stats.ini, Müllmann, XP
  2478.         IniWrite, %garbageKubik%, stats.ini, Müllmann, Kubik
  2479.         IniWrite, %garbageMoney%, stats.ini, Müllmann, Geld
  2480.        
  2481.         SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(garbageXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(garbageMoney) . "$ {FFFFFF}(brutto) verdient.")
  2482.         SendClientMessage(PREFIX . "Du hast ingesamt " . SECCOL . Round(garbageKubik, 1) . " Kubik {FFFFFF}abgeliefert.")
  2483.     } else if (RegExMatch(message, "^In der Nähe vom Hafen kannst du keine Reuse auslegen\.$")) {
  2484.         playerCoords := getCoordinates()
  2485.         distance := Round(getDistanceToPoint(-2330, 2207, 5, playerCoords[1], playerCoords[2], playerCoords[3]))
  2486.        
  2487.         SendClientMessage(PREFIX . "Du bist noch zu nah am Hafen. Fahre noch " . SECCOL . (500 - distance) . "m")
  2488.     } else if (RegExMatch(message, "^Du legst Reuse (\d+) an dieser Position aus\.$", message_)) {
  2489.         fishTraps[message_1] := getCoordinates()
  2490.        
  2491.         SendClientMessage(PREFIX . "Reuse " . message_1 . " wurde hier erfolgreich ausgelegt. Fahre 400m um die nächste Reuse auslegen zu können.")
  2492.     } else if (RegExMatch(message, "^Du hast bereits in der Nähe eine Reuse ausgelegt\.$")) {
  2493.         playerCoords := getCoordinates()
  2494.         nearest := false
  2495.         nearestDistance := 10000000
  2496.        
  2497.         for index, entry in fishTraps {
  2498.             if (entry) {
  2499.                 distance := getDistanceToPoint(playerCoords[1], playerCoords[2], playerCoords[3], entry[1], entry[2], entry[3])
  2500.                
  2501.                 if (distance < nearestDistance) {
  2502.                     nearest := entry
  2503.                     nearestDistance := distance
  2504.                 }
  2505.             }
  2506.         }
  2507.        
  2508.         if (nearest) {
  2509.             SendClientMessage(PREFIX . "Du bist noch zu nah an der letzten Reuse. Fahre noch " . SECCOL . (400 - Round(nearestDistance)) . "m")
  2510.         }
  2511.     } else if (RegExMatch(message, "^(\S+): (\d+) \((\d+)\$\)$", message_)) {
  2512.         IniRead, fishStats, stats.ini, Hochseefischer, %message_1%, 0
  2513.        
  2514.         fishStats += message_2
  2515.        
  2516.         IniWrite, %fishStats%, stats.ini, Hochseefischer, %message_1%
  2517.     } else if (RegExMatch(message, "^Du hast deine Fische am Hafen verkauft und erhälst am nächsten Payday (\d+)\$\.$", message_)) {
  2518.         IniRead, fishingMoney, stats.ini, Hochseefischer, Geld, 0
  2519.         IniRead, fishingXP, stats.ini, Hochseefischer, XP, 0
  2520.        
  2521.         fishingMoney += message_1
  2522.         paydayMoney += message_1
  2523.        
  2524.         IniWrite, %fishingMoney%, stats.ini, Hochseefischer, Geld
  2525.        
  2526.         SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(fishingXP) . " {FFFFFF}Reusen eingeholt und ingesamt " . SECCOL . FormatNumber(fishingMoney) . "$ {FFFFFF}(brutto) verdient.")
  2527.        
  2528.         fishingFull := false
  2529.     } else if (RegExMatch(message, "^Du hast Reuse (\d) aus dem Wasser gezogen und folgende Fische gefunden:$", message_)) {
  2530.         IniRead, fishingXP, stats.ini, Hochseefischer, XP, 0
  2531.        
  2532.         fishingXP++
  2533.        
  2534.         IniWrite, %fishingXP%, stats.ini, Hochseefischer, XP
  2535.     } else if (RegExMatch(message, "^Du ziehst nun Reuse (\d+) aus dem Wasser\.$", message_)) {
  2536.         fishTraps[message_1] := false
  2537.     } else if (RegExMatch(message, "^Es passen keine Fische mehr in das Boot, die restlichen Fische in der Reuse wurden freigelassen\.$")) {
  2538.         fishingFull := true
  2539.     } else if (RegExMatch(message, "^Du hast den Auftrag (\d+) \((.+)\) abgeschlossen und erhälst am nächsten Payday (\d+)\$\.$", stats_)) {
  2540.         IniRead, truckerXP, stats.ini, Trucker, XP, 0
  2541.         IniRead, truckerMoney, stats.ini, Trucker, Geld, 0
  2542.        
  2543.         truckerXP++
  2544.         truckerMoney += stats_3
  2545.         paydayMoney += stats_3
  2546.        
  2547.         IniWrite, %truckerXP%, stats.ini, Trucker, XP
  2548.         IniWrite, %truckerMoney%, stats.ini, Trucker, Geld
  2549.        
  2550.         SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(truckerXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(truckerMoney) . "$ {FFFFFF}(brutto) verdient.")
  2551.     } else if (RegExMatch(message, "^\* Du hast die Fahrt Beendet\. \$(\d+) werden am nächsten Payday Gutgeschrieben!$", stats_)) {
  2552.         IniRead, trainXP, stats.ini, Zugfahrer, XP, 0
  2553.         IniRead, trainMoney, stats.ini, Zugfahrer, Geld, 0
  2554.        
  2555.         trainXP++
  2556.         trainMoney += stats_1
  2557.         paydayMoney += stats_1
  2558.        
  2559.         IniWrite, %trainXP%, stats.ini, Zugfahrer, XP
  2560.         IniWrite, %trainMoney%, stats.ini, Zugfahrer, Geld
  2561.        
  2562.         SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(trainXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(trainMoney) . "$ {FFFFFF}(brutto) verdient.")
  2563.     } else if (RegExMatch(message, "^Total: (\d+)\$$", stats_)) {
  2564.         Loop, 10 {
  2565.             gardener := arr[index - A_Index]
  2566.            
  2567.             if (RegExMatch(gardener, "^--------------- Gärtner: Gehaltscheck ---------------$")) {
  2568.                 IniRead, gardenerXP, stats.ini, Gärtner, XP, 0
  2569.                 IniRead, gardenerMoney, stats.ini, Gärtner, Geld, 0
  2570.                 IniRead, gardenerMaxMoney, stats.ini, Gärtner, Höchstverdienst, 0
  2571.                
  2572.                 if (stats_1 > gardenerMaxMoney) {
  2573.                     SendClientMessage(PREFIX . "Das war bisher deine beste Tour! Neuer Höchstverdienst: " . SECCOL . FormatNumber(stats_1) . "$")
  2574.                    
  2575.                     IniWrite, %stats_1%, stats.ini, Gärtner, Höchstverdienst
  2576.                 }
  2577.                
  2578.                 gardenerXP++
  2579.                 gardenerMoney += stats_1
  2580.                 paydayMoney += stats_1
  2581.                
  2582.                 IniWrite, %gardenerXP%, stats.ini, Gärtner, XP
  2583.                 IniWrite, %gardenerMoney%, stats.ini, Gärtner, Geld
  2584.                
  2585.                 SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(gardenerXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(gardenerMoney) . "$ {FFFFFF}(brutto) verdient.")
  2586.                 break
  2587.             }
  2588.         }
  2589.     } else if (RegExMatch(message, "^\[Gärtner\]: Die Runde wurde beendet und du erhältst (.+) deines Fortschrittes \((\d+)\$\) am nächsten Payday ausgezahlt\.$", message_)) {
  2590.         if (message_2 > 0) {
  2591.             IniRead, gardenerXP, stats.ini, Gärtner, XP, 0
  2592.             IniRead, gardenerMoney, stats.ini, Gärtner, Geld, 0
  2593.             IniRead, gardenerMaxMoney, stats.ini, Gärtner, Höchstverdienst, 0
  2594.            
  2595.             if (message_2 > gardenerMaxMoney) {
  2596.                 SendClientMessage(PREFIX . "Das war bisher deine beste Tour! Neuer Höchstverdienst: " . SECCOL . FormatNumber(message_2) . "$")
  2597.                
  2598.                 IniWrite, %message_2%, stats.ini, Gärtner, Höchstverdienst
  2599.             }
  2600.            
  2601.             gardenerXP++
  2602.             gardenerMoney += message_2
  2603.             paydayMoney += message_2
  2604.            
  2605.             IniWrite, %gardenerXP%, stats.ini, Gärtner, XP
  2606.             IniWrite, %gardenerMoney%, stats.ini, Gärtner, Geld
  2607.            
  2608.             SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(gardenerXP) . " {FFFFFF}Runden gefahren und hast ingesamt " . SECCOL . FormatNumber(gardenerMoney) . "$ {FFFFFF}(brutto) verdient.")
  2609.         }
  2610.     } else if (RegExMatch(message, "^Gesamte XP: (\d+) \(\+(\d+) XP\)$", message_)) {
  2611.         IniWrite, %stats_1%, stats.ini, Farmer, XP
  2612.        
  2613.         farmer := arr[index - 1]
  2614.        
  2615.         if (RegExMatch(farmer, "^Total: (\d+)\$\.$", farmer_)) {
  2616.             IniRead, farmerMoney, stats.ini, Farmer, Geld, 0
  2617.             IniRead, farmerMaxMoney, stats.ini, Farmer, Höchstverdienst, 0
  2618.            
  2619.             if (farmer_1 > farmerMaxMoney) {
  2620.                 SendClientMessage(PREFIX . "Das war bisher deine beste Tour! Neuer Höchstverdienst: " . SECCOL . FormatNumber(farmer_1) . "$")
  2621.                
  2622.                 IniWrite, %farmer_1%, stats.ini, Farmer, Höchstverdienst
  2623.             }
  2624.            
  2625.             farmerMoney += farmer_1
  2626.             paydayMoney += farmer_1
  2627.            
  2628.             IniWrite, %farmerMoney%, stats.ini, Farmer, Geld
  2629.            
  2630.             SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(message_1) . " {FFFFFF}Touren gefahren und hast ingesamt " . SECCOL . FormatNumber(farmerMoney) . "$ {FFFFFF}(brutto) verdient.")
  2631.         }
  2632.     } else if (RegExMatch(message, "^Du hast (\d+)g Marihuana im Crew Lager abgeliefert \(\+(\d+) XP\)\.$", message_)) {
  2633.         IniRead, drugXP, stats.ini, Drogen, XP, 0
  2634.         IniRead, drugs, stats.ini, Drogen, Gramm, 0
  2635.        
  2636.         drugXP += message_2
  2637.         drugs += message_1
  2638.        
  2639.         IniWrite, %drugXP%, stats.ini, Drogen, XP
  2640.         IniWrite, %drugs%, stats.ini, Drogen, Gramm
  2641.        
  2642.         SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(drugXP) . " EXP {FFFFFF}gesammelt und " . SECCOL . FormatNumber(drugs) . "g {FFFFFF}Drogen am Crewlager abgeliefert.")
  2643.     } else if (RegExMatch(message, "^Du hast (\d+) Samen für (\d+)\$ gekauft\.$", message_)) {
  2644.         IniRead, drugsBought, stats.ini, Drogen, AnzahlGekauft, 0
  2645.         IniRead, moneySpent, stats.ini, Drogen, Ausgaben, 0
  2646.        
  2647.         drugsBought += message_1
  2648.         moneySpent += message_2
  2649.        
  2650.         IniWrite, %drugsBought%, stats.ini, Drogen, AnzahlGekauft
  2651.         IniWrite, %moneySpent%, stats.ini, Drogen, Ausgaben
  2652.        
  2653.         drugStatus := false
  2654.         SendClientMessage(PREFIX . "Du hast erfolgreich " . SECCOL . FormatNumber(message_1) . " {FFFFFF}Samen für " . SECCOL . FormatNumber(message_2) . "$ {FFFFFF}gekauft.")
  2655.         SendClientMessage(PREFIX . "Gesamte Anzahl gekaufter Samen: " . SECCOL . FormatNumber(drugsBought) . " {FFFFFF}Gesamtausgaben: " . SECCOL . FormatNumber(moneySpent) . "$")
  2656.     } else if (RegExMatch(message, "^Inklusive Zeitbonus in Höhe von (\d+)g hast du insgesamt (\d+)g Marihuana aus deinen (\d+) Samen geerntet\.$", message_)) {
  2657.         IniRead, drugsHarvested, stats.ini, Drogen, AnzahlGeerntet, 0
  2658.        
  2659.         drugsHarvested += message_2
  2660.        
  2661.         IniWrite, %drugsHarvested%, stats.ini, Drogen, AnzahlGeerntet
  2662.        
  2663.         SendClientMessage(PREFIX . "Du hast deine Drogen nach " . SECCOL . formatTime(drugGrowTime) . " {FFFFFF}geerntet.")
  2664.         SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(drugsHarvested) . "g {FFFFFF}Drogen geerntet. Du kannst nun wieder neue Drogen kaufen.")
  2665.        
  2666.         drugStatus := false
  2667.         drugGrowTime := -1
  2668.         drugTime := 0
  2669.        
  2670.         SetTimer, DrugTimer, Off
  2671.     } else if (RegExMatch(message, "^Der Mindestertrag an Drogen ist abhängig von der Zeit, mindestens jedoch werden (\d+) Minuten benötigt\.$", message_)) {
  2672.         drugStatus := true
  2673.        
  2674.         SendClientMessage(PREFIX . "Du hast deine Samen hier gepflanzt. Du wirst in " . SECCOL . message_1 . " Minuten {FFFFFF}informiert, dass du ernten kannst.")
  2675.        
  2676.         drugGrowTime := 0
  2677.         drugTime := message_1 * 60
  2678.        
  2679.         SetTimer, DrugTimer, 1000
  2680.     } else if (RegExMatch(message, "^Du besitzt keine Samen\.$")) {
  2681.         SendChat("/seed buy")
  2682.     } else if (RegExMatch(message, "^Du hast (\d+)g Waffenstahl für deine (\d+) Pakete erhalten\.$", chatLine0_)) {
  2683.         IniRead, matsFarmed, stats.ini, Materialien, Waffenstahl, 0
  2684.        
  2685.         matsFarmed += chatLine0_1
  2686.        
  2687.         IniWrite, %matsFarmed%, stats.ini, Materialien, Waffenstahl
  2688.        
  2689.         SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(matsFarmed) . "g {FFFFFF}Waffenstahl gefarmt. Du musst diese nun am Lagerhaus abliefern.")
  2690.     } else if (RegExMatch(message, "^Fehler: Du hast keine Pakete bei dir\. Kaufe Pakete mit \/materials get\.$")) {
  2691.         SendChat("/materials get")
  2692.     } else if (RegExMatch(message, "^Fehler: Du transportierst keine Pakete im Fahrzeug\.$")) {
  2693.         SendChat("/materials get")
  2694.     } else if (RegExMatch(message, "^Du hast (\d+) Materialien-Pakete für (\d+)\$ erworben\. Du (\S+) nun (\d+) Pakete (.+)\.$", message_)) {
  2695.         IniRead, matsBought, stats.ini, Materialien, AnzahlGekauft, 0
  2696.         IniRead, moneySpent, stats.ini, Materialien, Ausgaben, 0
  2697.        
  2698.         matsBought += message_1
  2699.         moneySpent += message_2
  2700.        
  2701.         IniWrite, %matsBought%, stats.ini, Materialien, AnzahlGekauft
  2702.         IniWrite, %moneySpent%, stats.ini, Materialien, Ausgaben
  2703.        
  2704.         SendClientMessage(PREFIX . "Du hast erfolgreich " . SECCOL . FormatNumber(message_1) . " {FFFFFF}Materialpakete für " . SECCOL . FormatNumber(message_2) . "$ {FFFFFF}gekauft.")
  2705.         SendClientMessage(PREFIX . "Gesamte Anzahl gekaufter Materialpakete: " . SECCOL . FormatNumber(matsBought) . " {FFFFFF}Gesamtausgaben: " . SECCOL . FormatNumber(moneySpent) . "$")
  2706.     } else if (RegExMatch(message, "^Du hast (\d+)g Waffenstahl im Crew Lager abgeliefert \(\+(\d+) XP\)\.$", message_)) {
  2707.         IniRead, matsXP, stats.ini, Materialien, XP, 0
  2708.         IniRead, mats, stats.ini, Materialien, Anzahl, 0
  2709.        
  2710.         matsXP += message_2
  2711.         mats += message_1
  2712.        
  2713.         IniWrite, %matsXP%, stats.ini, Materialien, XP
  2714.         IniWrite, %mats%, stats.ini, Materialien, Anzahl
  2715.        
  2716.         SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(matsXP) . " EXP {FFFFFF}gesammelt und " . SECCOL . FormatNumber(mats) . "g {FFFFFF}Materialien am Crewlager abgeliefert.")
  2717.     } else if (RegExMatch(message, "^Du hast (\d+) Produkte für (\d+)\$ gekauft\.$", message_)) {
  2718.         IniRead, prodBought, stats.ini, Produkte, Gekauft, 0
  2719.         IniRead, moneySpent, stats.ini, Produkte, Ausgaben, 0
  2720.        
  2721.         prodBought += message_1
  2722.         moneySpent += message_2
  2723.        
  2724.         IniWrite, %prodBought%, stats.ini, Produkte, Gekauft
  2725.         IniWrite, %moneySpent%, stats.ini, Produkte, Ausgaben
  2726.        
  2727.         SendClientMessage(PREFIX . "Du hast erfolgreich " . SECCOL . FormatNumber(message_1) . " {FFFFFF}Produkte für " . SECCOL . FormatNumber(message_2) . "$ {FFFFFF}gekauft.")
  2728.         SendClientMessage(PREFIX . "Gesamte Anzahl gekaufter Produkte: " . SECCOL . FormatNumber(prodBought) . " {FFFFFF}Gesamtausgaben: " . SECCOL . FormatNumber(moneySpent) . "$")
  2729.     } else if (RegExMatch(message, "^Du hast (\d+) Produkte im Crew Lager abgeliefert\.$", message_)) {
  2730.         IniRead, prods, stats.ini, Produkte, Anzahl, 0
  2731.        
  2732.         prods += message_1
  2733.        
  2734.         IniWrite, %prods%, stats.ini, Produkte, Anzahl
  2735.        
  2736.         SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(prods) . " {FFFFFF}Produkte am Crewlager abgeliefert.")
  2737.     } else if (RegExMatch(message, "^Du hast (\d+) L Rohöl für (\d+)\$ gekauft\.$", message_)) {
  2738.         IniRead, oilBought, stats.ini, Oil, Gekauft, 0
  2739.         IniRead, moneySpent, stats.ini, Oil, Ausgaben, 0
  2740.        
  2741.         oilBought += message_1
  2742.         moneySpent += message_2
  2743.        
  2744.         IniWrite, %oilBought%, stats.ini, Oil, Gekauft
  2745.         IniWrite, %moneySpent%, stats.ini, Oil, Ausgaben
  2746.        
  2747.         SendClientMessage(PREFIX . "Du hast erfolgreich " . SECCOL . FormatNumber(message_1) . " Liter {FFFFFF}Rohöl für " . SECCOL . FormatNumber(message_2) . "$ {FFFFFF}gekauft.")
  2748.         SendClientMessage(PREFIX . "Gesamte Anzahl gekauftes Rohöl: " . SECCOL . FormatNumber(oilBought) . " Liter {FFFFFF}Gesamtausgaben: " . SECCOL . FormatNumber(moneySpent) . "$")
  2749.     } else if (RegExMatch(message, "^Du hast (\d+) L Rohöl im Crew Lager abgeliefert\.$", stats_)) {
  2750.         IniRead, oil, stats.ini, Oil, Liter, 0
  2751.        
  2752.         oil += stats_1
  2753.        
  2754.         IniWrite, %oil%, stats.ini, Oil, Liter
  2755.        
  2756.         SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(oil) . " Liter {FFFFFF}Rohöl am Crewlager abgeliefert.")
  2757.     } else if (RegExMatch(message, "^Du hast diesen Store erfolgreich überfallen, die Beute wurde der Crew Kasse gutgeschrieben\.$")) {
  2758.         store := arr[index - 1]
  2759.        
  2760.         if (RegExMatch(store, "^\*\* (.+) " . getUsername() . " hat ein Store im GK (\S+) erfolgreich überfallen\. Beute: (\d+)\$$", store_)) {
  2761.             IniRead, storeRobCount, stats.ini, StoreRob, Anzahl, 0
  2762.             IniRead, storeRobCountToday, stats.ini, StoreRob, Anzahl[%A_DD%:%A_MM%:%A_YYYY%], 0
  2763.             IniRead, storeRobMoney, stats.ini, StoreRob, Geld, 0
  2764.             IniRead, storeRobMoneyToday, stats.ini, StoreRob, Geld[%A_DD%:%A_MM%:%A_YYYY%], 0
  2765.            
  2766.             storeRobCount++
  2767.             storeRobCountToday++
  2768.             storeRobMoney += store_3
  2769.             storeRobMoneyToday += store_3
  2770.            
  2771.             IniWrite, %storeRobCount%, stats.ini, StoreRob, Anzahl
  2772.             IniWrite, %storeRobCountToday%, stats.ini, StoreRob, Anzahl[%A_DD%:%A_MM%:%A_YYYY%]
  2773.             IniWrite, %storeRobMoney%, stats.ini, StoreRob, Geld
  2774.             IniWrite, %storeRobMoneyToday%, stats.ini, StoreRob, Geld[%A_DD%:%A_MM%:%A_YYYY%]
  2775.            
  2776.             Sleep, 250
  2777.            
  2778.             SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(storeRobCount) . " Läden {FFFFFF}und " . SECCOL . FormatNumber(storeRobMoney) . "$ {FFFFFF}ausgeraubt (gesamt).")
  2779.             SendClientMessage(PREFIX . "Heute: " . SECCOL . FormatNumber(storeRobCountToday) . " Läden{FFFFFF}, " . SECCOL . FormatNumber(storeRobMoneyToday) . "$")
  2780.         }
  2781.     } else if (RegExMatch(message, "^Paintball: (\S+) wurde von (\S+) getötet\.$", message_)) {
  2782.         if (message_1 == getUsername()) {
  2783.             IniRead, pbDeaths, stats.ini, Paintball, Tode, 0
  2784.             pbDeaths++
  2785.             IniWrite, %pbDeaths%, stats.ini, Paintball, Tode
  2786.            
  2787.             SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(pbDeaths) . "{FFFFFF}-mal im Paintball gestorben.")
  2788.            
  2789.             if (pbKillStreak > 0 && paintballMessages)
  2790.                 SendChat("/l Meine Killstreak war: " . pbKillStreak)
  2791.            
  2792.             pbKillStreak := 0
  2793.         } else if (message_2 == getUsername()) {
  2794.             IniRead, pbKills, stats.ini, Paintball, Kills, 0
  2795.             pbKills++
  2796.             IniWrite, %pbKills%, stats.ini, Paintball, Kills
  2797.            
  2798.             SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . FormatNumber(pbKills) . " {FFFFFF}Spieler im Paintball getötet.")
  2799.            
  2800.             pbKillStreak++
  2801.            
  2802.             if (paintballMessages) {
  2803.                 IniRead, pbHighestKillStreak, stats.ini, Paintball, Killstreak, 0
  2804.                
  2805.                 if (pbKillStreak > pbHighestKillStreak) {
  2806.                     IniWrite, %pbKillStreak%, stats.ini, Paintball, Killstreak
  2807.                    
  2808.                     SendChat("/l Meine neue beste Killstreak: " . pbKillStreak)
  2809.                 } else {
  2810.                     SendChat("/l Meine Killstreak: " . pbKillStreak)
  2811.                 }
  2812.             }
  2813.         }
  2814.     } else if (RegExMatch(message, "^\|=================\|\|============\|\|=================\|$")) {
  2815.         Loop {
  2816.             chat := arr[index - A_Index]
  2817.            
  2818.             if (InStr(chat, "KFZ Steuer:")) {
  2819.                 RegExMatch(chat, "KFZ Steuer: -(\d*)\$", car)
  2820.             }
  2821.            
  2822.             if (InStr(chat, "Lohn: ")) {
  2823.                 RegExMatch(chat, "Lohn: (\d*)\$ \(davon (\d+\$) Bonus durch Upgrade\)     Miete: -(\d*)\$     Lohnsteuer: -(\d*)\$", general)
  2824.             }
  2825.            
  2826.             if (InStr(chat, "Stromrechnung: ")) {
  2827.                 RegExMatch(chat, "Stromrechnung: -(.*)\$", electricity)
  2828.             }
  2829.            
  2830.             if (InStr(chat, "|================| Gehalts-Check |================|")) {
  2831.                 break
  2832.             }
  2833.         }
  2834.        
  2835.         money := general1
  2836.         money -= general3
  2837.         money -= general4
  2838.         money -= car1
  2839.         money -= electricity1
  2840.        
  2841.         SendClientMessage(PREFIX . "Errechneter Payday: " . SECCOL . FormatNumber(paydayMoney) . "$ {FFFFFF}(Brutto) " . SECCOL . FormatNumber(Round(paydayMoney * taxes)) . "$ {FFFFFF}(Netto)")
  2842.         SendClientMessage(PREFIX . "Gehaltsscheck: " . SECCOL . FormatNumber(money) . "$")
  2843.        
  2844.         paydayMoney := 0
  2845.     } else if (RegExMatch(message, "^ > " . getUsername() . " beobachtet (\S+)\.$", message_)) {
  2846.         tv := true
  2847.         tvName := message_1
  2848.        
  2849.         SendClientMessage(PREFIX . "Beobachtungsmodus aktiviert")
  2850.     } else if (RegExMatch(message, "^ > " . getUsername() . " hat die Beobachtung beendet\.$")) {
  2851.         tv := false
  2852.        
  2853.         SendClientMessage(PREFIX . "Beobachtungsmodus deaktiviert")
  2854.     } else if (RegExMatch(message, "^Leerfahrt$")) {
  2855.         start := -1
  2856.         busLine := -1
  2857.        
  2858.         SendClientMessage(PREFIX . "Du hast deine Linie abgebrochen!")
  2859.     } else if (RegExMatch(message, "^Nächste Haltestelle: (.+)$", chat_)) {
  2860.         if (chat_1 == "Busbahnhof Süd" || chat_1 == "Busbahnhof Ost" || chat_1 == "San Fierro Hauptbahnhof" || chat_1 == "Las Venturas Busbahnhof" || chat_1 == "Foster Valley FZ A" || chat_1 == "Foster Valley FZ B") {
  2861.             if (start == -1) {
  2862.                 Sleep, 1000
  2863.                
  2864.                 start := getUnixTimestamp(A_Now)
  2865.                 tempLine := findLinie()
  2866.                
  2867.                 if (tempLine != 0) {
  2868.                     busLine := tempLine
  2869.                    
  2870.                     SendClientMessage(PREFIX . "Du beginnst Linie " . busLine . "!")
  2871.                 } else {
  2872.                     busLine := -1
  2873.                    
  2874.                     SendClientMessage(PREFIX . "Deine Linie konnte nicht korrekt erkannt werden, sie wird vorerst ignoriert!")
  2875.                 }
  2876.             }
  2877.         } else {
  2878.             if (start != -1 && busLine == -1) {
  2879.                 tempLine := findLinie()
  2880.                
  2881.                 if (tempLine != 0) {
  2882.                     busLine := tempLine
  2883.                    
  2884.                     SendClientMessage(PREFIX . "Deine Linie wurde soeben erkannt: Linie " . busLine)
  2885.                 }
  2886.             }
  2887.         }
  2888.     } else if (RegExMatch(message, "^\* Du erhälst am nächsten Payday (\d+)\$ gutgeschrieben\. Erhaltene Exp: (\d+)$", chat_)) {
  2889.         if (start != -1) {
  2890.             IniRead, busRounds, stats.ini, Busfahrer, Runden, 0
  2891.             IniRead, busMoney, stats.ini, Busfahrer, Geld, 0
  2892.            
  2893.             busRounds++
  2894.             busMoney += chat_1
  2895.             paydayMoney += chat_1
  2896.            
  2897.             IniWrite, %busRounds%, stats.ini, Busfahrer, Runden
  2898.             IniWrite, %busMoney%, stats.ini, Busfahrer, Geld
  2899.            
  2900.             end := getUnixTimestamp(A_Now)
  2901.             diff := end - start
  2902.            
  2903.             SendClientMessage(PREFIX . "Du hast Linie " . busLine . " für " . SECCOL . FormatNumber(chat_1) . "$ {FFFFFF}beendet und " . SECCOL . chat_2 . " EXP {FFFFFF}erhalten. Zeit: " . SECCOL . formatTime(diff))
  2904.             SendClientMessage(PREFIX . "Du bist bereits " . SECCOL . FormatNumber(busRounds) . " Runden {FFFFFF}gefahren und hast " . SECCOL . FormatNumber(busMoney) . "$ {FFFFFF}verdient.")
  2905.            
  2906.             if (busSendToJobChat) {
  2907.                 SendChat("/j Ich habe Linie " . busLine . " für " . FormatNumber(chat_1) . "$ beendet und " . chat_2 . " EXP erhalten. Zeit: " . formatTime(diff))
  2908.             }
  2909.            
  2910.             start := -1
  2911.            
  2912.             if (busRestartLine) {
  2913.                 if (busLine == 4) {
  2914.                     busLine := 5
  2915.                 } else if (busLine == 5) {
  2916.                     busLine := 4
  2917.                 } else if (busLine == 8) {
  2918.                     busLine := 9
  2919.                 } else if (busLine == 9) {
  2920.                     busLine := 8
  2921.                 } else if (busLine == 13) {
  2922.                     busLine := 14
  2923.                 } else if (busLine == 14) {
  2924.                     busLine := 13
  2925.                 } else if (busLine == 16) {
  2926.                     busLine := 17
  2927.                 } else if (busLine == 17) {
  2928.                     busLine := 16
  2929.                 } else if (busLine == 19) {
  2930.                     busLine := 20
  2931.                 } else if (busLine == 20) {
  2932.                     busLine := 19
  2933.                 }
  2934.                
  2935.                 selectLine(busLine)
  2936.             }
  2937.         }
  2938.     } else if (RegExMatch(message, "^\*\* (.+) " . getUsername() . " hat ein Überfall im GK (\d+)\.(\d+) \((\S+)\) gestartet\.$", message_)) {
  2939.         storerobTime := 89
  2940.        
  2941.         if (robcountdown) {
  2942.             SetTimer, RobTimer, 1000
  2943.         }
  2944.        
  2945.         data := []
  2946.         data["username"] := getUsername()
  2947.         data["store"] := message_4
  2948.         data["gk"] := message_2 . "." . message_3
  2949.        
  2950.         jsonData := JSON.Dump(data)
  2951.        
  2952.         result := URLDownloadToVar(robBaseURL . "api/updatestore.php?data=" . jsonData)
  2953.        
  2954.         SendClientMessage(PREFIX . result)
  2955.     } else if (RegExMatch(message, "Gestartet von der Rebellen Crew (.+), Beute: (\d+)\$", chat0_)) {
  2956.         chat1 := arr[index - 1]
  2957.        
  2958.         if (RegExMatch(chat1, "Dieser Store wurde bereits ausgeraubt \(noch (.+) gesperrt\)\.", chat1_)) {
  2959.             if (RegExMatch(chat1_1, "(\d+) Stunden und (\d+) Minuten", time)) {
  2960.                 robtime := time1 * 60 + time2
  2961.             } else if (RegExMatch(chat1_1, "(\d+) Minuten", time)) {
  2962.                 robtime := time1
  2963.             } else {
  2964.                 return
  2965.             }
  2966.            
  2967.             SendChat("/crewmembers")
  2968.            
  2969.             Sleep, 200
  2970.            
  2971.             Loop {
  2972.                 if (A_Index > 100)
  2973.                     break
  2974.                
  2975.                 chat := readChatLine(A_Index - 1)
  2976.                
  2977.                 if (RegExMatch(chat, getUsername() . ", (.+) \((.+)\), GK (\d+).(\d+)", chat_)) {
  2978.                     store := ""
  2979.                    
  2980.                     if (chat_3 == "10") {
  2981.                         if (IsPlayerInRangeOfPoint(0, -17, 1003, 20)) {
  2982.                             store := "SM"
  2983.                         } else if (IsPlayerInRangeOfPoint(372.5, -66, 1001, 20)) {
  2984.                             store := "BS"
  2985.                         }
  2986.                     } else if (chat_3 == "15") {
  2987.                         store := "CS"
  2988.                     } else if (chat_3 == "9") {
  2989.                         store := "CB"
  2990.                     } else if (chat_3 == "5") {
  2991.                         store := "PS"
  2992.                     }
  2993.                    
  2994.                     if (store == "") {
  2995.                         SendClientMessage(PREFIX . "Der Store konnte nicht ermittelt werden!")
  2996.                         return
  2997.                     }
  2998.                    
  2999.                     data := []
  3000.                     data["username"] := getUsername()
  3001.                     data["store"] := store
  3002.                     data["gk"] := chat_3 . "." . chat_4
  3003.                     data["robtime"] := robtime
  3004.                    
  3005.                     jsonData := JSON.Dump(data)
  3006.                    
  3007.                     result := URLDownloadToVar(robBaseURL . "api/updatestore.php?data=" . jsonData)
  3008.                    
  3009.                     SendClientMessage(PREFIX . result)
  3010.                     break
  3011.                 }
  3012.                
  3013.                 if (InStr(chat, "\*\*Members online\*\*")) {
  3014.                     break
  3015.                 }
  3016.             }
  3017.         }
  3018.     } else if (RegExMatch(message, "^\*\* Der Überfall von " . getUsername() . " ist gescheitert \((.+)\)\.$")) {
  3019.         SetTimer, RobTimer, Off
  3020.     }
  3021. }
  3022.  
  3023. SpamTimer:
  3024. {
  3025.     unBlockChatInput()
  3026.     SendClientMessage(PREFIX . "Spamschutz-System {FF0000}deaktiviert{FFFFFF}!")
  3027. }
  3028. return
  3029.  
  3030. WheelmanTimer:
  3031. {
  3032.     SendClientMessage(PREFIX . "Möchtest du einen Wheelman anfordern? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
  3033.    
  3034.     KeyWait, X, D T10
  3035.    
  3036.     if (!ErrorLevel) {
  3037.         SendChat("/service")
  3038.         Sleep, 200
  3039.         SendInput, {down 6}{enter}
  3040.     }
  3041. }
  3042. return
  3043.  
  3044. PaketTimer:
  3045. {
  3046.     SendClientMessage(PREFIX . SECCOL . medicName . " {FFFFFF}bietet dir ein Paket an, drücke " . SECCOL . "X {FFFFFF}zum Annehmen.")
  3047.    
  3048.     KeyWait, X, D, T10
  3049.    
  3050.     if (!ErrorLevel) {
  3051.         SendChat("/accept paket")
  3052.        
  3053.         Sleep, 200
  3054.        
  3055.         chat := readChatLine(0) . readChatLine(1) . readChatLine(2)
  3056.        
  3057.         if (RegExMatch(chat, "Du hast bereits ein Erste-Hilfe-Paket\. Verwende \/erstehilfe")) {
  3058.             if (packetMessages) {
  3059.                 SendChat("/l Vielen Dank " . medicName . ", doch ich habe bereits ein Paket!")
  3060.             }
  3061.         } else if (RegExMatch(chat, "\* Du hast für \$(\d+) ein Erste-Hilfe-Paket von (\S+) gekauft\.", chat_)) {
  3062.             if (packetMessages) {
  3063.                 SendChat("/l Vielen Dank " . chat_2 . " für das Paket!")
  3064.             }
  3065.         }
  3066.     }
  3067. }
  3068. return
  3069. ; ---------- ;
  3070. ; Timer Ende ;
  3071. ; ---------- ;
  3072.  
  3073. :?:/tempo::
  3074. {
  3075.     tempoInput := PlayerInput("Tempo: ")
  3076.    
  3077.     if (tempoInput == "")
  3078.         return
  3079.    
  3080.     if tempoInput is not number
  3081.         return
  3082.    
  3083.     tempo := tempoInput
  3084.    
  3085.     IniWrite, %tempo%, settings.ini, Einstellungen, Tempo
  3086.    
  3087.     SendClientMessage(PREFIX . "Du hast das Tempo auf " . SECCOL . tempo . " km/h {FFFFFF}gesetzt. Starte den Tempomat mit " . SECCOL . tempomatNoMods)
  3088. }
  3089. return
  3090.  
  3091. tempomatLabel:
  3092. {
  3093.     if (isInChat())
  3094.         return
  3095.    
  3096.     if (tempomat) {
  3097.         SendInput, {W up}
  3098.        
  3099.         tempomat := false
  3100.        
  3101.         SendClientMessage(PREFIX . "Du hast den Tempomat {FF0000}deaktiviert{FFFFFF}.")
  3102.     } else {
  3103.         tempomat := true
  3104.        
  3105.         SendClientMessage(PREFIX . "Du hast den Tempomat {00FF00}aktiviert{FFFFFF} (Tempo: " . SECCOL . tempo . " km/h{FFFFFF}).")
  3106.     }
  3107. }
  3108.  
  3109. TempoTimer:
  3110. {
  3111.     IfWinNotActive, GTA:SA:MP
  3112.         return
  3113.    
  3114.     if (!tempomat || tempo <= 0)
  3115.         return
  3116.    
  3117.     if (isInChat())
  3118.         return
  3119.    
  3120.     if (isPlayerInAnyVehicle() && isPlayerDriver()) {
  3121.         currentSpeed := getVehicleSpeed()
  3122.        
  3123.         if (currentSpeed < tempo) {
  3124.             SendInput, {W down}
  3125.         } else {
  3126.             SendInput, {W up}
  3127.         }
  3128.     }
  3129. }
  3130. return
  3131.  
  3132. #IFNDEF nooverlay
  3133. StatsOverlayTimer:
  3134. {
  3135.     IfWinNotActive, GTA:SA:MP
  3136.         return
  3137.    
  3138.     IniRead, accountMoney, stats.ini, Vermögen, Bank, 0
  3139.     IniRead, depositMoney, stats.ini, Vermögen, Festgeld, 0
  3140.    
  3141.     allMoney := accountMoney + depositMoney + getPlayerMoney()
  3142.    
  3143.     IniRead, fishMoney, stats.ini, Fischsystem, Fischgeld, 0
  3144.     IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
  3145.     IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
  3146.     IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
  3147.     IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
  3148.    
  3149.     allKD := Round(alltimeKills / alltimeDeaths, 2)
  3150.     dayKD := Round(dayKills / dayDeaths, 2)
  3151.    
  3152.     IniRead, storeRobCount, stats.ini, StoreRob, Anzahl, 0
  3153.     IniRead, storeRobCountToday, stats.ini, StoreRob, Anzahl[%A_DD%:%A_MM%:%A_YYYY%], 0
  3154.     IniRead, storeRobMoney, stats.ini, StoreRob, Geld, 0
  3155.     IniRead, storeRobMoneyToday, stats.ini, StoreRob, Geld[%A_DD%:%A_MM%:%A_YYYY%], 0
  3156.    
  3157.     IniRead, garbageXP, stats.ini, Müllmann, XP, 0
  3158.     IniRead, garbageKubik, stats.ini, Müllmann, Kubik, 0
  3159.     IniRead, garbageMoney, stats.ini, Müllmann, Geld, 0
  3160.    
  3161.     IniRead, fishingXP, stats.ini, Hochseefischer, XP, 0
  3162.     IniRead, fishingMoney, stats.ini, Hochseefischer, Geld, 0
  3163.    
  3164.     IniRead, truckerXP, stats.ini, Trucker, XP, 0
  3165.     IniRead, truckerMoney, stats.ini, Trucker, Geld, 0
  3166.    
  3167.     IniRead, trainXP, stats.ini, Zugfahrer, XP, 0
  3168.     IniRead, trainMoney, stats.ini, Zugfahrer, Geld, 0
  3169.    
  3170.     IniRead, gardenerXP, stats.ini, Gärtner, XP, 0
  3171.     IniRead, gardenerMoney, stats.ini, Gärtner, Geld, 0
  3172.     IniRead, gardenerMaxMoney, stats.ini, Gärtner, Höchstverdienst, 0
  3173.    
  3174.     IniRead, farmerXP, stats.ini, Farmer, XP, 0
  3175.     IniRead, farmerMoney, stats.ini, Farmer, Geld, 0
  3176.     IniRead, farmerMaxMoney, stats.ini, Farmer, Höchstverdienst, 0
  3177.    
  3178.     IniRead, busRounds, stats.ini, Busfahrer, Runden, 0
  3179.     IniRead, busMoney, stats.ini, Busfahrer, Geld, 0
  3180.    
  3181.     IniRead, drugsBought, stats.ini, Drogen, AnzahlGekauft, 0
  3182.     IniRead, drugsMoney, stats.ini, Drogen, Ausgaben, 0
  3183.     IniRead, drugXP, stats.ini, Drogen, XP, 0
  3184.     IniRead, drugs, stats.ini, Drogen, Gramm, 0
  3185.    
  3186.     IniRead, matsBought, stats.ini, Materialien, AnzahlGekauft, 0
  3187.     IniRead, matsMoney, stats.ini, Materialien, Ausgaben, 0
  3188.     IniRead, matsXP, stats.ini, Materialien, XP, 0
  3189.     IniRead, mats, stats.ini, Materialien, Anzahl, 0
  3190.     IniRead, waffenstahl, stats.ini, Materialien, Waffenstahl, 0
  3191.    
  3192.     motorStatus := ""
  3193.     lockStatus := ""
  3194.     lightStatus := ""
  3195.     checkpointDistance := "-"
  3196.     drugOverlayStatus := ""
  3197.    
  3198.     if (isPlayerInAnyVehicle()) {
  3199.         if (getVehicleEngineState()) {
  3200.             motorStatus := statsOverlayPositiveColor . "Motor an{FFFFFF}"
  3201.         } else {
  3202.             motorStatus := statsOverlayNegativeColor . "Motor aus{FFFFFF}"
  3203.         }
  3204.     }
  3205.    
  3206.     if (isPlayerInAnyVehicle()) {
  3207.         if (getVehicleLockState()) {
  3208.             lockStatus := statsOverlayNegativeColor . "Fahrzeug abgeschlossen{FFFFFF}"
  3209.         } else {
  3210.             lockStatus := statsOverlayPositiveColor . "Fahrzeug aufgeschlossen{FFFFFF}"
  3211.         }
  3212.     }
  3213.    
  3214.     if (isPlayerInAnyVehicle()) {
  3215.         if (getVehicleLightState()) {
  3216.             lightStatus := statsOverlayPositiveColor . "Licht angeschalten{FFFFFF}"
  3217.         } else {
  3218.             lightStatus := statsOverlayNegativeColor . "Licht abgeschalten{FFFFFF}"
  3219.         }
  3220.     }
  3221.    
  3222.     if (IsMarkerCreated()) {
  3223.         coordsFromRedmarker := CoordsFromRedmarker()
  3224.         playerCoords := getCoordinates()
  3225.         distance := getDistanceToPoint(coordsFromRedmarker[1], coordsFromRedmarker[2], coordsFromRedmarker[3], playerCoords[1], playerCoords[2], playerCoords[3])
  3226.        
  3227.         checkpointDistance := FormatNumber(Floor(distance)) . "m"
  3228.     }
  3229.    
  3230.     if (drugGrowTime == -1) {
  3231.         drugOverlayStatus := "[white]Keine Drogen gepflanzt"
  3232.     } else {
  3233.         if (drugTime >= 0) {
  3234.             drugOverlayStatus := "[white]Drogenzeit: [primcol]" . formatTime(drugTime)
  3235.         } else {
  3236.             drugOverlayStatus := "[white]Drogen reif seit: [primcol]" . formatTime(drugTime * -1)
  3237.         }
  3238.     }
  3239.    
  3240.     statsOverlayText := statsOverlayContent
  3241.     statsOverlayText := StrReplace(statsOverlayText, "[name]", getUsername())
  3242.     statsOverlayText := StrReplace(statsOverlayText, "[id]", getId())
  3243.     statsOverlayText := StrReplace(statsOverlayText, "[ping]", getPlayerPingById(getId()))
  3244.     statsOverlayText := StrReplace(statsOverlayText, "[fps]", getFPS())
  3245.     statsOverlayText := StrReplace(statsOverlayText, "[zone]", getPlayerZone())
  3246.     statsOverlayText := StrReplace(statsOverlayText, "[city]", getPlayerCity())
  3247.     statsOverlayText := StrReplace(statsOverlayText, "[hp]", getPlayerHealth())
  3248.     statsOverlayText := StrReplace(statsOverlayText, "[armour]", getPlayerArmor())
  3249.     statsOverlayText := StrReplace(statsOverlayText, "[money]", FormatNumber(getPlayerMoney()))
  3250.     statsOverlayText := StrReplace(statsOverlayText, "[bankmoney]", FormatNumber(accountMoney))
  3251.     statsOverlayText := StrReplace(statsOverlayText, "[allmoney]", FormatNumber(allMoney))
  3252.     statsOverlayText := StrReplace(statsOverlayText, "[skin]", getPlayerSkinId())
  3253.     statsOverlayText := StrReplace(statsOverlayText, "[weaponid]", getPlayerWeaponId())
  3254.     statsOverlayText := StrReplace(statsOverlayText, "[weapon]", getPlayerWeaponName())
  3255.     statsOverlayText := StrReplace(statsOverlayText, "[freezed]", (IsPlayerFreezed() ? "ja" : "nein"))
  3256.     statsOverlayText := StrReplace(statsOverlayText, "[vhealth]", getVehicleHealth())
  3257.     statsOverlayText := StrReplace(statsOverlayText, "[vmodelid]", getVehicleModelId())
  3258.     statsOverlayText := StrReplace(statsOverlayText, "[vmodel]", getVehicleModelName())
  3259.     statsOverlayText := StrReplace(statsOverlayText, "[vspeed]", round(getVehicleSpeed()))
  3260.     statsOverlayText := StrReplace(statsOverlayText, "[fishmoney]", FormatNumber(fishMoney))
  3261.     statsOverlayText := StrReplace(statsOverlayText, "[fishtime]", formatTime(fishTime))
  3262.     statsOverlayText := StrReplace(statsOverlayText, "[date]", A_DD . "." . A_MM . "." . A_Year)
  3263.     statsOverlayText := StrReplace(statsOverlayText, "[motor]", motorStatus)
  3264.     statsOverlayText := StrReplace(statsOverlayText, "[lock]", lockStatus)
  3265.     statsOverlayText := StrReplace(statsOverlayText, "[light]", lightStatus)
  3266.     statsOverlayText := StrReplace(statsOverlayText, "[checkpoint]", checkpointDistance)
  3267.    
  3268.     statsOverlayText := StrReplace(statsOverlayText, "[kills]", FormatNumber(alltimeKills))
  3269.     statsOverlayText := StrReplace(statsOverlayText, "[daykills]", FormatNumber(daykills))
  3270.     statsOverlayText := StrReplace(statsOverlayText, "[deaths]", FormatNumber(alltimeDeaths))
  3271.     statsOverlayText := StrReplace(statsOverlayText, "[tode]", FormatNumber(alltimeDeaths))
  3272.     statsOverlayText := StrReplace(statsOverlayText, "[daydeaths]", FormatNumber(dayDeaths))
  3273.     statsOverlayText := StrReplace(statsOverlayText, "[kd]", allKD)
  3274.     statsOverlayText := StrReplace(statsOverlayText, "[daykd]", dayKD)
  3275.     statsOverlayText := StrReplace(statsOverlayText, "[pdmoney]", FormatNumber(paydayMoney))
  3276.     statsOverlayText := StrReplace(statsOverlayText, "[pdmoneynetto]", FormatNumber(Round(paydayMoney * taxes)))
  3277.     statsOverlayText := StrReplace(statsOverlayText, "[stores]", FormatNumber(storeRobCount))
  3278.     statsOverlayText := StrReplace(statsOverlayText, "[daystores]", FormatNumber(storeRobCountToday))
  3279.     statsOverlayText := StrReplace(statsOverlayText, "[storemoney]", FormatNumber(storeRobMoney))
  3280.     statsOverlayText := StrReplace(statsOverlayText, "[daystoremoney]", FormatNumber(storeRobMoneyToday))
  3281.    
  3282.     statsOverlayText := StrReplace(statsOverlayText, "[garbagexp]", FormatNumber(garbageXP))
  3283.     statsOverlayText := StrReplace(statsOverlayText, "[garbagekubik]", FormatNumber(garbageKubik))
  3284.     statsOverlayText := StrReplace(statsOverlayText, "[garbagemoney]", FormatNumber(garbageMoney))
  3285.     statsOverlayText := StrReplace(statsOverlayText, "[fishingxp]", FormatNumber(fishingXP))
  3286.     statsOverlayText := StrReplace(statsOverlayText, "[fishingmoney]", FormatNumber(fishingMoney))
  3287.     statsOverlayText := StrReplace(statsOverlayText, "[truckerxp]", FormatNumber(truckerXP))
  3288.     statsOverlayText := StrReplace(statsOverlayText, "[truckermoney]", FormatNumber(truckerMoney))
  3289.     statsOverlayText := StrReplace(statsOverlayText, "[trainxp]", FormatNumber(trainXP))
  3290.     statsOverlayText := StrReplace(statsOverlayText, "[trainmoney]", FormatNumber(trainMoney))
  3291.     statsOverlayText := StrReplace(statsOverlayText, "[gardenerxp]", FormatNumber(gardenerXP))
  3292.     statsOverlayText := StrReplace(statsOverlayText, "[gardenermoney]", FormatNumber(gardenerMoney))
  3293.     statsOverlayText := StrReplace(statsOverlayText, "[gardenermaxmoney]", FormatNumber(gardenerMaxMoney))
  3294.     statsOverlayText := StrReplace(statsOverlayText, "[farmerxp]", FormatNumber(farmerXP))
  3295.     statsOverlayText := StrReplace(statsOverlayText, "[farmermoney]", FormatNumber(farmerMoney))
  3296.     statsOverlayText := StrReplace(statsOverlayText, "[farmermaxmoney]", FormatNumber(farmerMaxMoney))
  3297.     statsOverlayText := StrReplace(statsOverlayText, "[busrounds]", FormatNumber(busRounds))
  3298.     statsOverlayText := StrReplace(statsOverlayText, "[busmoney]", FormatNumber(busMoney))
  3299.     statsOverlayText := StrReplace(statsOverlayText, "[drugsbought]", FormatNumber(drugsBought))
  3300.     statsOverlayText := StrReplace(statsOverlayText, "[drugsmoney]", FormatNumber(drugsMoney))
  3301.     statsOverlayText := StrReplace(statsOverlayText, "[drugxp]", FormatNumber(drugXP))
  3302.     statsOverlayText := StrReplace(statsOverlayText, "[drugs]", FormatNumber(drugs))
  3303.     statsOverlayText := StrReplace(statsOverlayText, "[drugstatus]", drugOverlayStatus)
  3304.     statsOverlayText := StrReplace(statsOverlayText, "[matsbought]", FormatNumber(matsBought))
  3305.     statsOverlayText := StrReplace(statsOverlayText, "[matsmoney]", FormatNumber(matsMoney))
  3306.     statsOverlayText := StrReplace(statsOverlayText, "[matsxp]", FormatNumber(matsXP))
  3307.     statsOverlayText := StrReplace(statsOverlayText, "[mats]", FormatNumber(mats))
  3308.     statsOverlayText := StrReplace(statsOverlayText, "[waffenstahl]", FormatNumber(waffenstahl))
  3309.    
  3310.     statsOverlayText := StrReplace(statsOverlayText, "[primcol]", statsOverlayPrimColor)
  3311.     statsOverlayText := StrReplace(statsOverlayText, "[seccol]", statsOverlaySecColor)
  3312.     statsOverlayText := StrReplace(statsOverlayText, "[white]", "{FFFFFF}")
  3313.    
  3314.     if (!statsOverlayColors) {
  3315.         statsOverlayText := RegExReplace(statsOverlayText, "{\S{6}}", "")
  3316.     }
  3317.    
  3318.     TextSetString(statsOverlay, statsOverlayText)
  3319. }
  3320. return
  3321.  
  3322. :?:/ov::
  3323. :?:/overlay::
  3324. {
  3325.     SendClientMessage(PREFIX . SECCOL . "1{FFFFFF}: Statistik-Overlay " . SECCOL . "2{FFFFFF}: Gegner-Overlay")
  3326.    
  3327.     overlayInput := PlayerInput("Overlay de-/aktivieren: ")
  3328.    
  3329.     if (overlayInput == "1") {
  3330.         if (statsOverlayEnabled) {
  3331.             TextDestroy(statsOverlay)
  3332.            
  3333.             statsOverlayEnabled := false
  3334.            
  3335.             if (ovMoveMode == 1) {
  3336.                 ovMoveMode := 0
  3337.             }
  3338.            
  3339.             SetTimer, StatsOverlayTimer, Off
  3340.            
  3341.             SendClientMessage(PREFIX . "Statistik-Overlay {FF0000}deaktiviert{FFFFFF}.")
  3342.         } else {
  3343.             createOverlay(1)
  3344.            
  3345.             statsOverlayEnabled := true
  3346.            
  3347.             SendClientMessage(PREFIX . "Statistik-Overlay {00FF00}aktiviert{FFFFFF}.")
  3348.         }
  3349.     } else if (overlayInput == "2") {
  3350.         if (enemyOverlayEnabled) {
  3351.             TextDestroy(enemyOverlay)
  3352.            
  3353.             enemyOverlayEnabled := false
  3354.            
  3355.             if (ovMoveMode == 2) {
  3356.                 ovMoveMode := 0
  3357.             }
  3358.            
  3359.             SetTimer, EnemyOverlayTimer, Off
  3360.            
  3361.             SendClientMessage(PREFIX . "Gegner-Overlay {FF0000}deaktiviert{FFFFFF}.")
  3362.         } else {
  3363.             createOverlay(2)
  3364.            
  3365.             enemyOverlayEnabled := true
  3366.            
  3367.             SendClientMessage(PREFIX . "Gegner-Overlay {00FF00}aktiviert{FFFFFF}.")
  3368.         }
  3369.     }
  3370. }
  3371. return
  3372.  
  3373. createOverlay(id) {
  3374.     global
  3375.    
  3376.     if (id == 1) {
  3377.         statsOverlay := TextCreate(statsOverlayFont, statsOverlayFontSize, statsOverlayBold, statsOverlayItalic, statsOverlayPosX, statsOverlayPosY, 0xFFFFFFFF, "", true, true)
  3378.        
  3379.         SetTimer, StatsOverlayTimer, 1000
  3380.     } else if (id == 2) {
  3381.         enemyOverlay := TextCreate(enemyOverlayFont, enemyOverlayFontSize, enemyOverlayBold, enemyOverlayItalic, enemyOverlayPosX, enemyOverlayPosY, 0xFFFFFFFF, "", true, true)
  3382.        
  3383.         SetTimer, EnemyOverlayTimer, 1000
  3384.     }
  3385. }
  3386.  
  3387. updateOverlay(id) {
  3388.     global
  3389.    
  3390.     if (id == 1) {
  3391.         if (statsOverlayEnabled) {
  3392.             TextSetPos(statsOverlay, statsOverlayPosX, statsOverlayPosY)
  3393.         }
  3394.     } else if (id == 2) {
  3395.         if (enemyOverlayEnabled) {
  3396.             TextSetPos(enemyOverlay, enemyOverlayPosX, enemyOverlayPosY)
  3397.         }
  3398.     }
  3399. }
  3400.  
  3401. :?:/ovmove::
  3402. {
  3403.     if (ovMoveMode) {
  3404.         ovMoveMode := 0
  3405.        
  3406.         SendClientMessage(PREFIX . "Der Overlay-Bearbeitungsmodus wurde {FF0000}deaktiviert{FFFFFF}!")
  3407.     } else {
  3408.         SendClientMessage(PREFIX . SECCOL . "1{FFFFFF}: Statistik-Overlay " . SECCOL . "2{FFFFFF}: Gegner-Overlay")
  3409.        
  3410.         overlayInput := PlayerInput("Overlay verschieben: ")
  3411.        
  3412.         if (overlayInput == "1") {
  3413.             if (statsOverlayEnabled) {
  3414.                 ovMoveMode := 1
  3415.                
  3416.                 SendClientMessage(PREFIX . "Der Overlay-Bearbeitungsmodus wurde {00FF00}aktiviert{FFFFFF}!")
  3417.                 SendClientMessage(PREFIX . "Das Overlay kann nun mit den Pfeiltasten verschoben werden!")
  3418.                 SendClientMessage(PREFIX . "Wenn du fertig bist, tippe " . SECCOL . "/ovsave {FFFFFF}ein, um die Einstellung zu speichern!")
  3419.             } else {
  3420.                 SendClientMessage(PREFIX . "Das Statistik-Overlay muss aktiviert sein, um es zu verschieben!")
  3421.             }
  3422.         } else if (overlayInput == "2") {
  3423.             if (enemyOverlayEnabled) {
  3424.                 ovMoveMode := 2
  3425.                
  3426.                 SendClientMessage(PREFIX . "Der Overlay-Bearbeitungsmodus wurde {00FF00}aktiviert{FFFFFF}!")
  3427.                 SendClientMessage(PREFIX . "Das Overlay kann nun mit den Pfeiltasten verschoben werden!")
  3428.                 SendClientMessage(PREFIX . "Wenn du fertig bist, tippe " . SECCOL . "/ovsave {FFFFFF}ein, um die Einstellung zu speichern!")
  3429.             } else {
  3430.                 SendClientMessage(PREFIX . "Das Gegner-Overlay muss aktiviert sein, um es zu verschieben!")
  3431.             }
  3432.         }
  3433.     }
  3434. }
  3435. return
  3436.  
  3437. :?:/ovsave::
  3438. {
  3439.     if (ovMoveMode == 1) {
  3440.         IniWrite, %statsOverlayPosX%, settings.ini, StatsOverlay, PosX
  3441.         IniWrite, %statsOverlayPosY%, settings.ini, StatsOverlay, PosY
  3442.        
  3443.         ovMoveMode := 0
  3444.        
  3445.         SendClientMessage(PREFIX . "Die Overlay-Position wurde {00FF00}gespeichert {FFFFFF}und der Bearbeitungsmodus {FF0000}deaktiviert{FFFFFF}!")
  3446.     } else if (ovMoveMode == 2) {
  3447.         IniWrite, %enemyOverlayPosX%, settings.ini, EnemyOverlay, PosX
  3448.         IniWrite, %enemyOverlayPosY%, settings.ini, EnemyOverlay, PosY
  3449.        
  3450.         ovMoveMode := 0
  3451.        
  3452.         SendClientMessage(PREFIX . "Die Overlay-Position wurde {00FF00}gespeichert {FFFFFF}und der Bearbeitungsmodus {FF0000}deaktiviert{FFFFFF}!")
  3453.     } else {
  3454.         SendClientMessage(PREFIX . "Der Overlay-Bearbeitungsmodus ist nicht aktiviert!")
  3455.     }
  3456. }
  3457. return
  3458. #ENDIF
  3459.  
  3460. ~Up::
  3461. {
  3462. #IFNDEF nooverlay
  3463.     if (ovMoveMode) {
  3464.         if (ovMoveMode == 1) {
  3465.             statsOverlayPosY -= 3
  3466.         } else if (ovMoveMode == 2) {
  3467.             enemyOverlayPosY -= 3
  3468.         }
  3469.        
  3470.         updateOverlay(ovMoveMode)
  3471.     }
  3472. #ENDIF
  3473.    
  3474.     if (textMoveMode) {
  3475.         if (textMoveMode == 1) {
  3476.             hpTextPosY -= 1
  3477.         } else if (textMoveMode == 2) {
  3478.             armourTextPosY -= 1
  3479.         } else if (textMoveMode == 3) {
  3480.             fpsTextPosY -= 1
  3481.         }
  3482.        
  3483.         updateText(textMoveMode)
  3484.     }
  3485. }
  3486. return
  3487.  
  3488. ~Down::
  3489. {
  3490. #IFNDEF nooverlay
  3491.     if (ovMoveMode) {
  3492.         if (ovMoveMode == 1) {
  3493.             statsOverlayPosY += 3
  3494.         } else if (ovMoveMode == 2) {
  3495.             enemyOverlayPosY += 3
  3496.         }
  3497.        
  3498.         updateOverlay(ovMoveMode)
  3499.     }
  3500. #ENDIF
  3501.    
  3502.     if (textMoveMode) {
  3503.         if (textMoveMode == 1) {
  3504.             hpTextPosY += 1
  3505.         } else if (textMoveMode == 2) {
  3506.             armourTextPosY += 1
  3507.         } else if (textMoveMode == 3) {
  3508.             fpsTextPosY += 1
  3509.         }
  3510.        
  3511.         updateText(textMoveMode)
  3512.     }
  3513. }
  3514. return
  3515.  
  3516. ~Left::
  3517. {
  3518. #IFNDEF nooverlay
  3519.     if (ovMoveMode) {
  3520.         if (ovMoveMode == 1) {
  3521.             statsOverlayPosX -= 3
  3522.         } else if (ovMoveMode == 2) {
  3523.             enemyOverlayPosX -= 3
  3524.         }
  3525.        
  3526.         updateOverlay(ovMoveMode)
  3527.     }
  3528. #ENDIF
  3529.    
  3530.     if (textMoveMode) {
  3531.         if (textMoveMode == 1) {
  3532.             hpTextPosX -= 1
  3533.         } else if (textMoveMode == 2) {
  3534.             armourTextPosX -= 1
  3535.         } else if (textMoveMode == 3) {
  3536.             fpsTextPosX -= 1
  3537.         }
  3538.        
  3539.         updateText(textMoveMode)
  3540.     }
  3541. }
  3542. return
  3543.  
  3544. ~Right::
  3545. {
  3546. #IFNDEF nooverlay
  3547.     if (ovMoveMode) {
  3548.         if (ovMoveMode == 1) {
  3549.             statsOverlayPosX += 3
  3550.         } else if (ovMoveMode == 2) {
  3551.             enemyOverlayPosX += 3
  3552.         }
  3553.        
  3554.         updateOverlay(ovMoveMode)
  3555.     }
  3556. #ENDIF
  3557.    
  3558.     if (textMoveMode) {
  3559.         if (textMoveMode == 1) {
  3560.             hpTextPosX += 1
  3561.         } else if (textMoveMode == 2) {
  3562.             armourTextPosX += 1
  3563.         } else if (textMoveMode == 3) {
  3564.             fpsTextPosX += 1
  3565.         }
  3566.        
  3567.         updateText(textMoveMode)
  3568.     }
  3569. }
  3570. return
  3571.  
  3572.  
  3573. ; ---------------- ;
  3574. ;    Job-System    ;
  3575. ; ---------------- ;
  3576. :?:/setjob::
  3577. {
  3578.     jobInput := PlayerInput("Job: ")
  3579.    
  3580.     if (InStr(jobInput, "Dro")) {
  3581.         job := 2
  3582.        
  3583.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Drogendealer {FFFFFF}gesetzt!")
  3584.     } else if (InStr(jobInput, "Waf")) {
  3585.         job := 3
  3586.        
  3587.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Waffendealer {FFFFFF}gesetzt!")
  3588.     } else if (InStr(jobInput, "Bus")) {
  3589.         job := 4
  3590.        
  3591.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Busfahrer {FFFFFF}gesetzt!")
  3592.     } else if (InStr(jobInput, "Pil")) {
  3593.         job := 5
  3594.        
  3595.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Pilot {FFFFFF}gesetzt!")
  3596.     } else if (InStr(jobInput, "Fis") || InStr(jobInput, "Hoch")) {
  3597.         job := 6
  3598.        
  3599.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Hochseefischer {FFFFFF}gesetzt!")
  3600.     } else if (InStr(jobInput, "Anw")) {
  3601.         job := 7
  3602.        
  3603.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Anwalt {FFFFFF}gesetzt!")
  3604.     } else if (InStr(jobInput, "Det")) {
  3605.         job := 8
  3606.        
  3607.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Detektiv {FFFFFF}gesetzt!")
  3608.     } else if (InStr(jobInput, "Tru")) {
  3609.         job := 9
  3610.        
  3611.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Trucker {FFFFFF}gesetzt!")
  3612.     } else if (InStr(jobInput, "Far")) {
  3613.         job := 10
  3614.        
  3615.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Farmer {FFFFFF}gesetzt!")
  3616.     } else if (InStr(jobInput, "Zug")) {
  3617.         job := 11
  3618.        
  3619.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Zugfahrer {FFFFFF}gesetzt!")
  3620.     } else if (InStr(jobInput, "Gär") || InStr(jobInput, "Gar")) {
  3621.         job := 12
  3622.        
  3623.         SendClientMessage(PREFIX . "Du hast deinen Job auf " . SECCOL . "Gärtner {FFFFFF}gesetzt!")
  3624.     } else {
  3625.         SendClientMessage(PREFIX . "Unbekannter Job!")
  3626.         return
  3627.     }
  3628.    
  3629.     IniWrite, %job%, settings.ini, Job, Job
  3630. }
  3631. return
  3632.  
  3633. :?:/setline::
  3634. :?:/setlinie::
  3635. {
  3636.     lineInput := PlayerInput("Linie: ")
  3637.    
  3638.     if lineInput is number
  3639.     {
  3640.         if (lineInput < 1 || lineInput > 21) {
  3641.             SendClientMessage(PREFIX . "Du musst eine Linie zwischen 1 und 21 eingeben.")
  3642.         } else {
  3643.             jobLine := lineInput + 1
  3644.            
  3645.             IniWrite, %jobLine%, settings.ini, Job, Linie
  3646.            
  3647.             SendClientMessage(PREFIX . "Du hast deine Linie auf " . SECCOL . lineInput . " {FFFFFF}gesetzt!")
  3648.         }
  3649.     } else {
  3650.         SendClientMessage(PREFIX . "Bitte eine Zahl als Linie eingeben!")
  3651.     }
  3652. }
  3653. return
  3654.  
  3655. :?:/wskill::
  3656. :?:/wdskill::
  3657. {
  3658.     skillInput := PlayerInput("Waffendealer-Skill: ")
  3659.    
  3660.     if skillInput is number
  3661.     {
  3662.         if (skillInput < 1 || skillInput > 5) {
  3663.             SendClientMessage(PREFIX . "Du musst einen Skill zwischen 1 und 5 eingeben.")
  3664.         } else {
  3665.             jobWeapondealerSkill := skillInput + 1
  3666.            
  3667.             IniWrite, %jobWeapondealerSkill%, settings.ini, Job, Waffendealerskill
  3668.            
  3669.             SendClientMessage(PREFIX . "Du hast deinen Waffendealer-Skill auf " . SECCOL . skillInput . " {FFFFFF}gesetzt!")
  3670.         }
  3671.     } else {
  3672.         SendClientMessage(PREFIX . "Bitte eine Zahl als Skill eingeben!")
  3673.     }
  3674. }
  3675. return
  3676.  
  3677. :?:/dskill::
  3678. {
  3679.     skillInput := PlayerInput("Detektiv-Skill: ")
  3680.    
  3681.     if skillInput is number
  3682.     {
  3683.         if (skillInput < 1 || skillInput > 5) {
  3684.             SendClientMessage(PREFIX . "Du musst einen Skill zwischen 1 und 5 eingeben.")
  3685.         } else {
  3686.             jobDetectiveSkill := skillInput + 1
  3687.            
  3688.             IniWrite, %jobDetectiveSkill%, settings.ini, Job, Detektivskill
  3689.            
  3690.             SendClientMessage(PREFIX . "Du hast deinen Detektiv-Skill auf " . SECCOL . skillInput . " {FFFFFF}gesetzt!")
  3691.         }
  3692.     } else {
  3693.         SendClientMessage(PREFIX . "Bitte eine Zahl als Skill eingeben!")
  3694.     }
  3695. }
  3696. return
  3697.  
  3698. :?:/drugstatus::
  3699. {
  3700.     drugStatus := !drugStatus
  3701.    
  3702.     if (drugStatus) {
  3703.         SendClientMessage(PREFIX . "Du hast den Drogenstatus auf " . SECCOL . "Ernten {FFFFFF}gesetzt.")
  3704.     } else {
  3705.         SendClientMessage(PREFIX . "Du hast den Drogenstatus auf " . SECCOL . "Pflanzen {FFFFFF}gesetzt.")
  3706.     }
  3707. }
  3708. return
  3709.  
  3710. jobexecuteLabel:
  3711. {
  3712.     if (isInChat())
  3713.         return
  3714.    
  3715.     if ((job == "") || (job <= 1)) {
  3716.         SendClientMessage(PREFIX . "Du hast keinen Job angegeben! Benutze /setjob.")
  3717.     } else if (job == 2) {
  3718.         if (isPlayerInRangeOfPoint(330, -41, 1, 15)) {
  3719.             SendChat("/seed buy")
  3720.         } else if (isPlayerInRangeOfPoint(834, -1853, 7, 5) || isPlayerInRangeOfPoint(-1479, 324, 7, 5) || isPlayerInRangeOfPoint(1098, 1686, 6, 5) || isPlayerInRangeOfPoint(1297, -984, 32, 5) || isPlayerInRangeOfPoint(2743, -2453, 13, 5) || isPlayerInRangeOfPoint(1230, -807, 1084, 5)) {
  3721.             SendChat("/put drugs")
  3722.            
  3723.             Sleep, 200
  3724.            
  3725.             chatLine0 := readChatLine(0)
  3726.            
  3727.             if (RegExMatch(chatLine0, "Befehl: \/put \[Drugs\] \[Menge\] \(Du hast (\d+)g\)", chatLine0_)) {
  3728.                 SendChat("/put drugs " . chatLine0_1)
  3729.             }
  3730.         } else if (isPlayerInRangeOfPoint(2737, -2466, 14, 10)) {
  3731.             SendChat("/seed warehouse")
  3732.         } else {
  3733.             if (drugStatus) {
  3734.                 SendChat("/seed harvest")
  3735.             } else {
  3736.                 SendChat("/seed plant")
  3737.             }
  3738.         }
  3739.     } else if (job == 3) {
  3740.         if ((jobWeapondealerSkill == "") || (jobWeapondealerSkill <= 1)) {
  3741.             SendClientMessage(PREFIX . "Du hast keinen Waffendealerskill angegeben! Benutze /wdskill.")
  3742.             return
  3743.         } else if (isPlayerInRangeOfPoint(597.0953, -1248.6184, 18.2718, 10) || isPlayerInRangeOfPoint(2789.554, -2494.1433, 14.2481, 10)) {
  3744.             if (jobWeapondealerSkill == 2) {
  3745.                 packets := 5
  3746.             } else if (jobWeapondealerSkill == 3) {
  3747.                 packets := 10
  3748.             } else if (jobWeapondealerSkill == 4) {
  3749.                 packets := 15
  3750.             } else if (jobWeapondealerSkill == 5) {
  3751.                 packets := 20
  3752.             } else if (jobWeapondealerSkill == 6) {
  3753.                 packets := 25
  3754.             }
  3755.            
  3756.             if (GetVehicleModelId() == 482) {
  3757.                 packets := 50
  3758.             }
  3759.            
  3760.             SendChat("/materials get " . packets)
  3761.         } else if (isPlayerInRangeOfPoint(2737, -2466, 14, 10)) {
  3762.             SendChat("/materials warehouse")
  3763.             Sleep, 300
  3764.             SendChat("/prod warehouse")
  3765.             Sleep, 300
  3766.             SendChat("/oil warehouse")
  3767.         } else if (isPlayerInRangeOfPoint(834, -1853, 7, 5) || isPlayerInRangeOfPoint(-1479, 324, 7, 5) || isPlayerInRangeOfPoint(1098, 1686, 6, 5) || isPlayerInRangeOfPoint(1297, -984, 32, 5) || isPlayerInRangeOfPoint(2743, -2453, 13, 5) || isPlayerInRangeOfPoint(1230, -807, 1084, 5)) {
  3768.             SendChat("/put mats")
  3769.            
  3770.             Sleep, 200
  3771.            
  3772.             chatLine0 := readChatLine(0)
  3773.            
  3774.             if (RegExMatch(chatLine0, "Befehl: \/put \[Mats\] \[Menge\] \(Du hast (\d+) Mats\)", chatLine0_)) {
  3775.                 SendChat("/put mats " . chatLine0_1)
  3776.             }
  3777.         } else if (isPlayerInRangeOfPoint(274, 1411, 11, 5)) {
  3778.             SendChat("/oil buy")
  3779.         } else if (isPlayerInRangeOfPoint(-1548, 124, 4, 5)) {
  3780.             SendChat("/prod buy")
  3781.         } else {
  3782.             SendChat("/materials deliver")
  3783.         }
  3784.     } else if (job == 4) {
  3785.         if ((jobLine == "") || (jobLine <= 1)) {
  3786.             SendClientMessage(PREFIX . "Du hast keine Linie eingegeben! Benutze /setline.")
  3787.             SendChat("/linie")
  3788.         } else {
  3789.             busLine := jobLine - 1
  3790.            
  3791.             selectLine(busLine)
  3792.         }
  3793.     } else if (job == 5) {
  3794.         if ((GetVehicleModelId() == 511) || (GetVehicleModelId() == 553) || (GetVehicleModelId() == 577)) {
  3795.             SendChat("/duty")
  3796.         } else {
  3797.             SendClientMessage(PREFIX . "Du befindest dich in keinem Flugzeug!")
  3798.         }
  3799.     } else if (job == 6) {
  3800.         if (GetVehicleModelId() == 453 || GetVehicleModelId() == 484) {
  3801.             SendChat("/fishing")
  3802.            
  3803.             Sleep, 200
  3804.            
  3805.             if (getDialogCaption() == "Hochseefischer") {
  3806.                 if (fishingFull) {
  3807.                     SendInput, {down 7}{Enter}
  3808.                 } else {
  3809.                     freeTrap := false
  3810.                     highestTimeTrap := false
  3811.                     highestTime := 0
  3812.                    
  3813.                     for index, line in getDialogLines() {
  3814.                         if (RegExMatch(line, "Reuse (\d+): Auslegen", line_)) {
  3815.                             if (!freeTrap) {
  3816.                                 freeTrap := line_1
  3817.                             }
  3818.                         } else if (RegExMatch(line, "Reuse (\d+): Ausgelegt vor (\d+) Minuten", line_)) {
  3819.                             if (line_2 > highestTime) {
  3820.                                 highestTimeTrap := line_1
  3821.                                 highestTime := line_2
  3822.                             }
  3823.                         }
  3824.                     }
  3825.                    
  3826.                     if (highestTimeTrap && highestTime >= 5) {
  3827.                         downCount := highestTimeTrap - 1
  3828.                        
  3829.                         SendInput, {down %downCount%}{Enter}
  3830.                        
  3831.                         SendClientMessage(PREFIX . "Du fährst nun zu Reuse " . highestTimeTrap . ", welche seit " . (highestTime - 5) . " Minute(n) eingeholt werden kann.")
  3832.                     } else if (freeTrap) {
  3833.                         downCount := freeTrap - 1
  3834.                        
  3835.                         SendInput, {down %downCount%}{Enter}
  3836.                     } else {
  3837.                         SendClientMessage(PREFIX . "Es ist noch keine Reuse bereit zum Einholen.")
  3838.                     }
  3839.                 }
  3840.             }
  3841.         } else {
  3842.             SendClientMessage(PREFIX . "Du befindest dich auf keinem Boot!")
  3843.         }
  3844.     } else if (job == 7) {
  3845.         if (isPlayerInRangeOfPoint(253.7230, 68.9150, 1003.6406, 3)) {
  3846.             SendChat("/freeinfo")
  3847.         } else {
  3848.             freeName := PlayerInput("Spielername: ")
  3849.             freeKaution := PlayerInput("Kaution: ")
  3850.            
  3851.             SendChat("/free " . freeName . " " . freeKaution)
  3852.         }
  3853.     } else if (job == 8) {
  3854.         if (jobDetectiveSkill == "" || jobDetectiveSkill <= 1 || jobDetectiveSkill > 6) {
  3855.             SendClientMessage(PREFIX . "Du hast keinen oder einen ungültigen Detektivskill angegeben! Benutze /dskill.")
  3856.             return
  3857.         }
  3858.        
  3859.         playerToFindInput := PlayerInput("Spieler-ID: ")
  3860.        
  3861.         if (playerToFindInput == "")
  3862.             return
  3863.        
  3864.         playerToFind := playerToFindInput
  3865.        
  3866.         SendClientMessage(PREFIX . "Das automatische Suchen kann mit der Taste {FF0000}" . stopAutomaticSystemsNoMods . " {FFFFFF}deaktiviert werden.")
  3867.        
  3868.         if (autoShowRunning) {
  3869.             SetTimer, AutoShowPosTimer, Off
  3870.            
  3871.             autoShowRunning := false
  3872.         }
  3873.        
  3874.         GoSub, AutoFindTimer
  3875.            
  3876.         if (jobDetectiveSkill == 2) {
  3877.             SetTimer, AutoFindTimer, 120500
  3878.         } else if (jobDetectiveSkill == 3) {
  3879.             SetTimer, AutoFindTimer, 90500
  3880.         } else if (jobDetectiveSkill == 4) {
  3881.             SetTimer, AutoFindTimer, 60500
  3882.         } else if (jobDetectiveSkill == 5) {
  3883.             SetTimer, AutoFindTimer, 30500
  3884.         } else if (jobDetectiveSkill == 6) {
  3885.             SetTimer, AutoFindTimer, 5500
  3886.         } else {
  3887.             return
  3888.         }
  3889.        
  3890.         autoFindRunning := true
  3891.     } else if (job == 9) {
  3892.         if (GetVehicleModelId() == 455) {
  3893.             blockDialog()
  3894.             SendChat("/delivery")
  3895.            
  3896.             Sleep, 200
  3897.            
  3898.             dialog := getDialogText()
  3899.             newDialog := "ID`tAuftrag und Gehalt`tStrecke`tZeit"
  3900.            
  3901.             unblockDialog()
  3902.            
  3903.             deliveries := []
  3904.            
  3905.             if (RegExMatch(dialog, "s)Du kannst einen Auftrag mit \/delivery \[Auftrag\] annehmen\.\n\nVerfügbare Aufträge:\n\n(.+)", dialog_)) {
  3906.                 Loop, parse, dialog_1, `n
  3907.                 {
  3908.                     if (RegExMatch(A_LoopField, "^Auftrag (\d+): (.+) \(von (.+) nach (.+)\), Gehalt: (\d+)\$, noch (\d+) Minuten verfügbar\.$", delivery_)) {
  3909.                         inserted := false
  3910.                         newDelivery := Object()
  3911.                        
  3912.                         newDelivery["id"] := delivery_1
  3913.                         newDelivery["delivery"] := delivery_2
  3914.                         newDelivery["money"] := delivery_5
  3915.                         newDelivery["location"] := "von " . delivery_3 . " nach " . delivery_4
  3916.                         newDelivery["time"] := delivery_6
  3917.                        
  3918.                         for index, delivery in deliveries {
  3919.                             money := delivery["money"]
  3920.                            
  3921.                             if (delivery_5 > money) {
  3922.                                 deliveries.InsertAt(index, newDelivery)
  3923.                                 inserted := true
  3924.                                 break
  3925.                             }
  3926.                         }
  3927.                        
  3928.                         if (!inserted) {
  3929.                             deliveries.Push(newDelivery)
  3930.                         }
  3931.                     }
  3932.                 }
  3933.             }
  3934.            
  3935.             for, index, delivery in deliveries {
  3936.                 money := delivery["money"]
  3937.                
  3938.                 if (money > 3000) {
  3939.                     money := "{00FF00}" . money . "${FFFFFF}"
  3940.                 } else if (money > 2000) {
  3941.                     money := "{FF9900}" . money . "${FFFFFF}"
  3942.                 } else {
  3943.                     money := "{FF0000}" . money . "${FFFFFF}"
  3944.                 }
  3945.                
  3946.                 time := delivery["time"]
  3947.                
  3948.                 if (time > 30) {
  3949.                     time := "{00FF00}" . time . " Minuten"
  3950.                 } else if (time > 10) {
  3951.                     time := "{FF9900}" . time . " Minuten"
  3952.                 } else {
  3953.                     time := "{FF0000}" . time . " Minuten"
  3954.                 }
  3955.                
  3956.                 newDialog .= "`n" . delivery["id"] . "`t" . delivery["delivery"] . " (" . money . ")`t" . delivery["location"] . "`t" . time
  3957.             }
  3958.            
  3959.             ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Verfügbare Aufträge", newDialog, "OK")
  3960.         } else {
  3961.             SendClientMessage(PREFIX . "Du befindest dich nicht im Truck!")
  3962.         }
  3963.     } else if (job == 10) {
  3964.         SendChat("/farmer start")
  3965.     } else if (job == 11) {
  3966.         SendChat("/duty")
  3967.     } else if (job == 12) {
  3968.         if (isPlayerInRangeOfPoint(1449, -2287, 14, 5)) {
  3969.             SendChat("/gardener start")
  3970.         } else {
  3971.             if (GetVehicleModelId() == 543) {
  3972.                 if (isPlayerInRangeOfPoint(1751, -2054, 14, 10)) {
  3973.                     SendChat("/gardener sell")
  3974.                 } else {
  3975.                     SendChat("/gardener show")
  3976.                 }
  3977.             } else {
  3978.                 SendChat("/gardener park")
  3979.             }
  3980.         }
  3981.     }
  3982. }
  3983. return
  3984.  
  3985. :?:/l1::
  3986. selectLine(1)
  3987. return
  3988.  
  3989. :?:/l2::
  3990. selectLine(2)
  3991. return
  3992.  
  3993. :?:/l3::
  3994. selectLine(3)
  3995. return
  3996.  
  3997. :?:/l4::
  3998. selectLine(4)
  3999. return
  4000.  
  4001. :?:/l5::
  4002. selectLine(5)
  4003. return
  4004.  
  4005. :?:/l6::
  4006. selectLine(6)
  4007. return
  4008.  
  4009. :?:/l7::
  4010. selectLine(7)
  4011. return
  4012.  
  4013. :?:/l8::
  4014. selectLine(8)
  4015. return
  4016.  
  4017. :?:/l9::
  4018. selectLine(9)
  4019. return
  4020.  
  4021. :?:/l10::
  4022. selectLine(10)
  4023. return
  4024.  
  4025. :?:/l11::
  4026. selectLine(11)
  4027. return
  4028.  
  4029. :?:/l12::
  4030. selectLine(12)
  4031. return
  4032.  
  4033. :?:/l13::
  4034. selectLine(13)
  4035. return
  4036.  
  4037. :?:/l14::
  4038. selectLine(14)
  4039. return
  4040.  
  4041. :?:/l15::
  4042. selectLine(15)
  4043. return
  4044.  
  4045. :?:/l16::
  4046. selectLine(16)
  4047. return
  4048.  
  4049. :?:/l17::
  4050. selectLine(17)
  4051. return
  4052.  
  4053. :?:/l18::
  4054. selectLine(18)
  4055. return
  4056.  
  4057. :?:/l19::
  4058. selectLine(19)
  4059. return
  4060.  
  4061. :?:/l20::
  4062. selectLine(20)
  4063. return
  4064.  
  4065. :?:/l21::
  4066. selectLine(21)
  4067. return
  4068.  
  4069. selectLine(busLine) {
  4070.     line := busLine - 1
  4071.    
  4072.     BlockInput, On
  4073.     SendChat("/linie")
  4074.     Sleep, 200
  4075.     SendInput, {down %line%}{enter}
  4076.     BlockInput, Off
  4077. }
  4078.  
  4079. DrugTimer:
  4080. {
  4081.     if (drugTime == 60) {
  4082.         SendClientMessage(PREFIX . "Du kannst deine Drogen in " . SECCOL . "1 Minute {FFFFFF}ernten!")
  4083.     } else if (drugTime == 0) {
  4084.         SendClientMessage(PREFIX . "Du kannst deine Drogen " . SECCOL . "jetzt {FFFFFF}ernten!")
  4085.     }
  4086.    
  4087.     drugTime--
  4088.     drugGrowTime++
  4089. }
  4090. return
  4091. ; --------------- ;
  4092. ; Job-System Ende ;
  4093. ; --------------- ;
  4094.  
  4095. ; --------------- ;
  4096. ; Ausrüsten ;
  4097. ; --------------- ;
  4098. equipProfile1Label:
  4099. {
  4100.     if (IsInChat())
  4101.         return
  4102.    
  4103.     equipment := ""
  4104.    
  4105.     Loop, 6 {
  4106.         if (profile1_%A_Index% != "") {
  4107.             equipment .= " " . profile1_%A_Index%
  4108.         }
  4109.     }
  4110.    
  4111.     SendChat("/ausruesten" . equipment)
  4112.    
  4113.     Sleep, 200
  4114.    
  4115.     chat := readChatLine(0) . readChatLine(1)
  4116.    
  4117.     if (RegExMatch(chat, "Du hast dich ausgerüstet, es wurden (\d+) Materialien benötigt\. \(Verbleibend: (\d+) Materialien\)", chat_)) {
  4118.         SendClientMessage(PREFIX . "Ausrüstungsprofil " . SECCOL . "1 {FFFFFF}genutzt, es wurden " . chat_1 . " Materialien verbraucht.")
  4119.     }
  4120.    
  4121.     SendChat("/heal")
  4122. }
  4123. return
  4124.  
  4125. equipProfile2Label:
  4126. {
  4127.     if (IsInChat())
  4128.         return
  4129.    
  4130.     equipment := ""
  4131.    
  4132.     Loop, 6 {
  4133.         if (profile2_%A_Index% != "") {
  4134.             equipment .= " " . profile2_%A_Index%
  4135.         }
  4136.     }
  4137.    
  4138.     SendChat("/ausruesten" . equipment)
  4139.    
  4140.     Sleep, 200
  4141.    
  4142.     chat := readChatLine(0) . readChatLine(1)
  4143.    
  4144.     if (RegExMatch(chat, "Du hast dich ausgerüstet, es wurden (\d+) Materialien benötigt\. \(Verbleibend: (\d+) Materialien\)", chat_)) {
  4145.         SendClientMessage(PREFIX . "Ausrüstungsprofil " . SECCOL . "2 {FFFFFF}genutzt, es wurden " . chat_1 . " Materialien verbraucht.")
  4146.     }
  4147.    
  4148.     SendChat("/heal")
  4149. }
  4150. return
  4151.  
  4152. equipProfile3Label:
  4153. {
  4154.     if (IsInChat())
  4155.         return
  4156.    
  4157.     equipment := ""
  4158.    
  4159.     Loop, 6 {
  4160.         if (profile3_%A_Index% != "") {
  4161.             equipment .= " " . profile3_%A_Index%
  4162.         }
  4163.     }
  4164.    
  4165.     SendChat("/ausruesten" . equipment)
  4166.    
  4167.     Sleep, 200
  4168.    
  4169.     chat := readChatLine(0) . readChatLine(1)
  4170.    
  4171.     if (RegExMatch(chat, "Du hast dich ausgerüstet, es wurden (\d+) Materialien benötigt\. \(Verbleibend: (\d+) Materialien\)", chat_)) {
  4172.         SendClientMessage(PREFIX . "Ausrüstungsprofil " . SECCOL . "3 {FFFFFF} genutzt, es wurden " . chat_1 . " Materialien verbraucht.")
  4173.     }
  4174.    
  4175.     SendChat("/heal")
  4176. }
  4177. return
  4178.  
  4179. ; ---------------- ;
  4180. ; Fahrzeug-Systeme ;
  4181. ; ---------------- ;
  4182. motorSystemLabel:
  4183. {
  4184.     if (IsInChat())
  4185.         return
  4186.    
  4187.     if (IsPlayerInAnyVehicle()) {
  4188.         if (IsPlayerDriver()) {
  4189.             if (getVehicleEngineState()) {
  4190.                 SendChat("/motor")
  4191.             } else {
  4192.                 if (lockSystem) {
  4193.                     if (!getVehicleLockState()) {
  4194.                         SendChat("/lock")
  4195.                     }
  4196.                 }
  4197.                
  4198.                 SendChat("/motor")
  4199.                 Sleep, 200
  4200.                 SendChat("/licht")
  4201.             }
  4202.         } else {
  4203.             SendClientMessage(PREFIX . "Du bist nicht der Fahrer eines Fahrzeuges.")
  4204.         }
  4205.     } else {
  4206.         SendClientMessage(PREFIX . "Du bist in keinem Fahrzeug.")
  4207.     }
  4208. }
  4209. return
  4210.  
  4211. ~F::
  4212. {
  4213.     if (IsInChat())
  4214.         return
  4215.    
  4216.     if (IsPlayerInAnyVehicle()) {
  4217.         if (motorSystem) {
  4218.             if (IsPlayerDriver() && getVehicleEngineState()) {
  4219.                 SendChat("/motor")
  4220.                 Sleep, 500
  4221.             } else {
  4222.                 if (debug) {
  4223.                     SendClientMessage(PREFIX . "Spieler ist kein Fahrer oder der Motor ist aus: " . IsPlayerDriver() . ":" . getVehicleEngineState())
  4224.                 }
  4225.             }
  4226.         } else {
  4227.             if (debug) {
  4228.                 SendClientMessage(PREFIX . "Motorsystem ist nicht aktiv")
  4229.             }
  4230.         }
  4231.     } else {
  4232.         if (lockSystem) {
  4233.             Loop {
  4234.                 if (IsPlayerDriver() && !getVehicleLockState()) {
  4235.                     Sleep, 200
  4236.                    
  4237.                     if (!getVehicleLockState())
  4238.                         SendChat("/lock")
  4239.                    
  4240.                     return
  4241.                 }
  4242.             }
  4243.            
  4244.             if (debug) {
  4245.                 SendClientMessage(PREFIX . "Spieler ist in keinem Fahrzeug")
  4246.             }
  4247.         }
  4248.     }
  4249. }
  4250. return
  4251.  
  4252. ; -------------------- ;
  4253. ; Automatische Systeme ;
  4254. ; -------------------- ;
  4255. :?:/cd::
  4256. {
  4257.     if (countdownRunning) {
  4258.         SetTimer, CountdownTimer, Off
  4259.        
  4260.         countdownRunning := false
  4261.        
  4262.         SendChat("/" . cdChat . " Der Countdown wurde gestoppt!")
  4263.     } else {
  4264.         countdownTime := PlayerInput("Sekunden: ")
  4265.        
  4266.         if (countdownTime == "")
  4267.             countdownTime := 3
  4268.        
  4269.         if countdownTime is not number
  4270.             return
  4271.        
  4272.         cdChat := PlayerInput("Chat: ")
  4273.        
  4274.         if (cdChat == "")
  4275.             cdChat := "l"
  4276.        
  4277.         SendChat("/" . cdChat . " Countdown:")
  4278.        
  4279.         SetTimer, CountdownTimer, 1000
  4280.        
  4281.         countdownRunning := true
  4282.     }
  4283. }
  4284. return
  4285.  
  4286. CountdownTimer:
  4287. {
  4288.     if (countdownTime == 0) {
  4289.         SendChat("/" . cdChat . " Go Go Go!")
  4290.         SetTimer, CountdownTimer, Off
  4291.        
  4292.         countdownRunning := false
  4293.        
  4294.         return
  4295.     }
  4296.    
  4297.     SendChat("/" . cdChat . " >>> " . countdownTime . " <<<")
  4298.    
  4299.     countdownTime--
  4300. }
  4301. return
  4302.  
  4303. stopAutomaticSystemsLabel:
  4304. {
  4305.     if (IsInChat())
  4306.         return
  4307.    
  4308.     if (countdownRunning) {
  4309.         SetTimer, CountdownTimer, Off
  4310.        
  4311.         countdownRunning := false
  4312.        
  4313.         SendChat("/" . cdChat . " Der Countdown wurde abgebrochen!")
  4314.     }
  4315.    
  4316.     if (autoFindRunning) {
  4317.         SetTimer, AutoFindTimer, Off
  4318.        
  4319.         autoFindRunning := false
  4320.        
  4321.         SendClientMessage(PREFIX . "Das automatische Suchen wurde deaktiviert.")
  4322.     }
  4323.    
  4324.     if (autoShowRunning) {
  4325.         SetTimer, AutoShowPosTimer, Off
  4326.        
  4327.         autoShowRunning := false
  4328.        
  4329.         SendChat("/l Das automatische Zeigen wurde deaktiviert.")
  4330.     }
  4331.    
  4332.     if (autoFindChatRunning) {
  4333.         SetTimer, AutoFindChat, Off
  4334.        
  4335.         autoFindChatRunning := false
  4336.        
  4337.         SendChat("/" . autoFindChat . " Das automatische Suchen von " . playerToFindInChat . " wurde deaktiviert.")
  4338.     }
  4339. }
  4340. return
  4341.  
  4342. :?:/af::
  4343. :?:/afind::
  4344. {
  4345.     playerToFind := PlayerInput("Spieler: ")
  4346.    
  4347.     if (playerToFind == "")
  4348.         return
  4349.    
  4350.     GoSub, AutoFindTimer
  4351.     SetTimer, AutoFindTimer, 5500
  4352.    
  4353.     autoFindRunning := true
  4354.    
  4355.     SendClientMessage(PREFIX . "Das automatische Suchen wird mit der Taste " . SECCOL . stopAutomaticSystemsNoMods . "{FFFFFF} beendet.")
  4356. }
  4357. return
  4358.  
  4359. AutoFindTimer:
  4360. {
  4361.     IfWinNotActive, GTA:SA:MP
  4362.         return
  4363.    
  4364.     SendChat("/find " . playerToFind)
  4365.    
  4366.     Sleep, 200
  4367.    
  4368.     adrGTA2 := getModuleBaseAddress("gta_sa.exe", hGTA)
  4369.     cText := readString(hGTA, adrGTA2 + 0x7AAD43, 512)
  4370.    
  4371.     if (InStr(cText, "Handy aus"))
  4372.         return
  4373.    
  4374.     if (getDistanceBetween(CoordsFromRedmarker()[1], CoordsFromRedmarker()[2], CoordsFromRedmarker()[3], 1163.2358, -1323.2552, 15.3945, 5)) {
  4375.         SendClientMessage(PREFIX . "Der Spieler befindet sich im Krankenhaus!")
  4376.     }
  4377. }
  4378. return
  4379.  
  4380. :?:/as::
  4381. :?:/asp::
  4382. {
  4383.     playerToShowTo := PlayerInput("Spieler, dem gezeigt werden soll: ")
  4384.    
  4385.     if (playerToShowTo == "")
  4386.         return
  4387.    
  4388.     playerToShow := PlayerInput("Gesuchter Spieler: ")
  4389.    
  4390.     if (playerToShow == "")
  4391.         return
  4392.    
  4393.     GoSub, AutoShowPosTimer
  4394.     SetTimer, AutoShowPosTimer, 5500
  4395.    
  4396.     autoShowRunning := true
  4397.    
  4398.     SendClientMessage(PREFIX . "Das automatische Zeigen wird mit der Taste " . SECCOL . stopAutomaticSystemsNoMods . "{FFFFFF} beendet.")
  4399. }
  4400. return
  4401.  
  4402. AutoShowPosTimer:
  4403. {
  4404.     IfWinNotActive, GTA:SA:MP
  4405.         return
  4406.    
  4407.     SendChat("/showpos " . playerToShowTo . " " . playerToShow)
  4408.    
  4409.     Sleep, 200
  4410.    
  4411.     adrGTA2 := getModuleBaseAddress("gta_sa.exe", hGTA)
  4412.     cText := readString(hGTA, adrGTA2 + 0x7AAD43, 512)
  4413.    
  4414.     if (InStr(cText, "Handy aus"))
  4415.         return
  4416.    
  4417.     if (getDistanceBetween(CoordsFromRedmarker()[1], CoordsFromRedmarker()[2], CoordsFromRedmarker()[3], 1163.2358, -1323.2552, 15.3945, 5)) {
  4418.         SendChat("/l Der Spieler befindet sich im Krankenhaus!")
  4419.     }
  4420. }
  4421. return
  4422.  
  4423. :?:/cfind::
  4424. :?:/ffind::
  4425. {
  4426.     playerToFindInChat := PlayerInput("Spieler: ")
  4427.     playerToFindInChat := getFullName(playerToFindInChat)
  4428.    
  4429.     if (playerToFindInChat == "")
  4430.         return
  4431.    
  4432.     autoFindChat := PlayerInput("Chat: ")
  4433.    
  4434.     if (autoFindChat == "")
  4435.         return
  4436.    
  4437.     GoSub, AutoFindChat
  4438.     SetTimer, AutoFindChat, 5500
  4439.    
  4440.     autoFindChatRunning := true
  4441.    
  4442.     SendClientMessage(PREFIX . "Das automatische Suchen wird mit der Taste " . SECCOL . stopAutomaticSystemsNoMods . "{FFFFFF} beendet.")
  4443. }
  4444. return
  4445.  
  4446. AutoFindChat:
  4447. {
  4448.     IfWinNotActive, GTA:SA:MP
  4449.         return
  4450.    
  4451.     SendChat("/find " . playerToFindInChat)
  4452.    
  4453.     Sleep, 200
  4454.    
  4455.     adrGTA2 := getModuleBaseAddress("gta_sa.exe", hGTA)
  4456.     cText := readString(hGTA, adrGTA2 + 0x7AAD43, 512)
  4457.    
  4458.     if (!InStr(cText, "Handy aus")) {
  4459.         if (getDistanceBetween(CoordsFromRedmarker()[1], CoordsFromRedmarker()[2], CoordsFromRedmarker()[3], 1163.2358, -1323.2552, 15.3945, 5)) {
  4460.             SendChat("/" . autoFindChat . " Der Spieler " . playerToFindInChat . " befindet sich im Krankenhaus!")
  4461.             return
  4462.         }
  4463.     }
  4464.    
  4465.     findChat0 := readChatLine(0)
  4466.    
  4467.     if (RegExMatch(findChat0, "^Der Spieler befindet sich in einem (.+)\.$", findChat0_)) {
  4468.         findChat1 := readChatLine(1)
  4469.        
  4470.         if (RegExMatch(findChat1, "^Der Spieler befindet sich in (.+)$", findChat1_)) {
  4471.             SendChat("/" . autoFindChat . " Der Spieler " . playerToFindInChat . " befindet sich in " . findChat1_1 . " in einem " . findChat0_1 . "!")
  4472.         }
  4473.     } else if (RegExMatch(findChat0, "^Der Spieler befindet sich in (.+)$", findChat0_)) {
  4474.         SendChat("/" . autoFindChat . " Der Spieler " . playerToFindInChat . " befindet sich in " . findChat0_1 . "!")
  4475.     }
  4476. }
  4477. return
  4478.  
  4479. ; ---------------------------- ;
  4480. ; Einsatz-Funktionen ;
  4481. ; ---------------------------- ;
  4482. :?:/wo::
  4483. {
  4484.     SendChat("/f Wo befindet ihr euch und was ist das Problem?")
  4485. }
  4486. return
  4487.  
  4488. :?:/cwo::
  4489. {
  4490.     SendChat("/crew Wo befindet ihr euch und was ist das Problem?")
  4491. }
  4492. return
  4493.  
  4494. :?:/ver::
  4495. {
  4496.     SendChat("/f Verstanden und bestätigt!")
  4497. }
  4498. return
  4499.  
  4500. :?:/cver::
  4501. {
  4502.     SendChat("/crew Verstanden und bestätigt!")
  4503. }
  4504. return
  4505.  
  4506. :?:/needbk::
  4507. {
  4508.     SendChat("/f Wird Verstärkung weiterhin benötigt?")
  4509. }
  4510. return
  4511.  
  4512. :?:/cneedbk::
  4513. {
  4514.     SendChat("/crew Wird Verstärkung weiterhin benötigt?")
  4515. }
  4516. return
  4517.  
  4518. :?:/go::
  4519. {
  4520.     SendChat("/f Einsatzleiter erlaubt Zugriff, GOGOGO!")
  4521. }
  4522. return
  4523.  
  4524. :?:/cgo::
  4525. {
  4526.     SendChat("/crew Einsatzleiter erlaubt Zugriff, GOGOGO!")
  4527. }
  4528. return
  4529.  
  4530. :?:/abholung::
  4531. {
  4532.     zone := getPlayerZone()
  4533.     city := getPlayerCity()
  4534.    
  4535.     if (city == "" || city == "Unbekannt") {
  4536.         SendChat("/f Erbitte Abholung in " . zone . "!")
  4537.     } else {
  4538.         SendChat("/f Erbitte Abholung in " . zone . ", " . city . "!")
  4539.     }
  4540. }
  4541. return
  4542.  
  4543. :?:/cabholung::
  4544. {
  4545.     zone := getPlayerZone()
  4546.     city := getPlayerCity()
  4547.    
  4548.     if (city == "" || city == "Unbekannt") {
  4549.         SendChat("/crew Erbitte Abholung in " . zone . "!")
  4550.     } else {
  4551.         SendChat("/crew Erbitte Abholung in " . zone . ", " . city . "!")
  4552.     }
  4553. }
  4554. return
  4555.  
  4556. :?:/kabholung::
  4557. {
  4558.     SendChat("/f Eine Abholung wird nicht mehr benötigt.")
  4559. }
  4560. return
  4561.  
  4562. :?:/ckabholung::
  4563. {
  4564.     SendChat("/crew Eine Abholung wird nicht mehr benötigt.")
  4565. }
  4566. return
  4567.  
  4568. :?:/verf::
  4569. :?:/verfolgung::
  4570. {
  4571.     name := PlayerInput("Spieler: ")
  4572.     name := getFullName(name)
  4573.    
  4574.     if (name == "")
  4575.         return
  4576.    
  4577.     id := getPlayerIdByName(name, true)
  4578.    
  4579.     SendChat("/f Erbitte Unterstützung bei der Verfolgung von " . name . " (ID: " . id . ")!")
  4580. }
  4581. return
  4582.  
  4583. :?:/cverf::
  4584. :?:/cverfolgung::
  4585. {
  4586.     name := PlayerInput("Spieler: ")
  4587.     name := getFullName(name)
  4588.    
  4589.     if (name == "")
  4590.         return
  4591.    
  4592.     id := getPlayerIdByName(name, true)
  4593.    
  4594.     SendChat("/crew Erbitte Unterstützung bei der Verfolgung von " . name . " (ID: " . id . ")!")
  4595. }
  4596. return
  4597.  
  4598. :?:/ort::
  4599. {
  4600.     position := PlayerInput("Letzter bekannter Aufenthaltsort: ")
  4601.    
  4602.     if (position == "")
  4603.         return
  4604.    
  4605.     SendChat("/f Letzter bekannter Aufenthaltsort: " . position . ".")
  4606. }
  4607. return
  4608.  
  4609. :?:/cort::
  4610. {
  4611.     position := PlayerInput("Letzter bekannter Aufenthaltsort: ")
  4612.    
  4613.     if (position == "")
  4614.         return
  4615.    
  4616.     SendChat("/crew Letzter bekannter Aufenthaltsort: " . position . ".")
  4617. }
  4618. return
  4619.  
  4620. repeatLabel:
  4621. {
  4622.     if (IsInChat())
  4623.         return
  4624.    
  4625.     SendInput, t{up}{enter}
  4626. }
  4627. return
  4628.  
  4629. stopwatchLabel:
  4630. {
  4631.     if (IsInChat())
  4632.         return
  4633.    
  4634.     SendChat("/l Stoppuhr gestartet!")
  4635.    
  4636.     SendClientMessage(PREFIX . "Um die Stoppuhr zu beenden, drücke " . SECCOL . "Punkt (.){FFFFFF}!")
  4637.    
  4638.     stopwatch := 0
  4639.    
  4640.     Loop {
  4641.         stopwatch++
  4642.        
  4643.         KeyWait, ., D T1
  4644.        
  4645.         if (!ErrorLevel) {
  4646.             minutes := Floor(stopwatch / 60)
  4647.             seconds := stopwatch - (minutes * 60)
  4648.            
  4649.             SendChat("/l Stoppuhr gestoppt: " . minutes . " Minuten, " . seconds . " Sekunden")
  4650.             SendChat("/l Gesamt: " . stopwatch . " Sekunden")
  4651.             break
  4652.         }
  4653.     }
  4654. }
  4655. return
  4656.  
  4657. ; -------------------- ;
  4658. ; Fisch-System ;
  4659. ; -------------------- ;
  4660. eatFishLabel:
  4661. {
  4662.     if (IsInChat())
  4663.         return
  4664.    
  4665.     SendChat("/eat " . currentFish)
  4666.    
  4667.     currentFish++
  4668.    
  4669.     if (currentFish == 6) {
  4670.         currentFish := 1
  4671.     }
  4672. }
  4673. return
  4674.  
  4675. :?:/fischtyp::
  4676. :?:/fishtype::
  4677. :?:/fishtyp::
  4678. {
  4679.     SendClientMessage(PREFIX . SECCOL . "1: {FFFFFF}geringste LBS/HP - " . SECCOL . "2: {FFFFFF}geringster Geldwert")
  4680.    
  4681.     fishType := PlayerInput("Typ: ")
  4682.    
  4683.     if (fishType == "1") {
  4684.         fishMode := 0
  4685.        
  4686.         SendClientMessage(PREFIX . "Du wirfst nun den Fisch mit dem geringsten " . SECCOL . "LBS/HP-Wert {FFFFFF}weg.")
  4687.        
  4688.         IniWrite, %fishMode%, settings.ini, Einstellungen, FischModus
  4689.     } else if (fishType == "2") {
  4690.         fishMode := 1
  4691.        
  4692.         SendClientMessage(PREFIX . "Du wirfst nun den Fisch mit dem geringsten " . SECCOL . "Geldwert {FFFFFF}weg.")
  4693.        
  4694.         IniWrite, %fishMode%, settings.ini, Einstellungen, FischModus
  4695.     }
  4696. }
  4697. return
  4698.  
  4699. :?:/afish::
  4700. {
  4701.     fishNumber := 0
  4702.     aFishMoney := 0
  4703.     aFishHP := 0
  4704.     cheapestFish := -1
  4705.     cheapestFishName := ""
  4706.     cheapestFishValue := 100000
  4707.     cheapestFishMoney := 100000
  4708.     cheapestFishHP := 100000
  4709.     thrownAway := false
  4710.     attempt := 1
  4711.    
  4712.     Loop {
  4713.         SendChat("/fish")
  4714.        
  4715.         Sleep, 200
  4716.        
  4717.         fishing := readChatLine(0)
  4718.        
  4719.         if (RegExMatch(fishing, "Du hast ein\/e (.+) mit (\d+) LBS gefangen.", fishing_)) {
  4720.             fishNumber++
  4721.            
  4722.             currentFishMoney := getFishValue(fishing_1, fishing_2)
  4723.            
  4724.             if (fishMode) {
  4725.                 fishValue := currentFishMoney
  4726.             } else {
  4727.                 fishValue := fishing_2
  4728.             }
  4729.            
  4730.             setChatLine(0, PREFIX . "Fisch Nr. " . fishNumber . ": " . SECCOL . fishing_1 . "{FFFFFF} mit " . SECCOL . fishing_2 . " LBS{FFFFFF} - Wert: " . SECCOL . FormatNumber(currentFishMoney) . "$")
  4731.            
  4732.             aFishMoney += currentFishMoney
  4733.             aFishHP += fishing_2
  4734.            
  4735.             if (cheapestFishValue > fishValue) {
  4736.                 cheapestFish := fishNumber
  4737.                 cheapestFishName := fishing_1
  4738.                 cheapestFishValue := fishValue
  4739.                 cheapestFishMoney := currentFishMoney
  4740.                 cheapestFishHP := fishing_2
  4741.             }
  4742.         } else if (RegExMatch(fishing, "Du kannst nur 5 Fische bei dir tragen.")) {
  4743.             if (cheapestFish == -1) {
  4744.                 SendClientMessage(PREFIX . "Du musst deine Fische erst verkaufen!")
  4745.                 break
  4746.             }
  4747.            
  4748.             if (thrownAway)
  4749.                 break
  4750.            
  4751.             aFishMoney -= cheapestFishMoney
  4752.             aFishHP -= cheapestFishHP
  4753.            
  4754.             SendChat("/releasefish " . cheapestFish)
  4755.             Sleep, 200
  4756.            
  4757.             if (fishMode)  {
  4758.                 setChatLine(0, PREFIX . "Fisch Nr. " . cheapestFish . ": " . SECCOL . cheapestFishName . " {FFFFFF}mit einem Wert von " . SECCOL . FormatNumber(cheapestFishValue) . "$ {FFFFFF}wurde weggeworfen!")
  4759.             } else {
  4760.                 setChatLine(0, PREFIX . "Fisch Nr. " . cheapestFish . ": " . SECCOL . cheapestFishName . " {FFFFFF}mit " . SECCOL . FormatNumber(cheapestFishValue) . " LBS {FFFFFF}wurde weggeworfen!")
  4761.             }
  4762.            
  4763.             thrownAway := true
  4764.         } else if (RegExMatch(fishing, "Du bist an keinem Angelplatz \(Big Wheel Rods\) oder an einem Fischerboot!")) {
  4765.             if (attempt == 3) {
  4766.                 SendClientMessage(PREFIX . "Du kannst hier nicht angeln!")
  4767.                 break
  4768.             }
  4769.            
  4770.             attempt++
  4771.         } else if (RegExMatch(fishing, "Du kannst erst in (\d+) (\S+) wieder angeln\.")) {
  4772.             if (aFishMoney + aFishHP > 0) {
  4773.                 SendClientMessage(PREFIX . "Gesamtwert: " . SECCOL . FormatNumber(aFishMoney) . "$ {FFFFFF}- " . SECCOL . FormatNumber(aFishHP) . " LBS {FFFFFF}- " . SECCOL . Floor(aFishHP / 3) . " HP")
  4774.                
  4775.                 fishTime := 900
  4776.                
  4777.                 SetTimer, FishTimer, 1000
  4778.                 break
  4779.             } else {
  4780.                 SendClientMessage(PREFIX . "Du kannst noch nicht angeln!")
  4781.                 break
  4782.             }
  4783.         }
  4784.        
  4785.         if (!admin)
  4786.             Sleep, 650
  4787.     }
  4788. }
  4789. return
  4790.  
  4791. FishTimer:
  4792. {
  4793.     if (fishTime == 60) {
  4794.         SendClientMessage(PREFIX . "Du kannst in einer Minute wieder zum Angeln gehen!")
  4795.     } else if (fishTime <= 0) {
  4796.         SendClientMessage(PREFIX . "Du kannst nun wieder zum Angeln gehen!")
  4797.        
  4798.         SetTimer, FishTimer, Off
  4799.        
  4800.         fishTime := 0
  4801.         return
  4802.     }
  4803.    
  4804.     fishTime--
  4805. }
  4806. return
  4807.  
  4808. :?:/asell::
  4809. {
  4810.     if (IsPlayerInRangeOfPoint(2.3247, -28.8923, 1003.5494, 10)) {
  4811.         SendClientMessage(PREFIX . "Deine Fische werden nun verkauft!")
  4812.        
  4813.         sellFishMoney := 0
  4814.        
  4815.         Loop, 5 {
  4816.             SendChat("/sell fish " . A_Index)
  4817.            
  4818.             Sleep, 200
  4819.        
  4820.             chat := readChatLine(0)
  4821.            
  4822.             if (RegExMatch(chat, "Du hast deinen (.+) \((\d+) LBS\) für (\d+)\$ verkauft\.", chat_)) {
  4823.                 sellFishMoney += chat_3
  4824.             }
  4825.            
  4826.             if (!admin)
  4827.                 Sleep, 550
  4828.         }
  4829.        
  4830.         IniRead, totalFishMoney, stats.ini, Fischsystem, Fischgeld, 0
  4831.        
  4832.         totalFishMoney += sellFishMoney
  4833.        
  4834.         IniWrite, %totalFishMoney%, stats.ini, Fischsystem, Fischgeld
  4835.        
  4836.         SendClientMessage(PREFIX . "Verdienst: " . SECCOL . FormatNumber(sellFishMoney) . "$ {FFFFFF}Gesamter Verdienst: " . SECCOL . FormatNumber(totalFishMoney) . "$")
  4837.     } else {
  4838.         IniRead, totalFishMoney, stats.ini, Fischsystem, Fischgeld, 0
  4839.        
  4840.         SendClientMessage(PREFIX . "Du kannst deine Fische hier nicht verkaufen! (Gesamter Verdienst: " . SECCOL . FormatNumber(totalFishMoney) . "${FFFFFF})")
  4841.     }
  4842. }
  4843. return
  4844.  
  4845. :?:/acook::
  4846. {
  4847.     Loop, 5 {
  4848.         SendChat("/cook fish " . A_Index)
  4849.        
  4850.         if (!admin)
  4851.             Sleep, 750
  4852.     }
  4853. }
  4854. return
  4855.  
  4856. :?:/fische::
  4857. {
  4858.     SendChat("/fishes")
  4859.  
  4860.     Sleep, 250
  4861.  
  4862.     fishNumber := 5
  4863.     fishMoney := 0
  4864.     totalHP := 0
  4865.    
  4866.     Loop, 5 {
  4867.         fish := readChatLine(fishNumber)
  4868.        
  4869.         RegExMatch(fish, "\*\* \((\d)\) Fisch: (.+) \((\d+) LBS\)", fish_)
  4870.        
  4871.         fishValue := getFishValue(fish_2, fish_3)
  4872.         fishMoney += fishValue
  4873.        
  4874.         hp := Floor(fish_3 / 3)
  4875.         totalHP += hp
  4876.        
  4877.         message%A_Index% := PREFIX . "(" . fish_1 . ") " . fish_2 . " (" . fish_3 . " LBS) - " . SECCOL . fishValue . "$ {FFFFFF}- " . SECCOL . hp . " HP"
  4878.        
  4879.         fishNumber -= 1
  4880.     }
  4881.    
  4882.     fishNumber := 5
  4883.    
  4884.     Loop, 5 {
  4885.         setChatLine(fishNumber, message%A_Index%)
  4886.        
  4887.         fishNumber -= 1
  4888.     }
  4889.    
  4890.     SendClientMessage(PREFIX . "Gesamt: " . SECCOL . FormatNumber(fishMoney) . "$ {FFFFFF}- " . SECCOL . FormatNumber(totalHP) . " HP")
  4891. }
  4892. return
  4893.  
  4894. :?:/hp::
  4895. {
  4896.     SendChat("/cooked")
  4897.    
  4898.     Sleep, 250
  4899.    
  4900.     fishNumber := 5
  4901.     totalHP := 0
  4902.    
  4903.     Loop, 5 {
  4904.         fish := readChatLine(fishNumber)
  4905.        
  4906.         if (RegExMatch(fish, "\*\* \((\d)\) Hergestellt: gekochten (.+) \((\d+) LBS\)", fish_)) {
  4907.             HP := Floor(fish_3 / 3)
  4908.             totalHP += HP
  4909.            
  4910.             message%A_Index% := PREFIX . "(" . fish_1 . ") " . fish_2 . " (" . fish_3 . " LBS) - " . SECCOL . HP . " HP"
  4911.         } else if (RegExMatch(fish, "\*\* \((\d)\) Hergestellt: Nichts \(0 LBS\)", fish_)) {
  4912.             message%A_Index% := PREFIX . "(" . fish_1 . ") Nichts"
  4913.         }
  4914.        
  4915.         fishNumber -= 1
  4916.     }
  4917.    
  4918.     fishNumber := 5
  4919.    
  4920.     Loop, 5 {
  4921.         setChatLine(fishNumber, message%A_Index%)
  4922.        
  4923.         fishNumber -= 1
  4924.     }
  4925.    
  4926.     SendClientMessage(PREFIX . "Gesamt: " . SECCOL . FormatNumber(totalHP) . " HP")
  4927. }
  4928. return
  4929.  
  4930. getFishValue(fishName, fishWeight) {
  4931.     if (fishName == "Bernfisch") {
  4932.         value := fishWeight * 1
  4933.     } else if (fishName == "Blauer Fächerfisch") {
  4934.         value := fishWeight * 1
  4935.     } else if (fishName == "Roter Schnapper") {
  4936.         value := fishWeight * 2
  4937.     } else if (fishName == "Schwertfisch") {
  4938.         value := fishWeight * 2
  4939.     } else if (fishName == "Zackenbarsch") {
  4940.         value := fishWeight * 2
  4941.     } else if (fishName == "Katzenfisch") {
  4942.         value := fishWeight * 3
  4943.     } else if (fishName == "Forelle") {
  4944.         value := fishWeight * 3
  4945.     } else if (fishName == "Delphin") {
  4946.         value := fishWeight * 4
  4947.     } else if (fishName == "Hai") {
  4948.         value := fishWeight * 4
  4949.     } else if (fishName == "Segelfisch") {
  4950.         value := fishWeight * 4
  4951.     } else if (fishName == "Makrele") {
  4952.         value := fishWeight * 5
  4953.     } else if (fishName == "Aal") {
  4954.         value := fishWeight * 6
  4955.     } else if (fishName == "Hecht") {
  4956.         value := fishWeight * 6
  4957.     } else if (fishName == "Schildkröte") {
  4958.         value := fishWeight * 8
  4959.     } else if (fishName == "Thunfisch") {
  4960.         value := fishWeight * 8
  4961.     } else if (fishName == "Wolfbarsch") {
  4962.         value := fishWeight * 8
  4963.     } else {
  4964.         value := 0
  4965.     }
  4966.    
  4967.     return value
  4968. }
  4969.  
  4970. ; ------------------- ;
  4971. ; Sonstige Funktionen ;
  4972. ; ------------------- ;
  4973. :?:/kills::
  4974. :?:/tode::
  4975. :?:/deaths::
  4976. :?:/kd::
  4977. {
  4978.     IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
  4979.     IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
  4980.     IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
  4981.     IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
  4982.    
  4983.     allKD := Round(alltimeKills / alltimeDeaths, 2)
  4984.     dayKD := Round(dayKills / dayDeaths, 2)
  4985.    
  4986.     SendClientMessage(PREFIX . "Kills: " . SECCOL . FormatNumber(alltimeKills) . " {FFFFFF}Tages-Kills: " . SECCOL . FormatNumber(dayKills))
  4987.     SendClientMessage(PREFIX . "Tode: " . SECCOL . FormatNumber(alltimeDeaths) . " {FFFFFF}Tages-Tode: " . SECCOL . FormatNumber(dayDeaths))
  4988.     SendClientMessage(PREFIX . "K/D: " . SECCOL . allKD . " {FFFFFF}Tages-K/D: " . SECCOL . dayKD)
  4989. }
  4990. return
  4991.  
  4992. :?:/fkd::
  4993. :?:/crewkd::
  4994. {
  4995.     if (RegExMatch(A_ThisHotkey, "i)^:\?:\/(\S+)kd$", hstring_)) {
  4996.         IniRead, alltimeKills, stats.ini, Gesamt, Kills, 0
  4997.         IniRead, dayKills, stats.ini, Tag, Kills[%A_DD%:%A_MM%:%A_YYYY%], 0
  4998.         IniRead, alltimeDeaths, stats.ini, Gesamt, Tode, 0
  4999.         IniRead, dayDeaths, stats.ini, Tag, Tode[%A_DD%:%A_MM%:%A_YYYY%], 0
  5000.        
  5001.         allKD := Round(alltimeKills / alltimeDeaths, 2)
  5002.         dayKD := Round(dayKills / dayDeaths, 2)
  5003.        
  5004.         SendChat("/" . hstring_1 . " K/D: " . allKD . " (" . alltimeKills . " Kills/" . alltimeDeaths . " Tode) - Tages-K/D: " . dayKD . " (" . dayKills . " Kills/" . dayDeaths . " Tode)")
  5005.     }
  5006. }
  5007. return
  5008.  
  5009. :?:/setkills::
  5010. :?:/settode::
  5011. :?:/setdeaths::
  5012. {
  5013.     blockDialog()
  5014.    
  5015.     SendChat("/stats")
  5016.    
  5017.     Sleep, 100
  5018.    
  5019.     title := getDialogCaption()
  5020.     dialog := getDialogText()
  5021.    
  5022.     unblockDialog()
  5023.    
  5024.     if (RegExMatch(dialog, statsFormat, dialog_)) {
  5025.         kills := dialog_17
  5026.         deaths := dialog_18
  5027.        
  5028.         IniWrite, %deaths%, stats.ini, Gesamt, Tode
  5029.         IniWrite, %kills%, stats.ini, Gesamt, Kills
  5030.     } else {
  5031.         SendClientMessage(PREFIX . "Beim automatischen Auslesen der Kills und Tode ist ein Fehler aufgetreten.")
  5032.         SendClientMessage(PREFIX . "Du kannst deine Statistiken nun manuell eintragen.")
  5033.        
  5034.         kills := PlayerInput("Kills: ")
  5035.        
  5036.         if kills is not number
  5037.             return
  5038.        
  5039.         deaths := PlayerInput("Tode: ")
  5040.        
  5041.         if deaths is not number
  5042.             return
  5043.        
  5044.         IniWrite, %deaths%, stats.ini, Gesamt, Tode
  5045.         IniWrite, %kills%, stats.ini, Gesamt, Kills
  5046.     }
  5047.    
  5048.     SendClientMessage(PREFIX . "Deine Kills wurden auf " . SECCOL . FormatNumber(kills) . " {FFFFFF}und deine Tode auf " . SECCOL . FormatNumber(deaths) . " {FFFFFF}gesetzt.")
  5049. }
  5050. return
  5051.  
  5052. statsLabel:
  5053.     if (isInChat())
  5054.         return
  5055.    
  5056. :?:/stats::
  5057. {
  5058.     if (statsFormatted) {
  5059.         showStats()
  5060.     } else {
  5061.         if (tv) {
  5062.             SendChat("/check " . tvName)
  5063.         } else {
  5064.             SendChat("/stats")
  5065.         }
  5066.     }
  5067. }
  5068. return
  5069.  
  5070. showStats() {
  5071.     blockDialog()
  5072.    
  5073.     if (tv) {
  5074.         SendChat("/check " . tvName)
  5075.     } else {
  5076.         SendChat("/stats")
  5077.     }
  5078.    
  5079.     Sleep, 100
  5080.    
  5081.     title := getDialogCaption()
  5082.     dialog := getDialogText()
  5083.    
  5084.     unblockDialog()
  5085.    
  5086.     if (RegExMatch(dialog, statsFormat, dialog_)) {
  5087.         gender := dialog_1
  5088.         partner := dialog_2
  5089.         level := dialog_3
  5090.         rp := dialog_4
  5091.         levelRP := dialog_5
  5092.         timeToPayday := dialog_6
  5093.         maxTimePayday := dialog_7
  5094.         fraction := dialog_8
  5095.         fractionRank := dialog_9
  5096.         job := dialog_10
  5097.         crew := dialog_11
  5098.         cashMoney := dialog_12
  5099.         accountMoney := dialog_13
  5100.         depositMoney := dialog_14
  5101.         depositMoneyInterest := dialog_15 . "." . dialog_16
  5102.         kills := dialog_17
  5103.         deaths := dialog_18
  5104.         crimes := FormatNumber(dialog_19)
  5105.         playingTime := FormatNumber(dialog_20)
  5106.         jail := FormatNumber(dialog_21)
  5107.         wanteds := dialog_22
  5108.         warns := dialog_23
  5109.         maxWarns := dialog_24
  5110.         mats := FormatNumber(dialog_25)
  5111.         matsSafe := FormatNumber(dialog_26)
  5112.         drugs := FormatNumber(dialog_27)
  5113.         drugsSafe := FormatNumber(dialog_28)
  5114.         number := dialog_29
  5115.         packet := dialog_30
  5116.         canister := dialog_31
  5117.         wdSkill := dialog_32
  5118.         wdExp := dialog_33
  5119.         ddSkill := dialog_34
  5120.         ddExp := dialog_35
  5121.         anglerSkill := dialog_36
  5122.         busSkill := dialog_37
  5123.         busExp := dialog_38
  5124.         busMaxExp := dialog_39
  5125.         lawyerSkill := dialog_40
  5126.         lawerExp := dialog_41
  5127.         detectiveSkill := dialog_42
  5128.         detectiveExp := dialog_43
  5129.         pilotExp := dialog_44
  5130.         fisherExp := dialog_45
  5131.         farmerExp := dialog_46
  5132.         woodExp := dialog_47
  5133.         rank := dialog_48
  5134.        
  5135.         if (partner != "Niemand") {
  5136.             partnerID := getPlayerIdByName(partner, true)
  5137.            
  5138.             if (partnerID != -1) {
  5139.                 partner .= " [ID: " . partnerID . "]"
  5140.             }
  5141.         }
  5142.        
  5143.         level .= " (" . Round(rp / levelRP * 100) . "%)"
  5144.         respect := rp . "/" . levelRP . " (noch " . (levelRP - rp) . " Punkte)"
  5145.         payday := timeToPayday . "/" . maxTimePayday . " Minuten (noch " . (maxTimePayday - timeToPayday) . " Minuten)"
  5146.        
  5147.         crewInfos := ""
  5148.        
  5149.         if (RegExMatch(crew, "(.+)`tRang: (\d+)`n`t`tCrew-Motto: (\S+)", crew_)) {
  5150.             crewInfos := crew_1 . "`t{FFFF00}Rang: {FFFFFF}" . crew_2 . "`n`t`t{FFFF00}Crew-Motto: {FFFFFF}" . crew_3
  5151.         } else if (RegExMatch(crew, "(.+)`tRang: (\d+)", crew_)) {
  5152.             crewInfos := crew_1 . "`t{FFFF00}Rang: {FFFFFF}" . crew_2
  5153.         } else {
  5154.             crewInfos := crew
  5155.         }
  5156.        
  5157.         if (!tv) {
  5158.             IniWrite, %accountMoney%, stats.ini, Vermögen, Bank
  5159.             IniWrite, %depositMoney%, stats.ini, Vermögen, Festgeld
  5160.         }
  5161.        
  5162.         allMoney := FormatNumber(cashMoney + accountMoney + depositMoney)
  5163.         cashMoney := FormatNumber(cashMoney)
  5164.         accountMoney := FormatNumber(accountMoney)
  5165.         depositMoney := FormatNumber(depositMoney)
  5166.        
  5167.         kd := Round(kills / deaths, 2)
  5168.        
  5169.         if (!tv) {
  5170.             IniWrite, %deaths%, stats.ini, Gesamt, Tode
  5171.             IniWrite, %kills%, stats.ini, Gesamt, Kills
  5172.         }
  5173.        
  5174.         kills := FormatNumber(kills)
  5175.         deaths := FormatNumber(deaths)
  5176.        
  5177.         if (wdSkill <= 1) {
  5178.             wdMaxExp := 50
  5179.         } else if (wdSkill == 2) {
  5180.             wdMaxExp := 50
  5181.         } else if (wdSkill == 3) {
  5182.             wdMaxExp := 100
  5183.         } else if (wdSkill >= 4) {
  5184.             wdMaxExp := 200
  5185.         }
  5186.        
  5187.         if (wdSkill == 1) {
  5188.             wdLevelExp := wdExp
  5189.         } else {
  5190.             wdLevelExp := wdExp - wdMaxExp
  5191.         }
  5192.        
  5193.         if (ddSkill <= 1) {
  5194.             ddMaxExp := 50
  5195.         } else if (ddSkill == 2) {
  5196.             ddMaxExp := 50
  5197.         } else if (ddSkill == 3) {
  5198.             ddMaxExp := 100
  5199.         } else if (ddSkill >= 4) {
  5200.             ddMaxExp := 200
  5201.         }
  5202.        
  5203.         if (ddSkill == 1) {
  5204.             ddLevelExp := ddExp
  5205.         } else {
  5206.             ddLevelExp := ddExp - ddMaxExp
  5207.         }
  5208.        
  5209.         lawyerMaxExp := lawyerSkill * 50
  5210.        
  5211.         if (detectiveSkill <= 1) {
  5212.             detectiveMaxExp := 50
  5213.         } else if (detectiveSkill == 2) {
  5214.             detectiveMaxExp := 100
  5215.         } else if (detectiveSkill == 3) {
  5216.             detectiveMaxExp := 200
  5217.         } else if (detectiveSkill >= 4) {
  5218.             detectiveMaxExp := 400
  5219.         }
  5220.        
  5221.         if (!tv) {
  5222.             IniWrite, %fisherExp%, stats.ini, Hochseefischer, XP
  5223.             IniWrite, %farmerExp%, stats.ini, Farmer, XP
  5224.             IniWrite, %ddExp%, stats.ini, Drogen, XP
  5225.             IniWrite, %wdExp%, stats.ini, Materialien, XP
  5226.            
  5227.             jobWeapondealerSkill := wdSkill + 1
  5228.             jobDetectiveSkill := detectiveSkill + 1
  5229.            
  5230.             IniWrite, %jobWeapondealerSkill%, settings.ini, Job, Waffendealerskill
  5231.             IniWrite, %jobDetectiveSkill%, settings.ini, Job, Detektivskill
  5232.         }
  5233.        
  5234.         statistik =
  5235.             (LTrim
  5236.                 {FFFFFF}Personalien:`t{FFFF00}Geschlecht: {FFFFFF}%gender%
  5237.                 `t`t{FFFF00}Partner: {FFFFFF}%partner%
  5238.                
  5239.                 `t`t{FFFF00}Level: {FFFFFF}%level%
  5240.                 `t`t{FFFF00}Respekt: {FFFFFF}%respect%
  5241.                 `t`t{FFFF00}Payday: {FFFFFF}%payday%
  5242.                
  5243.                 Berufe:`t`t{FFFF00}Fraktion: {FFFFFF}%fraction% {FFFF00}Rang: {FFFFFF}%fractionRank%
  5244.                 `t`t{FFFF00}Nebenjob: {FFFFFF}%job%
  5245.                 `t`t{FFFF00}Crew: {FFFFFF}%crewInfos%
  5246.                
  5247.                 Finanzen:`t{FFFF00}Bargeld: {FFFFFF}%cashMoney%$
  5248.                 `t`t{FFFF00}Konto: {FFFFFF}%accountMoney%$
  5249.                 `t`t{FFFF00}Festgeld: {FFFFFF}%depositMoney%$   {FFFF00}Zinssatz: {FFFFFF}%depositMoneyInterest%
  5250.                 `t`t{FFFF00}Gesamtgeld: {FFFFFF}%allMoney%$
  5251.                
  5252.                 Statistik:`t{FFFF00}Morde: {FFFFFF}%kills%
  5253.                 `t`t{FFFF00}Gestorben: {FFFFFF}%deaths%
  5254.                 `t`t{FFFF00}K/D: {FFFFFF}%kd%
  5255.                 `t`t{FFFF00}Verbrechen: {FFFFFF}%crimes%
  5256.                 `t`t{FFFF00}Spielzeit: {FFFFFF}%playingTime%h
  5257.                 `t`t{FFFF00}Knast: {FFFFFF}%jail%
  5258.                 `t`t{FFFF00}Wanteds: {FFFFFF}%wanteds%
  5259.                 `t`t{FFFF00}Verwarnungen: {FFFFFF}%warns%/%maxWarns%
  5260.                
  5261.                 Inventar:`t{FFFF00}Materialien: {FFFFFF}%mats% ({FFFF00}Safe: {FFFFFF}%matsSafe%)
  5262.                 `t`t{FFFF00}Drogen: {FFFFFF}%drugs%g ({FFFF00}Safe: {FFFFFF}%drugsSafe%g)
  5263.                 `t`t{FFFF00}Handy {FFFFFF}({FFFF00}Nr. {FFFFFF}%number%)%packet%%canister%
  5264.                
  5265.                 Skills:`t`t{FFFF00}Waffendealer: {FFFFFF}%wdSkill% (%wdExp%)`t{FFFF00}Exp: {FFFFFF}%wdLevelExp%/%wdMaxExp%
  5266.                 `t`t{FFFF00}Drogendealer: {FFFFFF}%ddSkill% (%ddExp%)`t{FFFF00}Exp: {FFFFFF}%ddLevelExp%/%ddMaxExp%
  5267.                 `t`t{FFFF00}Busfahrer: {FFFFFF}%busSkill%`t`t{FFFF00}Exp: {FFFFFF}%busExp%/%busMaxExp%
  5268.                 `t`t{FFFF00}Anwalt: {FFFFFF}%lawyerSkill%`t`t{FFFF00}Exp: {FFFFFF}%lawerExp%/%lawyerMaxExp%
  5269.                 `t`t{FFFF00}Detektiv: {FFFFFF}%detectiveSkill%`t`t{FFFF00}Exp: {FFFFFF}%detectiveExp%/%detectiveMaxExp%
  5270.                 `t`t{FFFF00}Pilot: {FFFFFF}%pilotExp%
  5271.                 `t`t{FFFF00}Angler: {FFFFFF}%anglerSkill%
  5272.                 `t`t{FFFF00}Hochseefischer: {FFFFFF}%fisherExp%
  5273.                 `t`t{FFFF00}Farmer: {FFFFFF}%farmerExp%
  5274.                 `t`t{FFFF00}Holzfäller: {FFFFFF}%woodExp%%rank%`n
  5275.             )
  5276.        
  5277.         Sleep, 100
  5278.        
  5279.         ShowDialog(0, title, statistik, "Schließen")
  5280.     }
  5281. }
  5282.  
  5283. firstAidLabel:
  5284. {
  5285.     if (!tv) {
  5286.         if (IsInChat())
  5287.             return
  5288.        
  5289.         hp := getPlayerHealth()
  5290.        
  5291.         if (hp > 95) {
  5292.             SendClientMessage(PREFIX . "Du kannst aktuell kein Erste-Hilfe-Paket benutzen, da du mehr als " . SECCOL . "95 HP {FFFFFF}hast!")
  5293.         } else {
  5294.             SendChat("/erstehilfe")
  5295.         }
  5296.     }
  5297. }
  5298. return
  5299.  
  5300. :?:/pd::
  5301. :?:/payday::
  5302. {
  5303.     if (taxes == 1) {
  5304.         SendClientMessage(PREFIX . "Es wurde noch kein Steuersatz eingetragen, gib bitte " . SECCOL . "/settax {FFFFFF}ein!")
  5305.     }
  5306.    
  5307.     SendClientMessage(PREFIX . "Geld am nächsten Payday: " . SECCOL . FormatNumber(paydayMoney) . "$ {FFFFFF}(Brutto) " . SECCOL . FormatNumber(Round(paydayMoney * taxes)) . "$ {FFFFFF}(Netto)")
  5308.    
  5309.     blockDialog()
  5310.     SendChat("/stats")
  5311.     Sleep, 200
  5312.     unBlockDialog()
  5313.    
  5314.     if (RegExMatch(getDialogText(), statsFormat, dialog_)) {
  5315.         paydayTime := dialog_7 - dialog_6
  5316.        
  5317.         SendClientMessage(PREFIX . "Du hast in " . SECCOL . paydayTime . " Minute" . (paydayTime == 1 ? "" : "n") . " {FFFFFF}Payday.")
  5318.     }
  5319. }
  5320. return
  5321.  
  5322. :?:/resetpd::
  5323. :?:/resetpayday::
  5324. {
  5325.     SendClientMessage(PREFIX . "Geld am nächsten Payday: " . SECCOL . FormatNumber(paydayMoney) . "$ {FFFFFF}(Brutto) " . SECCOL . FormatNumber(Round(paydayMoney * taxes)) . "$ {FFFFFF}(Netto)")
  5326.    
  5327.     paydayMoney := 0
  5328.    
  5329.     SendClientMessage(PREFIX . "Du hast das Geld für den nächsten Payday auf 0$ zurückgesetzt!")
  5330. }
  5331. return
  5332.  
  5333. :?:/settax::
  5334. {
  5335.     taxClass := PlayerInput("Steuerklasse: ")
  5336.    
  5337.     if (taxClass == "")
  5338.         return
  5339.    
  5340.     if taxClass is not number
  5341.     {
  5342.         SendClientMessage(PREFIX . "Gib bitte eine gültige Steuerklasse (1-4) ein!")
  5343.         return
  5344.     }
  5345.    
  5346.     if (taxClass < 1 || taxClass > 4) {
  5347.         SendClientMessage(PREFIX . "Gib bitte eine gültige Steuerklasse (1-4) ein!")
  5348.         return
  5349.     }
  5350.    
  5351.     SendChat("/tax")
  5352.    
  5353.     Sleep, 250
  5354.    
  5355.     chat := readChatLine(4 - taxClass)
  5356.    
  5357.     RegExMatch(chat, "Steuerklasse " . taxClass . ": (\d*) Prozent", chat_)
  5358.    
  5359.     taxes := (100 - chat_1) / 100
  5360.    
  5361.     IniWrite, %taxes%, settings.ini, Einstellungen, Steuersatz
  5362.    
  5363.     SendClientMessage(PREFIX . "Der Steuersatz (Steuerklasse " . SECCOL . taxClass . "{FFFFFF}) wurde auf " . SECCOL . chat_1 . " {FFFFFF}Prozent gesetzt.")
  5364. }
  5365. return
  5366.  
  5367. :?:/gf::
  5368. :?:/gfs::
  5369. {
  5370.     SendChat("/gangfights")
  5371.    
  5372.     result := URLDownloadToVar("https://comniemeer.de/api/gangfights.php")
  5373.    
  5374.     try {
  5375.         data := JSON.Load(result)
  5376.     } catch {
  5377.         SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
  5378.         FormatTime, time, , dd.MM.yyyy HH:mm:ss
  5379.         FileAppend, [%time%] Beim Laden der Gangfightgebiete ist ein Fehler aufgetreten: %result%`n, log.txt
  5380.         return
  5381.     }
  5382.    
  5383.     dialog_header := "Gebiet`tBesitzer`tStatus"
  5384.     dialog := ""
  5385.    
  5386.     for index, entry in data["entries"] {
  5387.         name := entry["name"]
  5388.         owner := entry["owner"]
  5389.         status := (entry["status"] == "frei" ? "{00FF00}" . entry["status"] . "{FFFFFF}" : "{FFFF00}" . entry["status"] . "{FFFFFF}")
  5390.        
  5391.         if (owner == "Yakuza") {
  5392.             owner := "{FFFFFF}Yakuza{FFFFFF}"
  5393.         } else if (owner == "Grove Street") {
  5394.             owner := "{078C09}Grove Street{FFFFFF}"
  5395.         } else if (owner == "Los Chickos Malos") {
  5396.             owner := "{0046FF}Los Chickos Malos{FFFFFF}"
  5397.         } else if (owner == "Triaden") {
  5398.             owner := "{FF8000}Triaden Mafia{FFFFFF}"
  5399.         } else if (owner == "Russenmafia") {
  5400.             owner := "{85847F}Russen Mafia{FFFFFF}"
  5401.         } else if (owner == "San Fierro Rifa") {
  5402.             owner := "{00DCFF}San Fierro Rifa{FFFFFF}"
  5403.         } else if (owner == "Vagos") {
  5404.             owner := "{FFFF00}Los Santos Vagos{FFFFFF}"
  5405.         } else if (owner == "Ballas") {
  5406.             owner := "{9300FF}Ballas{FFFFFF}"
  5407.         }
  5408.        
  5409.         if (entry["running"]) {
  5410.             dialog_header := "Gebiet`tBesitzer`tStatus`tFlaggen"
  5411.            
  5412.             status := "Angreifer: " . getFraktionColorByName(entry["attacker"]) . getFraktionNameShort(entry["attacker"]) . " {FFFFFF}Punktestand: " . getFraktionColorByName(entry["owner"]) . entry["pointsA"] . "{FFFFFF}:" . getFraktionColorByName(entry["attacker"]) . entry["pointsB"] . "`tA: " . getFraktionColorByName(entry["flagA"]) . getFraktionNameShort(entry["flagA"]) . " {FFFFFF}B: " . getFraktionColorByName(entry["flagB"]) . getFraktionNameShort(entry["flagB"]) . " {FFFFFF}C: " . getFraktionColorByName(entry["flagB"]) . getFraktionNameShort(entry["flagC"])
  5413.         }
  5414.        
  5415.         dialog .= "`n{FFFFFF}" . name . "`t" . owner . "`t" . status
  5416.     }
  5417.    
  5418.     ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "Gangfightgebiete", dialog_header . dialog, "OK")
  5419. }
  5420. return
  5421.  
  5422. :?:/hdf::
  5423. :?:/ruhe::
  5424. {
  5425.     SendChat("/l Sein Sie bitte still.")
  5426. }
  5427. return
  5428.  
  5429. :?:/afk::
  5430. {
  5431.     if (afk) {
  5432.         afk := false
  5433.        
  5434.         SendChat("/f Ich bin nun nicht mehr AFK und melde mich zurück!")
  5435.         SendChat("/crew Ich bin nun nicht mehr AFK und melde mich zurück!")
  5436.     } else {
  5437.         afkTime := PlayerInput("Zeit: ")
  5438.        
  5439.         if (afkTime != "") {
  5440.             if afkTime is number
  5441.             {
  5442.                 afk := true
  5443.                
  5444.                 SendChat("/f Ich melde mich AFK, Zeit: " . afkTime . " Minuten")
  5445.                 SendChat("/crew Ich melde mich AFK, Zeit: " . afkTime . " Minuten")
  5446.             } else {
  5447.                 SendClientMessage(PREFIX . "{FF0000}Du musst eine Zeit angeben!")
  5448.             }
  5449.         }
  5450.     }
  5451. }
  5452. return
  5453.  
  5454. :?:/time::
  5455. {
  5456.     SendChat("/time")
  5457.    
  5458.     Sleep, 100
  5459.    
  5460.     adrGTA2 := getModuleBaseAddress("gta_sa.exe", hGTA)
  5461.     cText := readString(hGTA, adrGTA2 + 0x7AAD43, 512)
  5462.    
  5463.     if (RegExMatch(cText, "(.+)In Behandlung: (\d+)", cText_)) {
  5464.         time := formatTime(cText_2)
  5465.        
  5466.         writeString(hGTA, adrGTA2 + 0x7AAD43, cText_1 . "Noch " . time . " im KH")
  5467.         SendClientMessage(PREFIX . "Du bist noch " . SECCOL . time . " {FFFFFF}im Krankenhaus.")
  5468.     } else if (RegExMatch(cText, "(.+)Knastzeit: (\d+)", cText_)) {
  5469.         time := formatTime(cText_2)
  5470.        
  5471.         if (getPlayerInteriorId() == 1) {
  5472.             writeString(hGTA, adrGTA2 + 0x7AAD43, cText_1 . "Noch " . time . " im Prison")
  5473.             SendClientMessage(PREFIX . "Du bist noch " . SECCOL . time . " {FFFFFF}im Prison.")
  5474.         } else {
  5475.             writeString(hGTA, adrGTA2 + 0x7AAD43, cText_1 . "Noch " . time . " im Knast")
  5476.             SendClientMessage(PREFIX . "Du bist noch " . SECCOL . time . " {FFFFFF}im Knast, die Kaution beträgt " . SECCOL . FormatNumber(Floor(cText_2 / 60) * 500) . "${FFFFFF}.")
  5477.         }
  5478.     }
  5479. }
  5480. return
  5481.  
  5482. :?:/anwalt::
  5483. {
  5484.     SendChat("/time")
  5485.    
  5486.     Sleep, 100
  5487.    
  5488.     adrGTA2 := getModuleBaseAddress("gta_sa.exe", hGTA)
  5489.     cText := readString(hGTA, adrGTA2 + 0x7AAD43, 512)
  5490.    
  5491.     if (RegExMatch(cText, "(.+)Knastzeit: (\d+)", cText_)) {
  5492.         if (getPlayerInteriorId() != 1) {
  5493.             time := formatTime(cText_2)
  5494.             min := Floor(cText_2 / 60)
  5495.            
  5496.             writeString(hGTA, adrGTA2 + 0x7AAD43, cText_1 . "Noch " . time . " im Knast")
  5497.             SendClientMessage(PREFIX . "Du bist noch " . SECCOL . time . " {FFFFFF}im Knast, die Kaution beträgt " . SECCOL . FormatNumber(min * 500) . "${FFFFFF}.")
  5498.             SendClientMessage(PREFIX . "Möchtest du nun einen Anwalt rufen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
  5499.            
  5500.             KeyWait, X, D, T10
  5501.            
  5502.             if (!ErrorLevel) {
  5503.                 if (getPlayerInteriorId() == 6) {
  5504.                     SendChat("/ad Anwalt LSPD! Kaution: " . FormatNumber(min * 500) . "$, /call")
  5505.                 } else if (getPlayerInteriorId() == 10) {
  5506.                     SendChat("/ad Anwalt FBI! Kaution: " . FormatNumber(min * 500) . "$, /call")
  5507.                 } else if (getPlayerInteriorId() == 3) {
  5508.                     SendChat("/ad Anwalt LVPD! Kaution: " . FormatNumber(min * 500) . "$, /call")
  5509.                 }
  5510.             }
  5511.         } else {
  5512.             SendClientMessage(PREFIX . "Du bist im Prison, somit kannst du leider keinen Anwalt rufen.")
  5513.         }
  5514.     }
  5515. }
  5516. return
  5517.  
  5518. :?:/alotto::
  5519. {
  5520.     if (lottoNumber == 0) {
  5521.         Random, randomNumber, 1, 200
  5522.        
  5523.         SendChat("/lotto " . randomNumber)
  5524.     } else if (lottoNumber == 201) {
  5525.         SendChat("/lotto " . getId())
  5526.     } else {
  5527.         SendChat("/lotto " . lottoNumber)
  5528.     }
  5529. }
  5530. return
  5531.  
  5532. :?:/re::
  5533. :?:/resms::
  5534. {
  5535.     distanceSMS := 0
  5536.    
  5537.     Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  5538.     {
  5539.         if (RegExMatch(A_LoopReadLine, "SMS: (.+), Sender: (\S+) \((\d+)\)", preSMS_)) {
  5540.             if (preSMS_2 != getUsername()) {
  5541.                 RegExMatch(A_LoopReadLine, "SMS: (.+), Sender: (\S+) \((\d+)\)", sms_)
  5542.             }
  5543.         } else if (RegExMatch(A_LoopReadLine, "SMS: (.+)\.\.\.", preSMS_1_)) {
  5544.             distanceSMS := 0
  5545.            
  5546.             RegExMatch(A_LoopReadLine, "SMS: (.+)\.\.\.", sms_)
  5547.         } else if (RegExMatch(A_LoopReadLine, "\.\.\.(.*), Sender: (\S+) \((\d+)\)", preSMS_2_)) {
  5548.             if (distanceSMS == 2) {
  5549.                 if (preSMS_2_2 != getUsername()) {
  5550.                     sms_2 := preSMS_2_2
  5551.                     sms_3 := preSMS_2_3
  5552.                 }
  5553.             }
  5554.         }
  5555.        
  5556.         distanceSMS++
  5557.     }
  5558.    
  5559.     if (sms_2 != "") {
  5560.         SendClientMessage(PREFIX . "Letzte SMS (von " . SECCOL . sms_2 . "{FFFFFF}):")
  5561.         SendClientMessage(PREFIX . SECCOL . sms_1)
  5562.        
  5563.         SendInput, /sms %sms_3%{space}
  5564.     } else {
  5565.         SendClientMessage(PREFIX . "Keiner hat dich angeschrieben!")
  5566.     }
  5567. }
  5568. return
  5569.  
  5570. :?:/readv::
  5571. {
  5572.     Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  5573.     {
  5574.         if (RegExMatch(A_LoopReadLine, "\[Werbung\] (.+), (\S+) \((\d+)\)")) {
  5575.             RegExMatch(A_LoopReadLine, "\[Werbung\] (.+), (\S+) \((\d+)\)", ad_)
  5576.         }
  5577.     }
  5578.    
  5579.     if (ad_2 != "") {
  5580.         SendClientMessage(PREFIX . "Letzte Werbung (von " . ad_2 . "):")
  5581.         SendClientMessage(PREFIX . ad_1)
  5582.        
  5583.         SendInput, /sms %ad_3%{space}
  5584.     } else {
  5585.         SendClientMessage(PREFIX . "Keine letzte Werbung gefunden!")
  5586.     }
  5587. }
  5588. return
  5589.  
  5590. :?:/fan::
  5591. {
  5592.     name := PlayerInput("Fan: ")
  5593.     name := getFullName(name)
  5594.    
  5595.     if (name != "") {
  5596.         SendChat("/me gibt " . name . " ein Autogramm.")
  5597.     }
  5598. }
  5599. return
  5600.  
  5601. :?:/pb::
  5602. :?:/paintball::
  5603. {
  5604.     SendChat("/paintball")
  5605.    
  5606.     Sleep, 200
  5607.    
  5608.     players := 0
  5609.    
  5610.     Loop, 100 {
  5611.         chat := readChatLine(players)
  5612.        
  5613.         if (InStr(chat, "Punkte")) {
  5614.             players++
  5615.         } else {
  5616.             SendClientMessage(PREFIX . "Spieler im Paintball: " . SECCOL . players)
  5617.             return
  5618.         }
  5619.     }
  5620. }
  5621. return
  5622.  
  5623. :?:/savestats::
  5624. {
  5625.     FormatTime, time,, dd.MM.yyyy HH:mm
  5626.    
  5627.     SendClientMessage(PREFIX . "Statistiken werden gespeichert! Datum: " . SECCOL . time)
  5628.    
  5629.     SendChat("/time")
  5630.     SendChat("/stats")
  5631.    
  5632.     Sleep, 250
  5633.    
  5634.     SendInput, {F8}
  5635.     Sleep, 250
  5636.     SendInput, {ESC}
  5637. }
  5638. return
  5639.  
  5640. :?:/ja::
  5641. :?:/jas::
  5642. :?:/jam::
  5643. {
  5644.     SendChat("Ja, was kann ich für dich tun?")
  5645. }
  5646. return
  5647.  
  5648. :?:/kcall::
  5649. {
  5650.     name := PlayerInput("Name: ")
  5651.    
  5652.     if (name != "") {
  5653.         SendChat("/number " . name)
  5654.        
  5655.         Sleep, 200
  5656.        
  5657.         chat := readChatLine(0)
  5658.        
  5659.         if (RegExMatch(chat, "Name: (\S*), Ph: (\d*)", number_)) {
  5660.             SendChat("/call " . number_2)
  5661.         } else {
  5662.             SendClientMessage(PREFIX . "Anruf fehlgeschlagen!")
  5663.         }
  5664.     }
  5665. }
  5666. return
  5667.  
  5668. :?:/ksms::
  5669. {
  5670.     name := PlayerInput("Name: ")
  5671.    
  5672.     if (name != "") {
  5673.         SendChat("/number " . name)
  5674.        
  5675.         Sleep, 200
  5676.        
  5677.         chat := readChatLine(0)
  5678.        
  5679.         if (RegExMatch(chat, "Name: (\S*), Ph: (\d*)", number_)) {
  5680.             SendInput, t/sms %number_2%{space}
  5681.         } else {
  5682.             SendClientMessage(PREFIX . "Senden der SMS fehlgeschlagen!")
  5683.         }
  5684.     }
  5685. }
  5686. return
  5687.  
  5688. :?:/p::
  5689. {
  5690.     called := false
  5691.    
  5692.     Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  5693.     {
  5694.         if (RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)")) {
  5695.             RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)", caller_)
  5696.             called := true
  5697.         } else if (RegExMatch(A_LoopReadLine, "Der Gesprächspartner hat aufgelegt\.") || RegExMatch(A_LoopReadLine, "Du hast aufgelegt\.") || RegExMatch(A_LoopReadLine, "Die Verbindung zu deinem Gesprächspartner wurde unterbrochen\.")) {
  5698.             called := false
  5699.         }
  5700.     }
  5701.    
  5702.     if (called && caller_1 != "") {
  5703.         name := getUsername()
  5704.        
  5705.         FormatTime, time,, HH
  5706.        
  5707.         SendChat("/pickup")
  5708.        
  5709.         if (time >= 12 && time < 18) {
  5710.             SendChat("Guten Tag " . caller_1 . ", du sprichst mit " . name . ".")
  5711.         } else if (time >= 18 || time == 0) {
  5712.             SendChat("Guten Abend " . caller_1 . ", du sprichst mit " . name . ".")
  5713.         } else if (time >= 1 && time < 12) {
  5714.             SendChat("Guten Morgen " . caller_1 . ", du sprichst mit " . name . ".")
  5715.         }
  5716.        
  5717.         SendChat("Wie kann ich dir helfen?")
  5718.     } else {
  5719.         SendClientMessage(PREFIX . "Niemand hat dich angerufen!")
  5720.     }
  5721. }
  5722. return
  5723.  
  5724. :?:/h::
  5725. {
  5726.     called := false
  5727.     pickedup := false
  5728.    
  5729.     Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  5730.     {
  5731.         if (RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)") || RegExMatch(A_LoopReadLine, "Der Spieler hat abgehoben\.")) {
  5732.             RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)", caller_)
  5733.             called := true
  5734.             pickedup := true
  5735.         } else if (RegExMatch(A_LoopReadLine, "Bitte Warte bis der Spieler annimmt\.")) {
  5736.             called := true
  5737.             pickedup := false
  5738.         } else if (RegExMatch(A_LoopReadLine, "Der Gesprächspartner hat aufgelegt\.") || RegExMatch(A_LoopReadLine, "Du hast aufgelegt\.") || RegExMatch(A_LoopReadLine, "Die Verbindung zu deinem Gesprächspartner wurde unterbrochen\.")) {
  5739.             called := false
  5740.             pickedup := false
  5741.         }
  5742.     }
  5743.    
  5744.     if (called) {
  5745.         if (pickedup) {
  5746.             if (caller_1 != "") {
  5747.                 SendChat("Vielen Dank für deinen Anruf, " . caller_1 . ".")
  5748.             } else {
  5749.                 SendChat("Vielen Dank für deinen Anruf.")
  5750.             }
  5751.            
  5752.             FormatTime, time,, HH
  5753.            
  5754.             if (time >= 12 && time < 18) {
  5755.                 SendChat("Ich wünsche dir noch einen schönen Tag.")
  5756.             } else if (time >= 18 || time == 0) {
  5757.                 SendChat("Ich wünsche dir noch einen schönen Abend.")
  5758.             } else if (time >= 1 && time < 12) {
  5759.                 SendChat("Ich wünsche dir noch einen schönen Morgen.")
  5760.             }
  5761.         }
  5762.        
  5763.         SendChat("/hangup")
  5764.     } else {
  5765.         SendClientMessage(PREFIX . "Niemand hat dich angerufen!")
  5766.     }
  5767. }
  5768. return
  5769.  
  5770. :?:/ab::
  5771. {
  5772.     called := false
  5773.    
  5774.     Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  5775.     {
  5776.         if (RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)")) {
  5777.             RegExMatch(A_LoopReadLine, "Dein Handy klingelt. Tippe /pickup. Anrufer-ID: (\S+)", caller_)
  5778.             called := true
  5779.         } else if (RegExMatch(A_LoopReadLine, "Der Gesprächspartner hat aufgelegt\.") || RegExMatch(A_LoopReadLine, "Du hast aufgelegt\.") || RegExMatch(A_LoopReadLine, "Die Verbindung zu deinem Gesprächspartner wurde unterbrochen\.")) {
  5780.             called := false
  5781.         }
  5782.     }
  5783.    
  5784.     if (called) {
  5785.         FormatTime, time,, HH
  5786.        
  5787.         SendChat("/pickup")
  5788.        
  5789.         if (time >= 12 && time < 18) {
  5790.             SendChat("Guten Tag " . caller_1 . ",")
  5791.         } else if (time >= 18 || time == 0) {
  5792.             SendChat("Guten Abend " . caller_1 . ",")
  5793.         } else if (time >= 1 && time < 12) {
  5794.             SendChat("Guten Morgen " . caller_1 . ",")
  5795.         }
  5796.        
  5797.         SendChat("Sie sind verbunden mit dem Anrufbeantworter von " . getUsername() . ":")
  5798.         SendChat("Ich bin leider beschäftigt, bitte rufe mich später erneut an!")
  5799.         SendChat("/hangup")
  5800.     } else {
  5801.         SendClientMessage(PREFIX . "Niemand hat dich angerufen!")
  5802.     }
  5803. }
  5804. return
  5805.  
  5806. :?:/tag::
  5807. {
  5808.     FormatTime, time,, HH
  5809.    
  5810.     if (time >= 12 && time < 20) {
  5811.         SendChat("Guten Tag, wie kann ich dir helfen?")
  5812.     } else if (time >= 20 || time == 0) {
  5813.         SendChat("Guten Abend, wie kann ich dir helfen?")
  5814.     } else if (time >= 1 && time < 12) {
  5815.         SendChat("Guten Morgen, wie kann ich dir helfen?")
  5816.     }
  5817. }
  5818. return
  5819.  
  5820. :?:/bye::
  5821. {
  5822.     FormatTime, time,, HH
  5823.    
  5824.     if (time >= 12 && time < 20) {
  5825.         SendChat("Ich wünsche dir noch einen schönen Tag. Auf Wiedersehen!")
  5826.     } else if (time >= 20 || time == 0) {
  5827.         SendChat("Ich wünsche dir noch einen schönen Abend. Auf Wiedersehen!")
  5828.     } else if (time >= 1 && time < 12) {
  5829.         SendChat("Ich wünsche dir noch einen schönen Tag. Auf Wiedersehen!")
  5830.     }
  5831. }
  5832. return
  5833.  
  5834. :?:/fg::
  5835. {
  5836.     blockDialog()
  5837.     SendChat("/stats")
  5838.     Sleep, 200
  5839.     unBlockDialog()
  5840.    
  5841.     if (RegExMatch(getDialogText(), statsFormat, dialog_)) {
  5842.         deposit := dialog_14
  5843.         account := dialog_13
  5844.        
  5845.         if (deposit == 0) {
  5846.             if (getPlayerInteriorId() == 20) {
  5847.                 if (IsPlayerInRangeOfPoint(1429.6781, -997.2040, 1639.7843, 5)) {
  5848.                     if (account >= 1250000) {
  5849.                         SendChat("/festgeld 1250000")
  5850.                     } else if (account >= 50000 && account < 1250000) {
  5851.                         SendClientMessage(PREFIX . "Du hast aktuell nur " . SECCOL . formatNumber(account) . "$ {FFFFFF}auf dem Konto.")
  5852.                         SendClientMessage(PREFIX . "Möchtest du diesen Betrag als Festgeld anlegen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
  5853.                        
  5854.                         KeyWait, X, D, T10
  5855.                        
  5856.                         if (!ErrorLevel) {
  5857.                             SendChat("/festgeld " . account)
  5858.                         }
  5859.                     } else {
  5860.                         SendClientMessage(PREFIX . "Du hast nicht genügend Geld auf deinem Konto, um Festgeld anzulegen.")
  5861.                     }
  5862.                 } else {
  5863.                     SendClientMessage(PREFIX . "Du befindest dich nicht am Bankschalter.")
  5864.                 }
  5865.             } else {
  5866.                 SendClientMessage(PREFIX . "Du hast derzeit kein Festgeld angelegt.")
  5867.                 SendClientMessage(PREFIX . "Begebe dich in die Bank, um Festgeld anzulegen.")
  5868.             }
  5869.         } else {
  5870.             if (getPlayerInteriorId() == 20) {
  5871.                 if (IsPlayerInRangeOfPoint(1429.6781, -997.2040, 1639.7843, 5)) {
  5872.                     SendClientMessage(PREFIX . "Du hast bereits " . SECCOL . formatNumber(deposit) . "$ {FFFFFF}Festgeld angelegt. Möchtest du es abbrechen? Drücke " . SECCOL . "X {FFFFFF}zum Bestätigen.")
  5873.                    
  5874.                     KeyWait, X, D, T10
  5875.                    
  5876.                     if (!ErrorLevel) {
  5877.                         SendChat("/cancelfestgeld")
  5878.                     }
  5879.                 } else {
  5880.                     if (account >= 1) {
  5881.                         SendChat("/festgeld 1")
  5882.                     } else {
  5883.                         SendClientMessage(PREFIX . "Du hast aktuell " . SECCOL . formatNumber(deposit) . "$ {FFFFFF}Festgeld angelegt. Um zu sehen, wie lange es noch dauert, brauchst du mind. 1$ auf deinem Konto.")
  5884.                     }
  5885.                 }
  5886.             } else {
  5887.                 if (account >= 1) {
  5888.                     SendChat("/festgeld 1")
  5889.                 } else {
  5890.                     SendClientMessage(PREFIX . "Du hast aktuell " . SECCOL . formatNumber(deposit) . "$ {FFFFFF}Festgeld angelegt. Um zu sehen, wie lange es noch dauert, brauchst du mind. 1$ auf deinem Konto.")
  5891.                 }
  5892.             }
  5893.         }
  5894.     }
  5895. }
  5896. return
  5897.  
  5898. :?:/ap::
  5899. {
  5900.     SendChat("/accept paket")
  5901. }
  5902. return
  5903.  
  5904. :?:/tanken::
  5905. {
  5906.     if (isPlayerInAnyVehicle()) {
  5907.         if (getVehicleEngineState()) {
  5908.             SendChat("/motor")
  5909.         }
  5910.        
  5911.         SendChat("/fill")
  5912.         Sleep, 10000
  5913.         SendChat("/motor")
  5914.         SendChat("/licht")
  5915.        
  5916.         if (autoBuyCanister) {
  5917.             SendClientMessage(PREFIX . "Möchtest du noch einen Kanister kaufen? Steig aus dem Fahrzeug aus und drücke " . SECCOL . "X{FFFFFF}!")
  5918.            
  5919.             KeyWait, X, D, T10
  5920.            
  5921.             if (!ErrorLevel) {
  5922.                 SendChat("/kanister")
  5923.             }
  5924.         }
  5925.     } else {
  5926.         SendClientMessage(PREFIX . "Du bist in keinem Fahrzeug!")
  5927.     }
  5928. }
  5929. return
  5930.  
  5931. :?:/minuten::
  5932. {
  5933.     seconds := PlayerInput("Sekunden: ")
  5934.    
  5935.     if (seconds != "") {
  5936.         minutes := Floor(seconds / 60)
  5937.        
  5938.         SendClientMessage(PREFIX . SECCOL . FormatNumber(seconds) . " {FFFFFF}Sekunden sind " . SECCOL . FormatNumber(minutes) " {FFFFFF}Minuten.")
  5939.     }
  5940. }
  5941. return
  5942.  
  5943. :?:/link::
  5944. {
  5945.     Loop, Read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  5946.     {
  5947.         if (RegExMatch(A_LoopReadLine, "(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})(\S*)")) {
  5948.             RegExMatch(A_LoopReadLine, "(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})(\S*)", url_)
  5949.         }
  5950.        
  5951.         if (RegExMatch(A_LoopReadLine, "http:\/\/(\S+)")) {
  5952.             RegExMatch(A_LoopReadLine, "http\:\/\/(\S+)", url_)
  5953.            
  5954.             url := "http://" . url_1
  5955.         } else if (RegExMatch(A_LoopReadLine, "https:\/\/(\S+)")) {
  5956.             RegExMatch(A_LoopReadLine, "https\:\/\/(\S+)", url_)
  5957.            
  5958.             url := "https://" . url_1
  5959.         } else if (RegExMatch(A_LoopReadLine, "www.(\S+)")) {
  5960.             RegExMatch(A_LoopReadLine, "www.(\S+)", url_)
  5961.            
  5962.             url := "www." . url_1
  5963.         }
  5964.     }
  5965.    
  5966.     clipboard := url
  5967.    
  5968.     SendClientMessage(PREFIX . "Der folgende Link wurde in die Zwischenablage kopiert:")
  5969.     SendClientMessage(PREFIX . SECCOL . url)
  5970. }
  5971. return
  5972.  
  5973. :?:/savechat::
  5974. {
  5975.     FileCreateDir, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups
  5976.     FormatTime, zeit, %A_Now%,dd.MM.yy - HH.mm
  5977.     FileCopy, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt, %A_MyDocuments%\GTA San Andreas User Files\SAMP\ChatlogBackups\chatlog %zeit% Uhr.txt, 0
  5978.    
  5979.     SendClientMessage(PREFIX . "Es wurde ein Backup des aktuellen Chatlogs erstellt!")
  5980. }
  5981. return
  5982.  
  5983. :?:/cc::
  5984. :?:/chatclear::
  5985. {
  5986.     Loop, 100 {
  5987.         AddChatMessage("")
  5988.     }
  5989.    
  5990.     SendClientMessage(PREFIX . "Der Chat wurde erfolgreich geleert!")
  5991. }
  5992. return
  5993.  
  5994. :?:/sani::
  5995. {
  5996.     zone := getPlayerZone()
  5997.    
  5998.     SendChat("/service")
  5999.     Sleep, 250
  6000.     SendInput, {enter}
  6001.    
  6002.     if (!admin)
  6003.         Sleep, 250
  6004.    
  6005.     SendChat("/f Ich habe einen Sanitäter in " . zone . " gerufen!")
  6006.     SendChat("/crew Ich habe einen Sanitäter in " . zone . " gerufen!")
  6007. }
  6008. return
  6009.  
  6010. :?:/gk::
  6011. {
  6012.     id := PlayerInput("Gebäudekomplex: ")
  6013.    
  6014.     if (id == "")
  6015.         return
  6016.    
  6017.     if (RegExMatch(id, "^(\d+)\.(\d+)$")) {
  6018.         gk(id)
  6019.     }
  6020. }
  6021. return
  6022.  
  6023. gk(id, showGK := false) {
  6024.     result := URLDownloadToVar(gkBaseURL . "api/newgk.php?gk=" . id)
  6025.    
  6026.     if (result == "ERROR_CONNECTION") {
  6027.         SendClientMessage(PREFIX . "{FF0000}Fehler bei der Verbindung zum Server!")
  6028.     } else if (result == "ERROR_BAD_LINK") {
  6029.         SendClientMessage(PREFIX . "{FF0000}Fehlerhafte Parameterübergabe!")
  6030.     } else if (result == "ERROR_ACCESS_DENIED") {
  6031.         SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert, das Passwort ist falsch!")
  6032.     } else if (result == "ERROR_WRONG_FORMAT") {
  6033.         SendClientMessage(PREFIX . "{FF0000}Fehlerhaftes Format!")
  6034.     } else if (result == "ERROR_NOT_FOUND") {
  6035.         SendClientMessage(PREFIX . "{FF0000}Der Komplex wurde nicht in der Datenbank gefunden!")
  6036.     } else {
  6037.         SendClientMessage(PREFIX . "Gebäudekomplex {FF0000}" . id . "{FFFFFF}:")
  6038.        
  6039.         try {
  6040.             data := JSON.Load(result)
  6041.         } catch {
  6042.             SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
  6043.             FormatTime, time, , dd.MM.yyyy HH:mm:ss
  6044.             FileAppend, [%time%] Beim Laden des GK ist ein Fehler aufgetreten: %result%`n, log.txt
  6045.             return
  6046.         }
  6047.        
  6048.         for index, entry in data {
  6049.             name := entry["name"]
  6050.             location := ""
  6051.            
  6052.             if (entry["type"] == "public") {
  6053.                 color := "{00FF00}"
  6054.                 location := " (" . calculateZone(entry["x"], entry["y"], 0.0) . ", " . calculateCity(entry["x"], entry["y"], 0.0) . ")"
  6055.             } else if (entry["type"] == "house") {
  6056.                 color := "{00FFFF}"
  6057.                
  6058.                 if (name == "Nobody") {
  6059.                     name := "Haus (frei)"
  6060.                 } else if (name == "Auktion im CP") {
  6061.                     name := "Haus (" . name . ")"
  6062.                 } else {
  6063.                     name := "Haus von " . name
  6064.                 }
  6065.                
  6066.                 location := " (" . calculateZone(entry["x"], entry["y"], 0.0) . ", " . calculateCity(entry["x"], entry["y"], 0.0) . ")"
  6067.             } else if (entry["type"] == "faction") {
  6068.                 color := "{7F00FF}"
  6069.                 location := " (" . calculateZone(entry["x"], entry["y"], 0.0) . ", " . calculateCity(entry["x"], entry["y"], 0.0) . ")"
  6070.             } else if (entry["type"] == "vehicle") {
  6071.                 color := "{FF00FF}"
  6072.             }
  6073.            
  6074.             if (entry["x"] == -5000 || entry["y"] == -5000) {
  6075.                 location := ""
  6076.             }
  6077.            
  6078.             SendClientMessage(PREFIX . SECCOL . "[GK] " . color . "[ID: " . entry["type"] . "." . entry["id"] . "] " . name . location)
  6079.         }
  6080.     }
  6081. }
  6082.  
  6083. :?:/showgk::
  6084. {
  6085.     id := PlayerInput("Gebäudekomplex-ID: ")
  6086.    
  6087.     showGK(id)
  6088. }
  6089. return
  6090.  
  6091. showGK(gk, ignoreExisting := false) {
  6092.     if (RegExMatch(gk, "^(public|house|faction)\.(\d+)$", regex_)) {
  6093.         result := UrlDownloadToVar(gkBaseURL . "api/newgk.php?id=" . gk)
  6094.        
  6095.         if (result == "ERROR_CONNECTION") {
  6096.             SendClientMessage(PREFIX . "{FF0000}Fehler bei der Verbindung zum Server!")
  6097.         } else if (result == "ERROR_BAD_LINK") {
  6098.             SendClientMessage(PREFIX . "{FF0000}Fehlerhafte Parameterübergabe!")
  6099.         } else if (result == "ERROR_ACCESS_DENIED") {
  6100.             SendClientMessage(PREFIX . "{FF0000}Zugriff verweigert, das Passwort ist falsch!")
  6101.         } else if (result == "ERROR_WRONG_FORMAT") {
  6102.             SendClientMessage(PREFIX . "{FF0000}Fehlerhaftes Format!")
  6103.         } else if (result == "ERROR_NOT_FOUND") {
  6104.             SendClientMessage(PREFIX . "{FF0000}Der Komplex wurde nicht in der Datenbank gefunden!")
  6105.         } else {
  6106.             try {
  6107.                 data := JSON.Load(result)
  6108.             } catch {
  6109.                 SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
  6110.                 FormatTime, time, , dd.MM.yyyy HH:mm:ss
  6111.                 FileAppend, [%time%] Beim Laden des showGK ist ein Fehler aufgetreten: %result%`n, log.txt
  6112.                 return
  6113.             }
  6114.            
  6115.             if (IsMarkerCreated() && !ignoreExisting) {
  6116.                 SendClientMessage(PREFIX . "Es ist bereits ein Checkpoint gesetzt, wenn du diesen überschreiben willst, drücke " . SECCOL . "X{FFFFFF}!")
  6117.                
  6118.                 KeyWait, X, D, T10
  6119.                
  6120.                 if (ErrorLevel) {
  6121.                     return
  6122.                 }
  6123.             }
  6124.            
  6125.             zPos := data["z"]
  6126.            
  6127.             if (zPos == -1)
  6128.                 zPos := 20
  6129.            
  6130.             if (setCheckpoint(data["x"], data["y"], zPos, 5)) {
  6131.                 SendClientMessage(PREFIX . "Der Checkpoint zum GK mit der ID " . SECCOL . gk . " {FFFFFF}wurde erfolgreich gesetzt!")
  6132.             } else {
  6133.                 SendClientMessage(PREFIX . "Beim Setzen des Checkpoints ist ein Fehler aufgetreten!")
  6134.             }
  6135.         }
  6136.     } else {
  6137.         SendClientMessage(PREFIX . SECCOL . "[GK] {FF0000}Fehler: Die ID wurde falsch formatiert. " . SECCOL . "Beispiel: public.12")
  6138.     }
  6139. }
  6140.  
  6141. :?:/checkpoint::
  6142. {
  6143.     x := PlayerInput("x: ")
  6144.     y := PlayerInput("y: ")
  6145.     z := PlayerInput("z: ")
  6146.    
  6147.     if (x != "" && y != "" && z != "") {
  6148.         if (IsMarkerCreated()) {
  6149.             SendClientMessage(PREFIX . "Es ist bereits ein Checkpoint gesetzt, wenn du diesen überschreiben willst, drücke " . SECCOL . "X{FFFFFF}!")
  6150.            
  6151.             KeyWait, X, D, T10
  6152.            
  6153.             if (ErrorLevel) {
  6154.                 return
  6155.             }
  6156.         }
  6157.        
  6158.         if (setCheckpoint(x, y, z, 0.5)) {
  6159.             SendClientMessage(PREFIX . "ERFOLG!")
  6160.         } else {
  6161.             SendClientMessage(PREFIX . "FEHLER!")
  6162.         }
  6163.     }
  6164. }
  6165. return
  6166.  
  6167. :?:/sanis::
  6168. {
  6169.     result := UrlDownloadToVar("https://comniemeer.de/api/fractionmembers.php?id=4")
  6170.    
  6171.     sanis := "Name`tRang`tID"
  6172.    
  6173.     Loop, Parse, result, ~
  6174.     {
  6175.         if (RegExMatch(A_LoopField, "(\S+),(\d+)", member_)) {
  6176.             id := getPlayerIdByName(member_1, true)
  6177.            
  6178.             if (id != -1) {
  6179.                 sanis .= "`n{00FF00}" . member_1 . "`t{FF8000}" . member_2 . "`t" . id
  6180.             } else {
  6181.                 sanis .= "`n{FF0000}" . member_1 . "`t{FF8000}" . member_2 . "`t-"
  6182.             }
  6183.         }
  6184.     }
  6185.    
  6186.     ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "LSMD Mitgliederliste", sanis, "OK")
  6187. }
  6188. return
  6189.  
  6190. :?:/onsanis::
  6191. {
  6192.     result := UrlDownloadToVar("https://comniemeer.de/api/fractionmembers.php?id=4")
  6193.    
  6194.     SendClientMessage(PREFIX . "Es werden nur Mitglieder des LSMD angezeigt, die online sind.")
  6195.    
  6196.     Loop, Parse, result, ~
  6197.     {
  6198.         RegExMatch(A_LoopField, "(\S+),(\d+)", member)
  6199.        
  6200.         id := getPlayerIdByName(member1, true)
  6201.        
  6202.         if (member1 != "") {
  6203.             if (id != -1) {
  6204.                 SendClientMessage(PREFIX . member1 . " " . SECCOL . "[ID: " . id "] {FFFFFF}Rang: " . SECCOL . member2)
  6205.             }
  6206.         }
  6207.     }
  6208. }
  6209. return
  6210.  
  6211. :?:/coords::
  6212. {
  6213.     GetPlayerPos(posX, posY, posZ)
  6214.    
  6215.     SendClientMessage(PREFIX . "x: " . SECCOL . posX . " {FFFFFF}y: " . SECCOL . posY . " {FFFFFF}z: " . SECCOL . posZ)
  6216. }
  6217. return
  6218.  
  6219. :?:/fpslock::
  6220. {
  6221.     if (fpsLock()) {
  6222.         SendClientMessage(PREFIX . "Deine FPS wurden wieder beschränkt.")
  6223.     } else {
  6224.         SendClientMessage(PREFIX . "Beim Beschränken deiner FPS ist ein Fehler aufgetreten.")
  6225.     }
  6226. }
  6227. return
  6228.  
  6229. :?:/fpsunlock::
  6230. {
  6231.     if (fpsUnlock()) {
  6232.         SendClientMessage(PREFIX . "Die Beschränkung deiner FPS wurde aufgehoben.")
  6233.     } else {
  6234.         SendClientMessage(PREFIX . "Beim Aufheben der Beschränkung deiner FPS ist ein Fehler aufgetreten.")
  6235.     }
  6236. }
  6237. return
  6238.  
  6239. :?:/relog::
  6240. {
  6241.     SendClientMessage(PREFIX . "Du verbindest nun neu...")
  6242.     restart()
  6243. }
  6244. return
  6245.  
  6246. ; ------------- ;
  6247. ; Gegner-System ;
  6248. ; ------------- ;
  6249. SearchEnemyTimer:
  6250. {
  6251.     IfWinNotActive, GTA:SA:MP
  6252.         return
  6253.    
  6254.     players := getStreamedInPlayersInfo()
  6255.    
  6256.     for i, o in players {
  6257.         updatePlayerFraction(o.ID)
  6258.     }
  6259.    
  6260.     if (enemyJoinLeaveMessage) {
  6261.         if (!SQLiteDB.Query("SELECT name, fraction FROM enemies WHERE fraction != '0' ORDER BY fraction ASC, name ASC;", recordSet)) {
  6262.             FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
  6263.             return
  6264.         }
  6265.        
  6266.         if (recordSet.HasRows) {
  6267.             while (recordSet.Next(row) >= 1) {
  6268.                 enemyName := row[1]
  6269.                 enemyFraction := row[2]
  6270.                
  6271.                 showEnemyMessage(enemyName, enemyFraction)
  6272.             }
  6273.         }
  6274.        
  6275.         recordSet.Free()
  6276.        
  6277.         for index, entry in lspdData {
  6278.             showEnemyMessage(entry, 1)
  6279.         }
  6280.        
  6281.         for index, entry in fbiData {
  6282.             showEnemyMessage(entry, 2)
  6283.         }
  6284.        
  6285.         if (firstEnemiesTimerRun) {
  6286.             firstEnemiesTimerRun := false
  6287.         }
  6288.     }
  6289. }
  6290. return
  6291.  
  6292. showEnemyMessage(name, fraction) {
  6293.     global debug
  6294.    
  6295.     playerID := getPlayerIdByName(name, true)
  6296.    
  6297.     if (ErrorLevel || playerID == -2) {
  6298.         if (debug) {
  6299.             SendClientMessage(PREFIX . "Fehler beim Auslesen der ID von " . name . " (" . playerID . "): " . ErrorLevel)
  6300.         }
  6301.        
  6302.         return
  6303.     }
  6304.    
  6305.     if (playerID != -1) {
  6306.         if (!onlineEnemies.HasKey(name)) {
  6307.             onlineEnemies[name] := fraction
  6308.            
  6309.             if (!firstEnemiesTimerRun) {
  6310.                 SendClientMessage(PREFIX . SECCOL . name . " {FFFFFF}aus der Fraktion " . SECCOL . getFraktionByID(fraction) . " {FFFFFF}ist {00FF00}online {FFFFFF}gekommen.")
  6311.             }
  6312.            
  6313.         }
  6314.     } else {
  6315.         if (onlineEnemies.HasKey(name)) {
  6316.             onlineEnemies.Delete(name)
  6317.            
  6318.             if (!firstEnemiesTimerRun) {
  6319.                 SendClientMessage(PREFIX . SECCOL . name . " {FFFFFF}aus der Fraktion " . SECCOL . getFraktionByID(fraction) . " {FFFFFF}ist {FF0000}offline {FFFFFF}gegangen.")
  6320.             }
  6321.         }
  6322.     }
  6323. }
  6324.  
  6325. RefreshCops:
  6326. {
  6327.     lspdResult := UrlDownloadToVar("https://lspd.comniemeer.de/api/members")
  6328.     fbiResult := UrlDownloadToVar("https://fbi.comniemeer.de/api/members")
  6329.    
  6330.     try {
  6331.         lspdData := JSON.Load(lspdResult)
  6332.         fbiData := JSON.Load(fbiResult)
  6333.     } catch {
  6334.         FormatTime, time, , dd.MM.yyyy HH:mm:ss
  6335.         FileAppend, [%time%] Beim Laden der Cops ist ein Fehler aufgetreten:`nLSPD: %lspdResult%`nFBI: %fbiResult%`n, log.txt
  6336.         return
  6337.     }
  6338. }
  6339. return
  6340.  
  6341. ~RButton::
  6342. {
  6343.     while GetKeyState("RButton", "P")
  6344.     {
  6345.         playerPed := getTargetPed()
  6346.         playerID := getIdByPed(playerPed)
  6347.        
  6348.         if (updatePlayerFraction(playerID)) {
  6349.             Sleep, 1500
  6350.         }
  6351.     }
  6352. }
  6353. return
  6354.  
  6355. updatePlayerFraction(playerID) {
  6356.     global SQLiteDB
  6357.    
  6358.     playerName := getPlayerNameByID(playerID)
  6359.     playerSkin := getTargetPlayerSkinIdById(playerID)
  6360.     playerFraction := getFraktionBySkinID(playerSkin)
  6361.    
  6362.     if (playerName != "" && playerID != -1 && playerSkin != -1 && !ErrorLevel) {
  6363.         if (!SQLiteDB.Query("SELECT fraction FROM enemies WHERE name LIKE '" . playerName . "';", recordSet)) {
  6364.             FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
  6365.             return false
  6366.         }
  6367.        
  6368.         if (!recordSet.HasRows) {
  6369.             if (SQLiteDB.exec("INSERT INTO enemies (name, fraction, updated) VALUES ('" . playerName . "', '" . playerFraction . "', '" . getUnixTimestamp(A_Now) . "');")) {
  6370.                 if (playerFraction != 0 && enemyAddedMessage) {
  6371.                     SendClientMessage(PREFIX . SECCOL . playerName . " {FFFFFF}(" . SECCOL . getFraktionByID(playerFraction) . "{FFFFFF}) wurde in die Gegnerliste aufgenommen!")
  6372.                 }
  6373.             }
  6374.         } else {
  6375.             if (recordSet.Next(row)) {
  6376.                 oldFraction := row[1]
  6377.                
  6378.                 if (oldFraction != playerFraction) {
  6379.                     if (SQLiteDB.exec("UPDATE enemies SET name = '" . playerName . "', fraction = '" . playerFraction . "', updated = '" . getUnixTimestamp(A_Now) . "' WHERE name = '" . playerName . "';")) {
  6380.                         if (enemyUpdatedMessage) {
  6381.                             if (playerFraction != 0) {
  6382.                                 SendClientMessage(PREFIX . SECCOL . playerName . " {FFFFFF}(" . SECCOL . getFraktionByID(playerFraction) . "{FFFFFF}) wurde in der Gegnerliste aktualisiert (Alte Fraktion: " . getFraktionByID(oldFraction) . ")!")
  6383.                             } else {
  6384.                                 SendClientMessage(PREFIX . SECCOL . playerName . " {FFFFFF}wurde aus der Gegnerliste entfernt (Alte Fraktion: " . getFraktionByID(oldFraction) . ")!")
  6385.                             }
  6386.                         }
  6387.                     }
  6388.                 }
  6389.             }
  6390.         }
  6391.        
  6392.         recordSet.Free()
  6393.        
  6394.         return true
  6395.     }
  6396.    
  6397.     return false
  6398. }
  6399.  
  6400. :?:/remgegner::
  6401. :?:/delgegner::
  6402. :?:/remenemy::
  6403. :?:/delenemy::
  6404. {
  6405.     enemyName := PlayerInput("Gegner: ")
  6406.    
  6407.     if (enemyName == "")
  6408.         return
  6409.    
  6410.     if (!SQLiteDB.Query("SELECT fraction, name FROM enemies WHERE name LIKE '" . enemyName . "';", recordSet)) {
  6411.         SendClientMessage(PREFIX . "Es ist ein SQLite-Fehler aufgetreten! Sieh' bitte in der log.txt nach und informiere Martin im Forum.")
  6412.         FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
  6413.         return
  6414.     }
  6415.    
  6416.     if (recordSet.HasRows) {
  6417.         if (recordSet.Next(row)) {
  6418.             enemyFraction := row[1]
  6419.             enemyName := row[2]
  6420.            
  6421.             if (SQLiteDB.exec("UPDATE enemies SET fraction = '0', updated = '" . getUnixTimestamp(A_Now) . "' WHERE name = '" . enemyName . "';")) {
  6422.                 SendClientMessage(PREFIX . SECCOL . enemyName . " {FFFFFF}wurde aus der Gegnerliste entfernt (Alte Fraktion: " . getFraktionByID(enemyFraction) . ")!")
  6423.                 return
  6424.             }
  6425.         }
  6426.     }
  6427.    
  6428.     SendClientMessage(PREFIX . "Der Spieler " . SECCOL . enemyName . " {FFFFFF}wurde nicht in der Gegnerliste gefunden!")
  6429. }
  6430. return
  6431.  
  6432. :?:/gegner::
  6433. :?:/enemies::
  6434. :?:/enemys::
  6435. {
  6436.     if (!SQLiteDB.Query("SELECT fraction, name FROM enemies WHERE fraction != '0' ORDER BY fraction ASC, name ASC;", recordSet)) {
  6437.         SendClientMessage(PREFIX . "Es ist ein SQLite-Fehler aufgetreten! Sieh' bitte in der log.txt nach und informiere Martin im Forum.")
  6438.         FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
  6439.         return
  6440.     }
  6441.    
  6442.     dialog := "Fraktion`tName`tID"
  6443.     playerCount := 0
  6444.    
  6445.     for index, entry in lspdData {
  6446.         playerFraction := 1
  6447.         playerName := entry
  6448.         playerID := getPlayerIdByName(playerName, true)
  6449.        
  6450.         if (playerID != -1) {
  6451.             playerCount++
  6452.            
  6453.             dialog .= "`n" . getFraktionColorByID(playerFraction) . getFraktionByID(playerFraction) . "`t" . playerName . "`t" . playerID
  6454.         }
  6455.     }
  6456.    
  6457.     for index, entry in fbiData {
  6458.         playerFraction := 2
  6459.         playerName := entry
  6460.         playerID := getPlayerIdByName(playerName, true)
  6461.        
  6462.         if (playerID != -1) {
  6463.             playerCount++
  6464.            
  6465.             dialog .= "`n" . getFraktionColorByID(playerFraction) . getFraktionByID(playerFraction) . "`t" . playerName . "`t" . playerID
  6466.         }
  6467.     }
  6468.    
  6469.     if (recordSet.HasRows) {
  6470.         while (recordSet.Next(row) >= 1) {
  6471.             playerFraction := getFraktionByID(row[1])
  6472.             playerName := row[2]
  6473.             playerID := getPlayerIdByName(playerName, true)
  6474.            
  6475.             if (playerID != -1) {
  6476.                 playerCount++
  6477.                
  6478.                 dialog .= "`n" . getFraktionColorByID(row[1]) . playerFraction . "`t" . playerName . "`t" . playerID
  6479.             }
  6480.         }
  6481.        
  6482.         Sleep, 100
  6483.        
  6484.         ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Gegner online: " . SECCOL . playerCount, dialog, "OK")
  6485.     } else {
  6486.         SendClientMessage(PREFIX . "Es wurden noch keine Gegner gefunden! Begebe dich in die Nähe von potentiellen Gegnern, um sie hinzuzufügen.")
  6487.     }
  6488.    
  6489.     recordSet.Free()
  6490. }
  6491. return
  6492.  
  6493. :?:/lspd::
  6494. :?:/fbi::
  6495. :?:/cops::
  6496. {
  6497.     RegExMatch(A_ThisHotkey, "^:\?:\/(\S+)$", hstring_)
  6498.    
  6499.     dialog := "Fraktion`tName`tID`tStatus"
  6500.     playerCount := 0
  6501.    
  6502.     if (hstring_1 = "cops" || hstring_1 = "lspd") {
  6503.         for index, entry in lspdData {
  6504.             playerID := getPlayerIdByName(entry, true)
  6505.             dialog .= "`n" . getFraktionColorByID(1) . getFraktionByID(1) . "`t" . entry . "`t" . (playerID == -1 ? "-" : playerID) . "`t" . (playerID == -1 ? "{FF0000}offline" : "{00FF00}online")
  6506.            
  6507.             if (playerID != -1) {
  6508.                 playerCount++
  6509.             }
  6510.         }
  6511.     }
  6512.    
  6513.     if (hstring_1 = "cops" || hstring_1 = "fbi") {
  6514.         for index, entry in fbiData {
  6515.             playerID := getPlayerIdByName(entry, true)
  6516.             dialog .= "`n" . getFraktionColorByID(2) . getFraktionByID(2) . "`t" . entry . "`t" . (playerID == -1 ? "-" : playerID) . "`t" . (playerID == -1 ? "{FF0000}offline" : "{00FF00}online")
  6517.            
  6518.             if (playerID != -1) {
  6519.                 playerCount++
  6520.             }
  6521.         }
  6522.     }
  6523.    
  6524.     Sleep, 100
  6525.    
  6526.     ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, SECCOL . "Copliste {FFFFFF}(" . SECCOL . playerCount . " {FFFFFF}online)", dialog, "OK")
  6527. }
  6528. return
  6529.  
  6530. :?:/oncops::
  6531. {
  6532.     dialog := "Fraktion`tName`tID`tStatus"
  6533.     playerCount := 0
  6534.    
  6535.     for index, entry in lspdData {
  6536.         playerID := getPlayerIdByName(entry, true)
  6537.        
  6538.         if (playerID != -1) {
  6539.             dialog .= "`n" . getFraktionColorByID(1) . getFraktionByID(1) . "`t" . entry . "`t" . (playerID == -1 ? "-" : playerID) . "`t" . (playerID == -1 ? "{FF0000}offline" : "{00FF00}online")
  6540.             playerCount++
  6541.         }
  6542.     }
  6543.    
  6544.     for index, entry in fbiData {
  6545.         playerID := getPlayerIdByName(entry, true)
  6546.        
  6547.         if (playerID != -1) {
  6548.             dialog .= "`n" . getFraktionColorByID(2) . getFraktionByID(2) . "`t" . entry . "`t" . (playerID == -1 ? "-" : playerID) . "`t" . (playerID == -1 ? "{FF0000}offline" : "{00FF00}online")
  6549.             playerCount++
  6550.         }
  6551.     }
  6552.    
  6553.     Sleep, 100
  6554.    
  6555.     ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, SECCOL . "Copliste {FFFFFF}(" . SECCOL . playerCount . " {FFFFFF}online)", dialog, "OK")
  6556. }
  6557. return
  6558.  
  6559. :?:/lvpd::
  6560. :?:/russen::
  6561. :?:/yakuza::
  6562. :?:/grove::
  6563. :?:/ballas::
  6564. :?:/lcm::
  6565. :?:/rifa::
  6566. :?:/vagos::
  6567. :?:/triaden::
  6568. {
  6569.     if (RegExMatch(A_ThisHotkey, "^:\?:\/(\S+)$", hstring_)) {
  6570.         fraction := fractions[hstring_1][1]
  6571.        
  6572.         if (!SQLiteDB.Query("SELECT name FROM enemies WHERE fraction = '" . fraction . "' ORDER BY name ASC;", recordSet)) {
  6573.             SendClientMessage(PREFIX . "Es ist ein SQLite-Fehler aufgetreten! Sieh' bitte in der log.txt nach und informiere Martin im Forum.")
  6574.             FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
  6575.             return
  6576.         }
  6577.        
  6578.         if (recordSet.HasRows) {
  6579.             dialog := "Name`tID`tStatus"
  6580.             playerCount := 0
  6581.            
  6582.             while (recordSet.Next(row) >= 1) {
  6583.                 playerName := row[1]
  6584.                 playerID := getPlayerIdByName(playerName, true)
  6585.                 dialog .= "`n" . playerName . "`t" . (playerID == -1 ? "-" : playerID) . "`t" . (playerID == -1 ? "{FF0000}offline" : "{00FF00}online")
  6586.                
  6587.                 if (playerID != -1) {
  6588.                     playerCount++
  6589.                 }
  6590.             }
  6591.            
  6592.             Sleep, 100
  6593.            
  6594.             ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, SECCOL . getFraktionByID(fraction) . " {FFFFFF}(" . SECCOL . playerCount . " {FFFFFF}online)", dialog, "OK")
  6595.         } else {
  6596.             SendClientMessage(PREFIX . "Es wurden noch keine Gegner der angegebenen Fraktion gefunden! Begebe dich in die Nähe von potentiellen Gegnern, um sie hinzuzufügen.")
  6597.         }
  6598.        
  6599.         recordSet.Free()
  6600.     }
  6601. }
  6602. return
  6603.  
  6604. #IFNDEF nooverlay
  6605. EnemyOverlayTimer:
  6606. {
  6607.     IfWinNotActive, GTA:SA:MP
  6608.         return
  6609.    
  6610.     enemyOverlayText := ""
  6611.     playerCount := 0
  6612.    
  6613.     if (enemyOverlayShowCops) {
  6614.         for index, entry in lspdData {
  6615.             playerName := entry
  6616.             playerFraction := 1
  6617.             playerID := getPlayerIdByName(playerName, true)
  6618.            
  6619.             if (playerID != -1) {
  6620.                 enemyOverlayText .= "`n" . getFraktionColorByID(playerFraction) . getFraktionByID(playerFraction) . " {FFFFFF}- " . enemyOverlayPrimColor . playerName . enemyOverlaySecColor " (" . enemyOverlayPrimColor . playerID . enemyOverlaySecColor . ")"
  6621.                 playerCount++
  6622.             }
  6623.         }
  6624.        
  6625.         for index, entry in fbiData {
  6626.             playerName := entry
  6627.             playerFraction := 2
  6628.             playerID := getPlayerIdByName(playerName, true)
  6629.            
  6630.             if (playerID != -1) {
  6631.                 enemyOverlayText .= "`n" . getFraktionColorByID(playerFraction) . getFraktionByID(playerFraction) . " {FFFFFF}- " . enemyOverlayPrimColor . playerName . enemyOverlaySecColor " (" . enemyOverlayPrimColor . playerID . enemyOverlaySecColor . ")"
  6632.                 playerCount++
  6633.             }
  6634.         }
  6635.     }
  6636.    
  6637.     if (!SQLiteDB.Query("SELECT name, fraction FROM enemies WHERE fraction != 0 ORDER BY fraction ASC, name ASC;", recordSet)) {
  6638.         FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
  6639.         return
  6640.     }
  6641.    
  6642.     if (recordSet.HasRows) {
  6643.         while (recordSet.Next(row) >= 1) {
  6644.             if ((row[2] >= 1 && row[2] <= 3) && !enemyOverlayShowCops) {
  6645.                 continue
  6646.             }
  6647.            
  6648.             skin := getPlayerSkinId()
  6649.            
  6650.             if (skin != -1) {
  6651.                 fraction := getFraktionBySkinID(skin)
  6652.                
  6653.                 if (fraction == row[2] && !enemyOverlayShowOwnFraction) {
  6654.                     continue
  6655.                 }
  6656.             }
  6657.            
  6658.             playerName := row[1]
  6659.             playerFraction := getFraktionByID(row[2])
  6660.             playerID := getPlayerIdByName(playerName, true)
  6661.            
  6662.             if (playerID != -1) {
  6663.                 enemyOverlayText .= "`n" . getFraktionColorByID(row[2]) . playerFraction . " {FFFFFF}- " . enemyOverlayPrimColor . playerName . enemyOverlaySecColor " (" . enemyOverlayPrimColor . playerID . enemyOverlaySecColor . ")"
  6664.                 playerCount++
  6665.             }
  6666.         }
  6667.     }
  6668.    
  6669.     recordSet.Free()
  6670.    
  6671.     enemyOverlayText := enemyOverlayPrimColor . playerCount . enemyOverlaySecColor . " Gegner online:" . enemyOverlayText
  6672.    
  6673.     if (!enemyOverlayColors) {
  6674.         enemyOverlayText := RegExReplace(enemyOverlayText, "{\S{6}}", "")
  6675.     }
  6676.    
  6677.     TextSetString(enemyOverlay, enemyOverlayText)
  6678. }
  6679. return
  6680. #ENDIF
  6681.  
  6682. ; ------------- ;
  6683. ;   TextDraws   ;
  6684. ; ------------- ;
  6685. :?:/hptd::
  6686. :?:/hptext::
  6687. {
  6688.     if (hpTextEnabled) {
  6689.         SetTimer, HealthTextDrawTimer, Off
  6690.        
  6691.         hpTextEnabled := false
  6692.        
  6693.         if (textMoveMode == 1 || textMoveMode == 2) {
  6694.             textMoveMode := 0
  6695.         }
  6696.        
  6697.         deleteTextDraw(hpText)
  6698.         deleteTextDraw(armourText)
  6699.        
  6700.         SendClientMessage(PREFIX . "Das HP-TextDraw wurde deaktiviert!")
  6701.     } else {
  6702.         createText(1)
  6703.        
  6704.         hpTextEnabled := true
  6705.        
  6706.         SendClientMessage(PREFIX . "Das HP-TextDraw wurde aktiviert!")
  6707.     }
  6708. }
  6709. return
  6710.  
  6711. :?:/fps::
  6712. :?:/fpstd::
  6713. :?:/fpstext::
  6714. {
  6715.     if (fpsTextEnabled) {
  6716.         SetTimer, FPSTextDrawTimer, Off
  6717.        
  6718.         fpsTextEnabled := false
  6719.        
  6720.         if (textMoveMode == 3) {
  6721.             textMoveMode := 0
  6722.         }
  6723.        
  6724.         deleteTextDraw(fpsText)
  6725.        
  6726.         SendClientMessage(PREFIX . "Das FPS-TextDraw wurde deaktiviert!")
  6727.     } else {
  6728.         createText(3)
  6729.        
  6730.         fpsTextEnabled := true
  6731.        
  6732.         SendClientMessage(PREFIX . "Das FPS-TextDraw wurde aktiviert!")
  6733.     }
  6734. }
  6735. return
  6736.  
  6737. :?:/tdmove::
  6738. :?:/textmove::
  6739. {
  6740.     if (textMoveMode) {
  6741.         textMoveMode := 0
  6742.        
  6743.         SendClientMessage(PREFIX . "Der TextDraw-Bearbeitungsmodus wurde {FF0000}deaktiviert{FFFFFF}!")
  6744.     } else {
  6745.         SendClientMessage(PREFIX . SECCOL . "1{FFFFFF}: HP-TextDraw " . SECCOL . "2{FFFFFF}: Armour-TextDraw " . SECCOL . "3{FFFFFF}: FPS-TextDraw")
  6746.        
  6747.         textInput := PlayerInput("Text verschieben: ")
  6748.        
  6749.         if (textInput == "1") {
  6750.             if (hpText != -1) {
  6751.                 textMoveMode := 1
  6752.                
  6753.                 SendClientMessage(PREFIX . "Der TextDraw-Bearbeitungsmodus wurde {00FF00}aktiviert{FFFFFF}!")
  6754.                 SendClientMessage(PREFIX . "Das HP-TextDraw kann nun mit den Pfeiltasten verschoben werden.")
  6755.                 SendClientMessage(PREFIX . "Wenn du fertig bist, tippe " . SECCOL . "/textsave {FFFFFF}ein, um die Einstellung zu speichern!")
  6756.             } else {
  6757.                 SendClientMessage(PREFIX . "Das HP-TextDraw muss aktiviert sein, um ihn zu verschieben!")
  6758.             }
  6759.         } else if (textInput == "2") {
  6760.             if (armourText != -1) {
  6761.                 textMoveMode := 2
  6762.                
  6763.                 SendClientMessage(PREFIX . "Der TextDraw-Bearbeitungsmodus wurde {00FF00}aktiviert{FFFFFF}!")
  6764.                 SendClientMessage(PREFIX . "Das Armour-TextDraw kann nun mit den Pfeiltasten verschoben werden.")
  6765.                 SendClientMessage(PREFIX . "Wenn du fertig bist, tippe " . SECCOL . "/textsave {FFFFFF}ein, um die Einstellung zu speichern!")
  6766.             } else {
  6767.                 SendClientMessage(PREFIX . "Das Armour-TextDraw muss aktiviert sein, um ihn zu verschieben! (Du musst Armour haben)")
  6768.             }
  6769.         } else if (textInput == "3") {
  6770.             if (fpsText != -1) {
  6771.                 textMoveMode := 3
  6772.                
  6773.                 SendClientMessage(PREFIX . "Der TextDraw-Bearbeitungsmodus wurde {00FF00}aktiviert{FFFFFF}!")
  6774.                 SendClientMessage(PREFIX . "Das FPS-TextDraw kann nun mit den Pfeiltasten verschoben werden.")
  6775.                 SendClientMessage(PREFIX . "Wenn du fertig bist, tippe " . SECCOL . "/textsave {FFFFFF}ein, um die Einstellung zu speichern!")
  6776.             } else {
  6777.                 SendClientMessage(PREFIX . "Das FPS-TextDraw muss aktiviert sein, um ihn zu verschieben!")
  6778.             }
  6779.         }
  6780.     }
  6781. }
  6782. return
  6783.  
  6784. :?:/tdsave::
  6785. :?:/textsave::
  6786. {
  6787.     if (textMoveMode == 1) {
  6788.         IniWrite, %hpTextPosX%, settings.ini, HPText, HPPosX
  6789.         IniWrite, %hpTextPosY%, settings.ini, HPText, HPPosY
  6790.        
  6791.         textMoveMode := 0
  6792.        
  6793.         SendClientMessage(PREFIX . "Die HP-TextDraw-Position wurde {00FF00}gespeichert{FFFFFF}!")
  6794.     } else if (textMoveMode == 2) {
  6795.         IniWrite, %armourTextPosX%, settings.ini, HPText, ArmourPosX
  6796.         IniWrite, %armourTextPosY%, settings.ini, HPText, ArmourPosY
  6797.        
  6798.         textMoveMode := 0
  6799.        
  6800.         SendClientMessage(PREFIX . "Die Armour-TextDraw-Position wurde {00FF00}gespeichert{FFFFFF}!")
  6801.     } else if (textMoveMode == 3) {
  6802.         IniWrite, %fpsTextPosX%, settings.ini, FPSText, PosX
  6803.         IniWrite, %fpsTextPosY%, settings.ini, FPSText, PosY
  6804.        
  6805.         textMoveMode := 0
  6806.        
  6807.         SendClientMessage(PREFIX . "Die FPS-TextDraw-Position wurde {00FF00}gespeichert{FFFFFF}!")
  6808.     } else {
  6809.         SendClientMessage(PREFIX . "Der TextDraw-Bearbeitungsmodus ist nicht aktiviert!")
  6810.     }
  6811. }
  6812. return
  6813.  
  6814. createText(id) {
  6815.     global
  6816.    
  6817.     if (id == 1) {
  6818.         hpText := createTextDraw(getTextDrawColor(hpTextColor) . getPlayerHealth(), hpTextPosX, hpTextPosY, 0xFFFFFFFF, hpTextFont, hpTextFontSize, hpTextFontSize * 3)
  6819.         armourText := -1
  6820.        
  6821.         SetTimer, HealthTextDrawTimer, 500
  6822.     } else if (id == 3) {
  6823.         fpsText := createTextDraw(getTextDrawColor(fpsTextColor) . getFPS(), fpsTextPosX, fpsTextPosY, 0xFFFFFFFF, fpsTextFont, fpsTextFontSize, fpsTextFontSize * 3)
  6824.        
  6825.         SetTimer, FPSTextDrawTimer, 500
  6826.     }
  6827. }
  6828.  
  6829. updateText(id) {
  6830.     global
  6831.    
  6832.     if (id == 1) {
  6833.         if (hpText != -1) {
  6834.             moveTextDraw(hpText, hpTextPosX, hpTextPosY)
  6835.         }
  6836.     } else if (id == 2) {
  6837.         if (armourText != -1) {
  6838.             moveTextDraw(armourText, armourTextPosX, armourTextPosY)
  6839.         }
  6840.     } else if (id == 3) {
  6841.         if (fpsText != -1) {
  6842.             moveTextDraw(fpsText, fpsTextPosX, fpsTextPosY)
  6843.         }
  6844.     }
  6845. }
  6846.  
  6847. getTextDrawColor(id) {
  6848.     color := ""
  6849.    
  6850.     if (id == 1) {
  6851.         color := "~w~"
  6852.     } else if (id == 2) {
  6853.         color := "~l~"
  6854.     } else if (id == 3) {
  6855.         color := "~r~"
  6856.     } else if (id == 4) {
  6857.         color := "~g~"
  6858.     } else if (id == 5) {
  6859.         color := "~b~"
  6860.     } else if (id == 6) {
  6861.         color := "~y~"
  6862.     } else if (id == 7) {
  6863.         color := "~p~"
  6864.     }
  6865.    
  6866.     return color
  6867. }
  6868.  
  6869. HealthTextDrawTimer:
  6870. {
  6871.     if (hpText != -1) {
  6872.         updateTextDraw(hpText, getTextDrawColor(hpTextColor) . getPlayerHealth())
  6873.     }
  6874.    
  6875.     armour := getPlayerArmor()
  6876.    
  6877.     if (armour > 1) {
  6878.         if (armourText != -1) {
  6879.             updateTextDraw(armourText, getTextDrawColor(armourTextColor) . armour)
  6880.         } else {
  6881.             armourText := createTextDraw(getTextDrawColor(armourTextColor) . TextColor . armour, armourTextPosX, armourTextPosY, 0xFFFFFFFF, hpTextFont, hpTextFontSize, hpTextFontSize * 3)
  6882.         }
  6883.     } else {
  6884.         if (armourText != -1) {
  6885.             deleteTextDraw(armourText)
  6886.         }
  6887.     }
  6888. }
  6889. return
  6890.  
  6891. FPSTextDrawTimer:
  6892. {
  6893.     if (fpsText != -1) {
  6894.         updateTextDraw(fpsText, getTextDrawColor(fpsTextColor) . getFPS())
  6895.     }
  6896. }
  6897. return
  6898.  
  6899. ; -------------- ;
  6900. ; Freunde-System ;
  6901. ; -------------- ;
  6902. :?:/addfreund::
  6903. :?:/addfriend::
  6904. {
  6905.     friendNameInput := PlayerInput("Name/ID des Freundes: ")
  6906.    
  6907.     if (friendNameInput == "")
  6908.         return
  6909.    
  6910.     friendName := getFullName(friendNameInput)
  6911.    
  6912.     if (friendName == "") {
  6913.         friendName := friendNameInput
  6914.     }
  6915.    
  6916.     if (!SQLiteDB.Query("SELECT name FROM friends WHERE name LIKE '" . friendName . "';", recordSet)) {
  6917.         FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
  6918.         SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten! Schau bitte in die log.txt und melde den Fehler bei Martin!")
  6919.     }
  6920.    
  6921.     if (!recordSet.HasRows) {
  6922.         if (SQLiteDB.exec("INSERT INTO friends (name, added) VALUES ('" . friendName . "', '" . getUnixTimestamp(A_Now) . "');")) {
  6923.             SendClientMessage(PREFIX . SECCOL . friendName . " {FFFFFF}wurde in die Freundesliste aufgenommen!")
  6924.         } else {
  6925.             FileAppend, % "SQLite Error: Query - Msg: '" . SQLiteDB.ErrorMsg . "' - Code: " . SQLiteDB.ErrorCode, log.txt
  6926.             SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten! Schau bitte in die log.txt und melde den Fehler bei Martin!")
  6927.         }
  6928.     } else {
  6929.         if (recordSet.Next(row)) {
  6930.             if (SQLiteDB.exec("UPDATE friends SET name = '" . friendName . "', updated = '" . getUnixTimestamp(A_Now) . "' WHERE name = '" . friendName . "';")) {
  6931.                 SendClientMessage(PREFIX . SECCOL . friendName . " {FFFFFF}wurde in der Freundesliste aktualisiert!")
  6932.             } else {
  6933.                 FileAppend, % "SQLite Error: Query - Msg: '" . SQLiteDB.ErrorMsg . "' - Code: " . SQLiteDB.ErrorCode, log.txt
  6934.                 SendClientMessage(PREFIX . "Es ist ein Fehler aufgetreten! Schau bitte in die log.txt und melde den Fehler bei Martin!")
  6935.             }
  6936.         }
  6937.     }
  6938.    
  6939.     recordSet.Free()
  6940. }
  6941. return
  6942.  
  6943. :?:/remfreund::
  6944. :?:/delfreund::
  6945. :?:/remfriend::
  6946. :?:/delfriend::
  6947. {
  6948.     friendNameInput := PlayerInput("Name/ID des Freundes: ")
  6949.    
  6950.     if (friendNameInput == "")
  6951.         return
  6952.    
  6953.     friendName := getFullName(friendNameInput)
  6954.    
  6955.     if (friendName == "") {
  6956.         friendName := friendNameInput
  6957.     }
  6958.    
  6959.     if (SQLiteDB.exec("DELETE FROM friends WHERE name = '" . friendName . "';")) {
  6960.         SendClientMessage(PREFIX . SECCOL . friendName . " {FFFFFF}wurde aus der Freundesliste entfernt!")
  6961.        
  6962.         if (onlineFriends.HasKey(friendName)) {
  6963.             textLabelID := onlineFriends.Delete(friendName)
  6964.            
  6965.             if (textLabelID != -1) {
  6966.                 deleteTextLabel(textLabelID)
  6967.             }
  6968.         }
  6969.     }
  6970. }
  6971. return
  6972.  
  6973. :?:/dall::
  6974. {
  6975.     Loop, 2048 {
  6976.         deleteTextLabel(A_Index - 1)
  6977.     }
  6978.    
  6979.     SendClientMessage(PREFIX . "Es wurden ALLE TextLabel gelöscht (auch serverseitige).")
  6980. }
  6981. return
  6982.  
  6983. :?:/freunde::
  6984. :?:/friends::
  6985. {
  6986.     if (!SQLiteDB.Query("SELECT name FROM friends ORDER BY name ASC;", recordSet)) {
  6987.         SendClientMessage(PREFIX . "Es ist ein SQLite-Fehler aufgetreten! Sieh' bitte in der log.txt nach und informiere Martin im Forum.")
  6988.         FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
  6989.         return
  6990.     }
  6991.    
  6992.     if (recordSet.HasRows) {
  6993.         dialog := "Name`tID`tStatus"
  6994.         playerCount := 0
  6995.        
  6996.         while (recordSet.Next(row) >= 1) {
  6997.             playerName := row[1]
  6998.             playerID := getPlayerIdByName(playerName, true)
  6999.             dialog .= "`n" . playerName . "`t" . (playerID == -1 ? "-" : playerID) . "`t" . (playerID == -1 ? "{FF0000}offline" : "{00FF00}online")
  7000.            
  7001.             if (playerID != -1) {
  7002.                 playerCount++
  7003.             }
  7004.         }
  7005.        
  7006.         Sleep, 100
  7007.        
  7008.         ShowDialog(DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Freunde online: " . SECCOL . playerCount, dialog, "OK")
  7009.     } else {
  7010.         SendClientMessage(PREFIX . "Du hast noch keine Freunde eingespeichert! Benutze " . SECCOL . "/addfriend")
  7011.     }
  7012.    
  7013.     recordSet.Free()
  7014. }
  7015. return
  7016.  
  7017. :?:/freundelabel::
  7018. :?:/friendslabel::
  7019. :?:/friendlabels::
  7020. :?:/friendslabels::
  7021. :?:/freundlabels::
  7022. :?:/freundelabels::
  7023. {
  7024.     if (showFriendLabels) {
  7025.         showFriendLabels := false
  7026.        
  7027.         for friendName, textLabelID in onlineFriends {
  7028.             if (textLabelID != -1) {
  7029.                 deleteTextLabel(textLabelID)
  7030.                
  7031.                 onlineFriends[friendName] := -1
  7032.             }
  7033.         }
  7034.        
  7035.         SendClientMessage(PREFIX . "TextLabel über den Köpfen von Freunden {FF0000}deaktiviert{FFFFFF}.")
  7036.     } else {
  7037.         showFriendLabels := true
  7038.        
  7039.         for friendName, textLabelID in onlineFriends {
  7040.             if (textLabelID == -1) {
  7041.                 playerID := getPlayerIdByName(friendName)
  7042.                
  7043.                 if (playerID != -1) {
  7044.                     textLabelID := createTextLabel("[Freund]", 0xFF0000FF, 0, 0, 0.5, 20.0, 1, playerID)
  7045.                    
  7046.                     onlineFriends[friendName] := textLabelID
  7047.                 }
  7048.             }
  7049.         }
  7050.        
  7051.         SendClientMessage(PREFIX . "TextLabel über den Köpfen von Freunden {00FF00}aktiviert{FFFFFF}.")
  7052.     }
  7053. }
  7054. return
  7055.  
  7056. FriendsTimer:
  7057. {
  7058.     IfWinNotActive, GTA:SA:MP
  7059.         return
  7060.    
  7061.     if (!SQLiteDB.Query("SELECT name FROM friends ORDER BY name ASC;", recordSet)) {
  7062.         FileAppend, % "SQLite Error: Query - Msg: '" . recordSet.ErrorMsg . "' - Code: " . recordSet.ErrorCode, log.txt
  7063.         return
  7064.     }
  7065.    
  7066.     if (recordSet.HasRows) {
  7067.         while (recordSet.Next(row) >= 1) {
  7068.             friendName := row[1]
  7069.             playerID := getPlayerIdByName(friendName, true)
  7070.            
  7071.             if (ErrorLevel || playerID == -2) {
  7072.                 if (debug) {
  7073.                     SendClientMessage(PREFIX . "Fehler beim Auslesen der ID von " . friendName . " (" . playerID . "): " . ErrorLevel)
  7074.                 }
  7075.                
  7076.                 continue
  7077.             }
  7078.            
  7079.             if (playerID != -1) {
  7080.                 if (!onlineFriends.HasKey(friendName)) {
  7081.                     textLabelID := -1
  7082.                    
  7083.                     if (showFriendLabels) {
  7084.                         textLabelID := createTextLabel("[Freund]", 0xFF0000FF, 0, 0, 0.5, 20.0, 1, playerID)
  7085.                     }
  7086.                    
  7087.                     onlineFriends[friendName] := textLabelID
  7088.                    
  7089.                     if (!firstFriendsTimerRun && friendMessages) {
  7090.                         SendClientMessage(PREFIX . "Dein Freund " . SECCOL . friendName . " {FFFFFF}ist {00FF00}online {FFFFFF}gekommen.")
  7091.                     }
  7092.                    
  7093.                 }
  7094.             } else {
  7095.                 if (onlineFriends.HasKey(friendName)) {
  7096.                     textLabelID := onlineFriends.Delete(friendName)
  7097.                    
  7098.                     if (textLabelID != -1) {
  7099.                         deleteTextLabel(textLabelID)
  7100.                     }
  7101.                    
  7102.                     if (!firstFriendsTimerRun && friendMessages) {
  7103.                         SendClientMessage(PREFIX . "Dein Freund " . SECCOL . friendName . " {FFFFFF}ist {FF0000}offline {FFFFFF}gegangen.")
  7104.                     }
  7105.                 }
  7106.             }
  7107.         }
  7108.     }
  7109.    
  7110.     recordSet.Free()
  7111.    
  7112.     if (firstFriendsTimerRun) {
  7113.         firstFriendsTimerRun := false
  7114.     }
  7115. }
  7116. return
  7117.  
  7118. ; ------------------ ;
  7119. ; Namechange-Systeme ;
  7120. ; ------------------ ;
  7121. :?:/whois::
  7122. {
  7123.     newName := PlayerInput("Name: ")
  7124.     newNameFull := getFullName(newName)
  7125.    
  7126.     if (newNameFull != "")
  7127.         newName := newNameFull
  7128.    
  7129.     result := UrlDownloadToVar("https://comniemeer.de/api/namechange.php?name=" . newName, true)
  7130.    
  7131.     if (result == "ERROR_CONNECTION")
  7132.         return
  7133.    
  7134.     try {
  7135.         data := JSON.Load(result)
  7136.     } catch {
  7137.         SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
  7138.         FormatTime, time, , dd.MM.yyyy HH:mm:ss
  7139.         FileAppend, [%time%] Beim Laden des alten Namen ist ein Fehler aufgetreten: %result%`n, log.txt
  7140.         return
  7141.     }
  7142.    
  7143.     if (data["error"] != "") {
  7144.         SendClientMessage(PREFIX . "{FF0000}" . data["error"])
  7145.         return
  7146.     }
  7147.    
  7148.     if (data["namechanges"].Length() == 0) {
  7149.         SendClientMessage(PREFIX . "Es wurden keine Namensänderungen zu dem angegebenen Spieler gefunden!")
  7150.         return
  7151.     }
  7152.    
  7153.     for i, namechange in data["namechanges"] {
  7154.         if (InStr(newName, namechange["old_name"])) {
  7155.             newName := namechange["old_name"]
  7156.             break
  7157.         } else if (InStr(newName, namechange["new_name"])) {
  7158.             newName := namechange["new_name"]
  7159.             break
  7160.         }
  7161.     }
  7162.    
  7163.     SendClientMessage(PREFIX . "Namechange-Verlauf von " . SECCOL . newName . "{FFFFFF}:")
  7164.    
  7165.     for i, namechange in data["namechanges"] {
  7166.         SendClientMessage(PREFIX . SECCOL . namechange["old_name"] . " {FFFFFF}-> " . SECCOL . namechange["new_name"] . " {FFFFFF}(" . namechange["date"] . ")")
  7167.     }
  7168. }
  7169. return
  7170.  
  7171. :?:/namechanges::
  7172. {
  7173.     if (showNamechanges) {
  7174.         SetTimer, NamechangeTimer, Off
  7175.        
  7176.         showNamechanges := false
  7177.         toRemove := []
  7178.        
  7179.         for playerName, textLabelID in onlinePlayers {
  7180.             if (textLabelID != -1) {
  7181.                 deleteTextLabel(textLabelID)
  7182.                 toRemove.Push(playerName)
  7183.             }
  7184.         }
  7185.        
  7186.         for i, playerName in toRemove {
  7187.             onlinePlayers.Delete(playerName)
  7188.         }
  7189.        
  7190.         SendClientMessage(PREFIX . "Namechange-Informationen über den Köpfen der Spieler {FF0000}deaktiviert{FFFFFF}.")
  7191.     } else {
  7192.         GoSub, NamechangeTimer
  7193.         SetTimer, NamechangeTimer, 5000
  7194.        
  7195.         showNamechanges := true
  7196.        
  7197.         SendClientMessage(PREFIX . "Namechange-Informationen über den Köpfen der Spieler {00FF00}aktiviert{FFFFFF}.")
  7198.     }
  7199. }
  7200. return
  7201.  
  7202. NamechangeTimer:
  7203. {
  7204.     IfWinNotActive, GTA:SA:MP
  7205.         return
  7206.    
  7207.     toRemove := []
  7208.    
  7209.     for playerName, textLabelID in onlinePlayers {
  7210.         playerID := getPlayerIdByName(playerName, true)
  7211.        
  7212.         if (playerID == -1) {
  7213.             if (textLabelID != -1) {
  7214.                 deleteTextLabel(textLabelID)
  7215.             }
  7216.            
  7217.             toRemove.Push(playerName)
  7218.         }
  7219.     }
  7220.    
  7221.     for i, playerName in toRemove {
  7222.         onlinePlayers.Delete(playerName)
  7223.     }
  7224.    
  7225.     players := getStreamedInPlayersInfo()
  7226.    
  7227.     for i, o in players {
  7228.         playerID := o.ID
  7229.         playerName := getPlayerNameByID(playerID)
  7230.        
  7231.         if (playerName != "") {
  7232.             if (!onlinePlayers.HasKey(playerName)) {
  7233.                 result := UrlDownloadToVar("https://comniemeer.de/api/namechange.php?name=" . playerName)
  7234.                
  7235.                 if (result == "ERROR_CONNECTION")
  7236.                     continue
  7237.                
  7238.                 try {
  7239.                     data := JSON.Load(result)
  7240.                 } catch {
  7241.                     FormatTime, time, , dd.MM.yyyy HH:mm:ss
  7242.                     FileAppend, [%time%] Beim Laden der Namechange-History ist ein Fehler aufgetreten: %result%`n, log.txt
  7243.                     continue
  7244.                 }
  7245.                
  7246.                 if (data["error"] != "") {
  7247.                     continue
  7248.                 }
  7249.                
  7250.                 textLabelID := -1
  7251.                
  7252.                 if (data["namechanges"].Length() == 0) {
  7253.                     onlinePlayers[playerName] := textLabelID
  7254.                     continue
  7255.                 }
  7256.                
  7257.                 namechanges := ""
  7258.                 nLines := 0
  7259.                
  7260.                 for i, namechange in data["namechanges"] {
  7261.                     namechanges .= SECCOL . namechange["old_name"] . " {FFFFFF}-> " . SECCOL . namechange["new_name"] . "`n"
  7262.                     nLines++
  7263.                 }
  7264.                
  7265.                 textLabelID := -1
  7266.                
  7267.                 if (namechanges != "") {
  7268.                     textLabelID := createTextLabel(namechanges, 0xFFFFFFFF, 0, 0, 0.65 + (nLines * 0.05), 20.0, 1, playerID)
  7269.                 }
  7270.                
  7271.                 onlinePlayers[playerName] := textLabelID
  7272.             }
  7273.         }
  7274.     }
  7275. }
  7276. return
  7277. ; ----------------------- ;
  7278. ; Ende Namechange-Systeme ;
  7279. ; ----------------------- ;
  7280.  
  7281. :?:/tankstelle::
  7282. :?:/tankstellen::
  7283. {
  7284.     coords := getCoordinates()
  7285.     result := URLDownloadToVar("https://comniemeer.de/api/tankstellen.php?x=" . coords[1] . "&y=" . coords[2] . "&z=" . coords[3])
  7286.    
  7287.     try {
  7288.         data := JSON.Load(result)
  7289.     } catch {
  7290.         SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
  7291.         FormatTime, time, , dd.MM.yyyy HH:mm:ss
  7292.         FileAppend, [%time%] Beim Laden der Tankstellen ist ein Fehler aufgetreten: %result%`n, log.txt
  7293.         return
  7294.     }
  7295.    
  7296.     if (data["error"]) {
  7297.         SendClientMessage(PREFIX . "{FF0000}" . data["error"])
  7298.     } else {
  7299.         gasstations := data["gasstations"]
  7300.         dialog := "Tankstelle`tBesitzer`tTankpreis & Entfernung`tZuletzt geupdated"
  7301.        
  7302.         for i, entry in gasstations {
  7303.             name := entry["name"]
  7304.             owner := entry["owner"]
  7305.             price := entry["price"]
  7306.             x := entry["x"]
  7307.             y := entry["y"]
  7308.             z := entry["z"]
  7309.             distance := entry["distance"]
  7310.             lastupdated := entry["lastupdated"]
  7311.             updatedby := entry["updatedby"]
  7312.            
  7313.             if (price <= 20) {
  7314.                 price := "{00FF00}" . price
  7315.             } else if (price >= 50) {
  7316.                 price := "{FF0000}" . price
  7317.             } else {
  7318.                 price := "{FFFF00}" . price
  7319.             }
  7320.            
  7321.             dialog .= "`n" . SECCOL . name . "`t" . owner . "`t" . price . "$ {FFFFFF}- " . FormatNumber(distance) . " m`t" . SECCOL . lastupdated . " {FFFFFF}(" . updatedby . ")"
  7322.         }
  7323.        
  7324.         showDialog(DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Übersicht der Tankstellen", dialog, "Schließen")
  7325.     }
  7326. }
  7327. return
  7328.  
  7329. GasstationsTimer:
  7330. {
  7331.     IfWinNotActive, GTA:SA:MP
  7332.         return
  7333.    
  7334.     if (!updateTextLabelData()) {
  7335.         return
  7336.     }
  7337.    
  7338.     coords := getCoordinates()
  7339.     data := []
  7340.     data["name"] := getUsername()
  7341.     data["gasstations"] := []
  7342.    
  7343.     for i, o in oTextLabelData {
  7344.         if (o.PLAYERID == 65535 && o.VEHICLEID == 65535) {
  7345.             if (RegExMatch(o.TEXT, "(.+)\n\nBesitzer: (.+)\nTeilhaber: (\S+)\nLiterpreis: (\d+)\$\nBenötigte Liter: (\d+)\nBezugspreis: (\d+)\$\n\nFahrzeug mit \/fill betanken", label_)) {
  7346.                 gasstation := []
  7347.                 gasstation["owner"] := StrReplace(StrReplace(label_2, "]", "%5D"), "[", "%5B")
  7348.                 gasstation["partner"] := StrReplace(StrReplace(label_3, "]", "%5D"), "[", "%5B")
  7349.                 gasstation["description"] := StrReplace(StrReplace(StrReplace(label_1, "&", "%26"), "]", "%5D"), "[", "%5B")
  7350.                 gasstation["price"] := label_4
  7351.                 gasstation["x"] := o.XPOS
  7352.                 gasstation["y"] := o.YPOS
  7353.                 gasstation["z"] := o.ZPOS
  7354.                
  7355.                 data["gasstations"].Push(gasstation)
  7356.             }
  7357.         }
  7358.     }
  7359.    
  7360.     if (data["gasstations"].Length() > 0) {
  7361.         jsonData := JSON.Dump(data)
  7362.        
  7363.         result := URLDownloadToVar("https://comniemeer.de/api/updatetankstelle.php?data=" . jsonData)
  7364.        
  7365.         Sleep, 30000
  7366.     }
  7367. }
  7368. return
  7369.  
  7370. ; -------------------- ;
  7371. ; Store-Rob Funktionen ;
  7372. ; -------------------- ;
  7373. RobTimer:
  7374. {
  7375.     if (storerobTime == 0) {
  7376.         SetTimer, RobTimer, Off
  7377.     } else if ((Mod(storerobTime, 30) == 0) || (storerobTime <= 15 && Mod(storerobTime, 5) == 0)) {
  7378.         SendClientMessage(PREFIX . "Der Store-Rob dauert noch " . SECCOL . storerobTime . " Sekunden{FFFFFF}!")
  7379.     }
  7380.    
  7381.     storerobTime--
  7382. }
  7383. return
  7384.  
  7385. robstoreLabel:
  7386. {
  7387.     if (IsInChat())
  7388.         return
  7389.    
  7390.     if (getPlayerInteriorId() == 0) {
  7391.         loadStores()
  7392.         showNearestStore()
  7393.     } else {
  7394.         SendChat("/robstore")
  7395.     }
  7396. }
  7397. return
  7398.  
  7399. storesLabel:
  7400. {
  7401.     if (IsInChat())
  7402.         return
  7403.    
  7404.     sortByString := ""
  7405.    
  7406.     if (sortStoresBy == 1) {
  7407.         sortByString := ""
  7408.     } else if (sortStoresBy == 2) {
  7409.         sortByString := "type"
  7410.     } else if (sortStoresBy == 3) {
  7411.         sortByString := "distance"
  7412.     } else if (sortStoresBy == 4) {
  7413.         sortByString := "status"
  7414.     } else {
  7415.         SendClientMessage(PREFIX . "Ungültige Sortierung! Verwende Standardsortierung.")
  7416.     }
  7417.    
  7418.     coords := getCoordinates()
  7419.     result := URLDownloadToVar(robBaseURL . "api/loadallstores.php?x=" . coords[1] . "&y=" . coords[2] . "&z=" . coords[3] . "&sort=" . sortByString)
  7420.    
  7421.     allStores := JSON.Load(result)
  7422.    
  7423.     if (allStores["error"]) {
  7424.         SendClientMessage(PREFIX . "Beim Laden der Stores ist ein Fehler aufgetreten!")
  7425.     } else {
  7426.         dialog := "Typ`tGK`tOrt und Entfernung`tStatus`n"
  7427.        
  7428.         for i, entry in allStores["stores"] {
  7429.             store := entry["store"]
  7430.             gk := entry["gk"]
  7431.             x := entry["x"]
  7432.             y := entry["y"]
  7433.             z := entry["z"]
  7434.             status := entry["status"]
  7435.             distance := entry["distance"]
  7436.            
  7437.             dialog .= store . "`t" . gk . "`t" . calculateZone(x, y, z) . " (" . distance . "m)`t" . status
  7438.            
  7439.             if (i < allStores["stores"].Length())
  7440.                 dialog .= "`n"
  7441.         }
  7442.        
  7443.         showDialog(DIALOG_STYLE_TABLIST_HEADERS, "Übersicht der Stores", dialog, "Schließen")
  7444.     }
  7445. }
  7446. return
  7447.  
  7448. ~LButton::
  7449. {
  7450.     Sleep, 200
  7451.    
  7452.     if (isDialogOpen()) {
  7453.         caption := getDialogCaption()
  7454.        
  7455.         if (RegExMatch(caption, "Übersicht der Stores")) {
  7456.             line := getDialogLine(getDialogIndex())
  7457.            
  7458.             if (RegExMatch(line, "(\S+)`t(\S+)`t(.+)`t(.+)", line_)) {
  7459.                 type := line_1
  7460.                 gk := line_2
  7461.                
  7462.                 for index, entry in allStores["stores"] {
  7463.                     if (entry["store"] == type && entry["gk"] == gk) {
  7464.                         if (RegExMatch(type, "{(\S+)}(\S+)", type_)) {
  7465.                             type := type_2
  7466.                         }
  7467.                        
  7468.                         x := entry["x"]
  7469.                         y := entry["y"]
  7470.                         z := entry["z"]
  7471.                         playerCoords := getCoordinates()
  7472.                         distance := Round(getDistanceToPoint(x, y, z, playerCoords[1], playerCoords[2], playerCoords[3]))
  7473.                        
  7474.                         setCheckpoint(x, y, z, 3)
  7475.                         SendClientMessage(PREFIX . "Store " . SECCOL . gk . " {FFFFFF}(" . type .  ") in " . SECCOL . calculateZone(x, y, z) . " {FFFFFF}(" . SECCOL . distance . "m {FFFFFF}entfernt)")
  7476.                     }
  7477.                 }
  7478.             }
  7479.         } else if (RegExMatch(caption, "Verfügbare Aufträge")) {
  7480.             line := getDialogLine(getDialogIndex())
  7481.            
  7482.             if (RegExMatch(line, "(\d+)`t(.+) \((\S+)\)`t(.+)`t(.+)", line_)) {
  7483.                 SendChat("/delivery " . line_1)
  7484.             }
  7485.         } else if (RegExMatch(caption, "Übersicht der Tankstellen")) {
  7486.             line := getDialogLine(getDialogIndex())
  7487.            
  7488.             if (RegExMatch(line, "{\S+}(.+)`t(.+)`t{\S+}(\d+)\$ {\S+}- \S+ m`t{\S+}.+ {\S+}\(\S+\)", line_)) {
  7489.                 name := line_1
  7490.                 owner := line_2
  7491.                
  7492.                 for index, entry in gasstations {
  7493.                     if (entry["name"] == name && entry["owner"] == owner) {
  7494.                         x := entry["x"]
  7495.                         y := entry["y"]
  7496.                         z := entry["z"]
  7497.                         playerCoords := getCoordinates()
  7498.                         distance := Round(getDistanceToPoint(x, y, z, playerCoords[1], playerCoords[2], playerCoords[3]))
  7499.                        
  7500.                         setCheckpoint(x, y, z, 3)
  7501.                         SendClientMessage(PREFIX . "Tankstelle " . SECCOL . name . " {FFFFFF}(" . SECCOL . entry["price"] .  "${FFFFFF}) in " . SECCOL . FormatNumber(distance) . " m {FFFFFF}Entfernung.")
  7502.                     }
  7503.                 }
  7504.             }
  7505.         }
  7506.     }
  7507. }
  7508. return
  7509.  
  7510. :?:/showstores::
  7511. {
  7512.     loadStores()
  7513.     showStores()
  7514. }
  7515. return
  7516.  
  7517. loadStores() {
  7518.     coords := getCoordinates()
  7519.     result := URLDownloadToVar(robBaseURL . "api/loadstores.php?x=" . coords[1] . "&y=" . coords[2] . "&z=" . coords[3])
  7520.    
  7521.     try {
  7522.         stores := JSON.Load(result)
  7523.     } catch {
  7524.         SendClientMessage(PREFIX . "{FF0000}Es ist ein unbekannter Fehler aufgetreten!")
  7525.         FormatTime, time, , dd.MM.yyyy HH:mm:ss
  7526.         FileAppend, [%time%] Beim Laden des showGK ist ein Fehler aufgetreten: %result%`n, log.txt
  7527.         return
  7528.     }
  7529.    
  7530.     updated := true
  7531. }
  7532.  
  7533. showStores() {
  7534.     if (!updated) {
  7535.         SendClientMessage(PREFIX . "Stores müssen erst geladen werden!")
  7536.     } else {
  7537.         if (stores["error"]) {
  7538.             SendClientMessage(PREFIX . "Beim Laden der Stores ist ein Fehler aufgetreten!")
  7539.         } else {
  7540.             storesCount := stores["stores"].Length()
  7541.            
  7542.             if (storesCount == 0) {
  7543.                 SendClientMessage(PREFIX . "Es sind keine Stores zum Ausrauben vorhanden!")
  7544.             } else {
  7545.                 page := 1
  7546.                 pages := Ceil(storesCount / 10)
  7547.                
  7548.                 if (storesCount > 10) {
  7549.                     pageInput := PlayerInput("Seite (Standard 1, max. " . pages . "): ")
  7550.                    
  7551.                     if (pageInput != "") {
  7552.                         if pageInput is not number
  7553.                         {
  7554.                             SendClientMessage(PREFIX . "Bitte eine Zahl eingeben!")
  7555.                             return
  7556.                         }
  7557.                        
  7558.                         if (pageInput > pages) {
  7559.                             SendClientMessage(PREFIX . "Maximale Seitenzahl: " . SECCOL . pages)
  7560.                             return
  7561.                         } else {
  7562.                             page := pageInput
  7563.                         }
  7564.                     }
  7565.                 }
  7566.                
  7567.                 for i, entry in stores["stores"] {
  7568.                     x := entry["x"]
  7569.                     y := entry["y"]
  7570.                     z := entry["z"]
  7571.                     distance := entry["distance"]
  7572.                    
  7573.                     if (i > page * 10 - 10 && i <= page * 10) {
  7574.                         SendClientMessage(PREFIX . "ID: " . SECCOL . i . " {FFFFFF}- In: " . SECCOL . calculateZone(x, y, z) . ", " . calculateCity(x, y, z) . " {FFFFFF}- " . SECCOL . distance . "m {FFFFFF}entfernt")
  7575.                     }
  7576.                 }
  7577.             }
  7578.         }
  7579.     }
  7580. }
  7581.  
  7582. showNearestStore() {
  7583.     if (!updated) {
  7584.         SendClientMessage(PREFIX . "Stores müssen erst geladen werden!")
  7585.         return
  7586.     }
  7587.    
  7588.     if (stores["stores"].Length() != 0) {
  7589.         store := stores["stores"][1]
  7590.         type := store["store"]
  7591.         gk := store["gk"]
  7592.         x := store["x"]
  7593.         y := store["y"]
  7594.         z := store["z"]
  7595.         distance := store["distance"]
  7596.        
  7597.         setCheckpoint(x, y, z, 3)
  7598.         SendClientMessage(PREFIX . "Store " . SECCOL . gk . " {FFFFFF}(" . type .  ") in " . SECCOL . calculateZone(x, y, z) . " {FFFFFF}(" . SECCOL . distance . "m {FFFFFF}entfernt) verfügbar.")
  7599.     } else {
  7600.         SendClientMessage(PREFIX . "Keine freien Stores zum Ausrauben verfügbar!")
  7601.     }
  7602. }
  7603. ; ------------------------- ;
  7604. ; Ende Store-Rob Funktionen ;
  7605. ; ------------------------- ;
  7606.  
  7607. pauseLabel:
  7608.     Suspend, permit
  7609.     Suspend
  7610.    
  7611.     if (A_IsSuspended) {
  7612.         SendClientMessage(PREFIX . "Keybinder & Timer {FF0000}pausiert{FFFFFF}.")
  7613.        
  7614.         SetTimer, ChatTimer, Off
  7615.         SetTimer, TankTimer, Off
  7616.         SetTimer, FillCustoms, Off
  7617.         SetTimer, LottoTimer, Off
  7618.         SetTimer, TempoTimer, Off
  7619.         SetTimer, KillTimer, Off
  7620.         SetTimer, SearchEnemyTimer, Off
  7621.         SetTimer, FriendsTimer, Off
  7622.         SetTimer, GasstationsTimer, Off
  7623.     } else {
  7624.         SendClientMessage(PREFIX . "Keybinder & Timer {00FF00}aktiviert{FFFFFF}.")
  7625.        
  7626.         SetTimer, ChatTimer, 100
  7627.         SetTimer, TankTimer, 100
  7628.         SetTimer, FillCustoms, 500
  7629.         SetTimer, LottoTimer, 1000
  7630.         SetTimer, TempoTimer, 100
  7631.         SetTimer, KillTimer, 100
  7632.         SetTimer, SearchEnemyTimer, 2500
  7633.         SetTimer, FriendsTimer, 1000
  7634.         SetTimer, GasstationsTimer, 500
  7635.     }
  7636. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement