Was genau muss ich tun, damit es funktioniert? [AHK+PHP]

  • Guten Abend,
    Ich arbeite zurzeit an einen Robbinder für RPG-City.
    Nun komme ich bei den PHP-Sachen nichtmehr weiter, damit alle Abfragen usw korrekt laufen und geloggt werden usw.
    Wäre es möglich, dass mir Leute hier beihelfen könnten?
    Der Code:
    #Include API.ahk
    #Include JSON_Lib.ahk
    #NoEnv
    #IfWinActive, GTA:SA:MP
    #SingleInstance
    Menu, Tray, NoStandard
    Menu, Tray, Add , Schließen, GuiClose


    ;~ loadini()
    Progress, b w500, Lese Spielername, Lade Variablen, Keybinderstart
    Progress, 1, Lese Spielername, Lade Variablen, Keybinderstart
    global baseURL := "http://5.83.161.232/abfragen/"
    Progress, 5, Lese Spielername, Lade Variablen, Keybinderstart
    RegRead, username, HKCU, Software\SAMP, PlayerName


    Progress, 10, Überprüfe Hintergrundbild
    IfNotExist, bg.png
    Progress, 15, Downloade Hintergrundbild
    URLDownloadToFile, http://5.83.161.232/bg.png, bg.png
    Progress, 20, Überprüfe Whitelist
    keybinderVersion := 1.3
    global username := GetUsername()


    if(username == "")
    {
    RegRead, username, HKCU, Software\SAMP, PlayerName
    }
    Progress, 25, Überprüfe Whitelist
    url = http://5.83.161.232/abfragen/check.php?name=%username%
    UrlDownloadtoVar(url, result)
    if(result == 0 || result == -1 || result == -2)
    {
    Progress, 100, Whitelist Fehler!
    MsgBox, 16, Fehler, Du stehst nicht auf der Whitelist`, bitte kontaktiere den Crewleader, 4
    Progress, off
    ExitApp
    } else {
    Progress, 35, Whitelist OK!
    VarSetCapacity(url, -1)
    VarSetCapacity(result, -1)
    }


    Progress, 40, Überprüfe Keybinderversion
    urli = http://5.83.161.232/version.txt
    URLDownloadToVar(urli, result_)
    if(result_ > keybinderVersion)
    {
    Progress, 50, Neue Keybinderversion gefunden
    MsgBox, 68, Update verfügbar, Lieber Benutzer,`nes ist ein neues Update für den Keybinder verfügbar ( Version %result_% ).`nMöchtest Du nun updaten?
    IfMsgBox, Yes
    {
    Progress, 100, Download Keybinderversion
    MsgBox, 68, Update wird heruntergeladen!, Das Update wird nun heruntergeladen, 3
    URLDownloadToFile, http://5.83.161.232/updater.exe, updater.exe
    MsgBox, 68, Updater start, Der Updater wird nun gestartet und der Keybinder geschlossen., 3
    run, updater.exe
    Progress, off
    ExitApp
    }
    }


    Progress, 80, Downloade Infoboxtext
    URLDownloadToFile, http://5.83.161.232/abfragen/info.txt, info.txt
    FileRead, infobox, info.txt
    Loop, Parse, infobox, \n
    StringReplace, infobox, infobox, \n, `n
    FileDelete, info.txt


    Progress, 90, Lade Variablen
    prefix := "|{01DF01}Crewbinder{FFFFFF}| "
    robstore := 0
    bkcall := 0
    needbk := 0
    fischers := 1
    Settimer, variableclear, 500
    global updated := false


    global stores := -1


    Loop, 10
    {
    IniRead, HK%A_Index%, Robbinder.ini, Hotkey, %A_Index%, Keine
    if(HK%A_Index% != "Keine")
    Hotkey, % HK%A_Index%, HotKey%A_Index%, On
    }



    Loop, 10
    {
    IniRead, HK%A_Index%, Robbinder.ini, Hotkey, %A_Index%, Keine
    StringReplace, HK%A_Index%, HK%A_Index%, ~,,
    }


    Progress, 95, Starte Keybinder....
    IniRead, Backup, Robbinder.ini, Einstellungen, backup, 0
    ;~ IniRead, Storeshow, Robbinder.ini, Einstellungen, Store, 2


    Gui, Add, Picture, x-5 y-5 w890 h640 , %A_ScriptDir%/bg.png
    Gui, Font, S10 CWhite Bold, Arial
    Gui, Add, Text, x7 y2 +BackgroundTrans, Befehl
    Gui, Add, Text, x130 y2 +BackgroundTrans, Hotkey




    Gui, Add, Text, x7 y40 +BackgroundTrans, Ausrauben
    Gui, Add, Hotkey, x130 y40 w150 h30 vHK1 gLabel, %HK1%


    Gui, Add, Text, x7 y100 +BackgroundTrans, Alle Stores
    Gui, Add, Hotkey, x130 y100 w150 h30 vHK2 gLabel, %HK2%


    Gui, Add, Text, x7 y160 +BackgroundTrans, Backup anfordern
    Gui, Add, Hotkey, x130 y160 w150 h30 vHK3 gLabel, %HK3%


    Gui, Add, Text, x7 y220 +BackgroundTrans, Kein Backup
    Gui, Add, Hotkey, x130 y220 w150 h30 vHK4 gLabel, %HK4%


    Gui, Add, Text, x7 y280 +BackgroundTrans, Fische essen
    Gui, Add, Hotkey, x130 y280 w150 h30 vHK5 gLabel, %HK5%


    Gui, Add, Text, x7 y340 +BackgroundTrans, Drogen nehmen
    Gui, Add, Hotkey, x130 y340 w150 h30 vHK6 gLabel, %HK6%


    Gui, Add, Text, x7 y400 +BackgroundTrans, Paket nehmen
    Gui, Add, Hotkey, x130 y400 w150 h30 vHK7 gLabel, %HK7%


    Gui, Add, Text, x7 y460 +BackgroundTrans, Position (Crew)
    Gui, Add, Hotkey, x130 y460 w150 h30 vHK8 gLabel, %HK8%


    Gui, Add, Text, x300 y520 +BackgroundTrans, Position (Fraktion)
    Gui, Add, Hotkey, x423 y520 w150 h30 vHK9 gLabel, %HK9%


    Gui, Add, Text, x7 y520 +BackgroundTrans, Stellen
    Gui, Add, Hotkey, x130 y520 w150 h30 vHK10 gLabel, %HK10%


    Gui, Add, Text, x300 y128 +BackgroundTrans, Informationsbox
    Gui, Add, Groupbox, x300 y135 w300 h350 +BackgroundTrans,



    Gui, Add, Button, x500 y20 w100 h30 gest, Einstellungen
    Gui, Add, Button, x500 y60 w100 h30 gback, Speichern
    Gui, Add, Button, x500 y100 w100 h30 gGuiClose, Schließen


    Gui, Font, S9 CWhite, Arial
    Gui, Add, Text, x305 y145 w290 h340 +BackgroundTrans, %infobox%


    Gui, Show, w624 h600, Crewkeybinder
    Progress, 100, Keybinder geladen. Viel Spaß!
    Settimer, progressbar, 2000
    return


    progressbar:
    Settimer, progressbar, off
    Progress, off
    return


    GuiClose:
    ExitApp
    return


    back:
    Reload
    return





    est:
    Gui, 2:Add, Picture, x-158 y-65 w1646 h854 , %A_ScriptDir%\bg.png
    Gui, 2:Add, Button, x10 y455 w100 h30 gsave, Speichern
    Gui, 2:Add, Button, x125 y455 w100 h30 gback, Zurück
    Gui, 2:Font, S8 CWhite, Verdana
    Gui, 2:Add, Text, x36 y103 w208 h19 +BackgroundTrans, Backup im /f-Chat mit anfordern?
    Gui, 2:Add, CheckBox, x11 y105 w12 h12 +BackgroundTrans, vBackup Checked%Backup%,
    Gui, 2:Show, w598 h509, Einstellungen
    return


    save:
    return





    Label: ;{
    if %A_GuiControl% in +,^,!,+^,+!,^!,+^!
    return
    num := SubStr(A_GuiControl, 3)
    if(savedHK%num%) {
    Hotkey,% savedHK%num%, HotKey%num%, Off
    savedHK%num% .= " OFF"
    IniWrite, Keine, Robbinder.ini, Hotkey, %num%
    }
    if(%A_GuiControl% = "") {
    IniWrite, Keine, Robbinder.ini, Hotkey, %num%
    savedHK%num% =
    return
    }
    Gui, Submit, NoHide
    if(StrLen(%A_GuiControl%) == 1)
    %A_GuiControl% := "~" %A_GuiControl%
    if(InStr(%A_GuiControl%, "Numpad"))
    %A_GuiControl% := "~" %A_GuiControl%
    Hotkey,% %A_GuiControl%, HotKey%num%, On
    savedHK%num% := %A_GuiControl%
    IniWrite, % %A_GuiControl%, Robbinder.ini, Hotkey, %num% ;}
    return


    variableclear:
    out := ""
    out1 := ""
    out2 := ""
    out3 := ""
    out4 := ""
    out2_1 := ""
    out2_2 := ""
    out2_ := ""
    output := ""
    member := ""
    member1 := ""
    result := ""
    return


    ; #### TIMER ####
    robtimer:
    if (robstore == 0) {
    SetTimer, robstore, off
    SetTimer, RobTimer, Off
    return
    } else if ((Mod(robstore, 30) == 0) || (robstore <= 15 && Mod(robstore, 5) == 0)) {
    AddChatMessage(prefix . "Der Store-Rob dauert noch " . SECCOL . robstore . " Sekunden{FFFFFF}!")
    }
    robstore--
    return


    robstore:
    Line1 := GetChatLine(0)
    Line2 := GetChatLine(1)
    if(Instr(Line2, getUsername() " hat ein Store im GK")){
    SetTimer, robstore, off
    RegExMatch(Line2, getUsername() " hat ein Store im GK (.+) erfolgreich überfallen. Beute: (.*)\$", regex_)
    URLDownloadToVar(baseURL . "updaterob.php?success=1&name=" username "&gk=" regex_1 "&money=" regex_2, output)
    StringSplit, out, output, ~
    errors(out1)
    if(out1 == "NO_ERROR")
    {
    AddChatMessage(prefix . "Dies ist dein erfolgreicher Raub Nummer: " out2)
    AddChatMessage(prefix . "Du hast bereits " out3 "$ eingenommen.")
    if(InStr(out4, "NO_ERROR"))
    {
    StringReplace, out4, out4, NO_ERROR,
    }


    AddChatMessage(prefix . "Davon diese Woche " out4 "$")


    }
    } else if(InStr(Line1, "Der Überfall von " getUsername() " ist gescheitert"))
    {
    IniRead, gekkom, Robbinder.ini, GK, gk
    SetTimer, robstore, off
    URLDownloadToVar(baseURL . "updaterob.php?success=0&name=" username "&gk=" gekkom "&money=0", out)
    StringSplit, out2_, out, ~
    errors(out2_1)
    if(out2_1 == "NO_ERROR")
    {
    AddChatMessage(prefix . "Dies ist dein misslungener Raub Nummer: " FormatNumber(out2_2))
    }
    }
    return


    ; #### Hotkey ####


    :?:t/cops::
    coplist := 2
    copscount := 0
    UrlDownloadToVar("http://5.83.161.232/abfragen/allcops.php", result)
    Loop, Parse, result, ~
    {
    RegExMatch(A_LoopField, "(\S+)", member)
    id := getPlayerIdByName(member1)
    if (member1 != "") {
    if (id != -1) {
    if (StrLen(member1) > 14) {
    tab := "`t"
    } else if (StrLen(member1) > 6) {
    tab := "`t`t"
    } else {
    tab := "`t`t`t"
    }
    AddChatMessage("{0B610B} " . member1 . "{FF8000}" . tab "`t`t [ID: " . id "]")
    copscount++


    }
    }
    }
    if(copscount != 0)
    {
    AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Es sind " copscount " Cops online")
    } else if(copscount == 0){
    AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Es sind 0 Cops online")
    }
    return


    :?:t/addcop::
    Suspend Permit
    playername := GetUsername()
    cname := PlayerInput("/Cop-Name: ")
    if(cname is number)
    cname := GetPlayerNameByID(cname)
    url = http://5.83.161.232/abfragen/addcop.php?name=%cname%&uname=%playername%
    URLDownloadToVar(url, result)
    if(result == 1 || result == 11)
    {
    AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Du hast den Cop " cname " hinzugefügt")
    } else {
    AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Fehler: " result)
    }
    return


    :?:t/delcop::
    Suspend Permit
    username := GetUsername()
    cname := PlayerInput("/Cop-Name: ")
    url = http://5.83.161.232/abfragen/delcop.php?name=%cname%&uname=%username%
    URLDownloadToVar(url, result)
    if(result == 1)
    {
    AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Du hast den Cop " cname " gelöscht")
    } else {
    AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Fehler: " result)
    }
    return




    :?:t/cpstats::
    URLDownloadToVar(baseURL . "stats.php?name=" username, result)
    StringSplit, out, result, ~
    errors(out1)
    if(out1 == "NO_ERROR")
    {
    AddChatMessage(prefix . "Ausgeraubte Stores: " FormatNumber(out3) ", dadurch eingenommenes Geld: " FormatNumber(out2) "$")
    AddChatMessage(prefix . "Ausgeraubte Stores (Woche): " FormatNumber(out4) ", dadurch eingenommenes Geld: " FormatNumber(out5) "$")
    }
    return





    HotKey1:
    if(IsInChat())
    return
    if(getPlayerInteriorID() == 0)
    {
    loadStores()
    showNearestStore()
    } else {
    SendChat("/robstore")
    Sleep 100
    Line1 := GetChatLine(0)
    Line2 := GetChatLine(1)
    if(InStr(Line1, "Du raubst nun diesen Store aus")){
    RegExMatch(Line2, "hat ein Überfall im GK (.+) \((.+)\) gestartet", rob_)
    IniWrite, %rob_1%, Robbinder.ini, GK, gk
    gekkom := rob_1
    store := rob_2
    URLDownloadToVar(baseURL . "addrob.php?name=" username "&gk=" gekkom "&store=" store, out2)
    StringSplit, out, out2, ~
    errors(out1)
    if(out1 == "NO_ERROR") {
    AddChatMessage(prefix . "Dies ist dein Storeraub Nummer: " FormatNumber(out2))
    robstore := 89
    Settimer, robstore, 1000
    Settimer, robtimer, 1000
    }
    } else if (RegExMatch(Line1, "Gestartet von der Rebellen Crew (.+), Beute: (\d+)\$", chat0_)) {
    if (RegExMatch(Line2, "Dieser Store wurde bereits ausgeraubt \(noch (.+) gesperrt\)\.", chat1_)) {
    if (RegExMatch(Line2, "noch (\d+) Stunden und (\d+) Minuten", time)) {
    robbing := A_Now
    if(time1 == 1)
    {
    robbing = %A_Now%
    robbing += time1, Hours
    robbing += time2, Minutes
    }
    } else if(RegExMatch(Line2, "noch (\d+) Minuten", time)){


    if(A_Min < 30)
    {
    robbing = %A_Now%
    robbing += time1, Minutes
    }


    }
    robtime := ToUnix(robbing)
    SendChat("/crewmembers")
    Sleep 400
    Line1 := GetChatLine(0)
    members_1 := 0
    counting := 1
    username := getUsername()
    if(InStr(Line1, "Es sind")){
    RegExMatch(Line1, "Es sind (.*) Mitglieder online", members_)
    }
    Loop, %members_1%
    {
    chat := GetChatLine(A_Index)


    if(InStr(chat, username ", Rang") || InStr(chat, username ", {A30000}")){
    RegExMatch(chat, getUsername() . ", (.+) \((.+)\), GK (.+)", chat_)
    if (InStr(chat_3, "10.")) {
    if (IsPlayerInRangeOfPoint(0, -17, 1003, 20)) {
    store := "SM"
    } else if (IsPlayerInRangeOfPoint(372.5, -66, 1001, 20)) {
    store := "BS"
    }
    } else if(InStr(chat_3, "15.")) {
    store := "CS"
    } else if (InStr(chat_3, "9.")) {
    store := "CB"
    } else if (InStr(chat_3, "5.")) {
    store := "PS"
    }
    if(members_1 >= 10)
    {
    AddChatMessage("Dieser Store wurde bereits ausgeraubt und ist noch " chat1_1 " gesperrt.")
    }
    URLDownloadToVar(baseURL . "updatestore.php?name=" username "&gk=" chat_3 "&robtime=" robtime "&store=" store, out2)
    StringSplit, out, out2, ~
    errors(out1)
    if(out1 == "NO_ERROR") {
    AddChatMessage(prefix . "Der Store wurde geupdatet.")


    }
    return
    }
    counting++
    }
    }
    }
    }
    return


    Hotkey2:
    if(IsInChat())
    return
    showStores()
    return


    Hotkey3:
    if(IsInChat())
    return
    zone := GetPlayerZone()
    city := GetPlayerCity()
    hp := GetPlayerHealth()
    id := getID()
    if(bkcall == 0){
    SendChat("/crew Ich benötige Verstärkung in " zone ", " city ". ID: " id " | HP: " hp)
    bkcall := 1
    needbk := 1
    if(backup == 1)
    {
    SendChat("/f Ich benötige Verstärkung in " zone ", " city ". ID: " id " | HP: " hp)
    }
    } else if(bkcall == 1){
    SendChat("/crew Ich benötige DRINGEND Verstärkung in " zone ", " city ". ID: " id " | HP: " hp)
    bkcall := 0
    needbk := 1
    if(backup == 1)
    {
    SendChat("/f Ich benötige DRINGEND Verstärkung in " zone ", " city ". ID: " id " | HP: " hp)
    }
    }
    return


    Hotkey4:
    if(IsInChat())
    return
    if(needbk == 1)
    {
    SendChat("/crew Ich benötige keine Verstärkung mehr.")
    if(backup == 1)
    SendChat("/f Ich benötige keine Verstärkung mehr.")
    }
    return


    Hotkey5:
    if(IsInChat())
    return
    SendChat("/eat " . fischers . "")
    fischers++
    if(fischers == 6){
    AddChatMessage(prefix . "Du besitzt keine Fische mehr!")
    fischers := 1
    }
    return


    Hotkey6:
    if(IsInChat())
    return
    SendChat("/usedrugs")
    return


    Hotkey7:
    if(IsInChat())
    return
    SendChat("/erstehilfe")
    return


    Hotkey8:
    if(IsInChat())
    return
    zone := GetPlayerZone()
    city := GetPlayerCity()
    id := GetID()
    SendChat("/crew Ich befinde mich in " zone ", " city " | ID: " id)
    return


    Hotkey9:
    if(IsInChat())
    return
    zone := GetPlayerZone()
    city := GetPlayerCity()
    id := GetID()
    SendChat("/f Ich befinde mich in " zone ", " city " | ID: " id)
    return


    Hotkey10:
    if(IsInChat())
    return
    zone := GetPlayerZone()
    city := GetPlayerCity()
    id := GetID()
    hp := GetPlayerHealth()
    Loop, 3
    SendChat("/s Ich stelle mich, nicht schießen!")
    SendChat("/hide")
    Sleep 500
    AddChatMessage(prefix . "Möchtest Du einen Wheelman rufen, so drücke 'X'")
    KeyWait, X, D, T5
    if !ErrorLevel
    {
    SendChat("/service")
    Sleep 500
    Send, {Down}
    Sleep 100
    Send, {Down}
    Sleep 100
    Send, {Down}
    Send, {Down}
    Sleep 100
    Send, {Down}
    Sleep 100
    Send, {Down}
    Sleep 100
    Send, {Enter}


    }
    return


    :?:/gkc::
    Suspend Permit
    gk := PlayerInput("Welchen GK suchst du? ")
    if(gk=="")
    return
    gk_search(gk)
    return



    gk_search(gk)
    {
    if(!RegExMatch(gk, "^\s*(\d+)\.(\d+)\s*$", regex_))
    {
    AddChatMessage("Deine Angabe ist ungültig")
    return
    }
    URLDownloadToVar("http://samp.lennartf.com/gkapi/query/" regex_1 "/" regex_2 "", res)
    if(!InStr(res, "success"))
    {
    AddChatMessage("Die vom Server erhaltenen Daten sind fehlerhaft. Versuche es (später) erneut")
    return
    }
    AddChatMessage("{FFFFFF}Es wurden folgende Gebäudekomplexe unter {0077FF}" gk "{FFFFFF} gefunden:")
    Loop, parse, res, `n
    {
    if(RegExMatch(A_LoopField, "^([^`t]*)`t([^`t]*)`t([^`t]*)`t([^`t]*)`t([^`t]*)", regex_))
    {
    if(regex_1 == "generic")
    color := "{FF7F00}"
    else if(regex_1 == "house")
    color := "{77FF00}"
    else if(regex_1 == "vehicle")
    {
    color := "{DD11FF}"
    AddChatMessage("{FFFFFF}" A_Index-1 ". " color regex_2 "")
    return
    }
    AddChatMessage("{FFFFFF}" A_Index-1 ". " color regex_2 " {FFFFFF}in " color regex_5)
    }
    }
    }


    /*
    ~LButton::
    Sleep, 200
    if (isDialogOpen()) {
    AddChatMessage("1")
    if (RegExMatch(getDialogCaption(), "Übersicht der Stores")) {
    AddChatMessage("2")
    line := getDialogLine(getDialogIndex())
    AddChatMessage(line)
    if (RegExMatch(line, "(\S+)`t(\S+)`t(.+)`t(.+)", line_)) {
    AddChatMessage("3")
    type := line_1
    gk := line_2
    for index, entry in stores["stores"] {
    if (entry["store"] == type && entry["gk"] == gk) {
    if (RegExMatch(type, "{(\S+)}(\S+)", type_)) {
    type := type_2
    }
    x := entry["x"]
    y := entry["y"]
    z := entry["z"]
    playerCoords := getCoordinates()
    distance := Round(GetDistanceBetween(x, y, z, playerCoords[1], playerCoords[2], playerCoords[3]))
    setCheckpoint(x, y, z, 3)
    AddChatMessage(prefix . "Store " . gk . " {FFFFFF}(" . type . ") in " . calculateZone(x, y, z) . " {FFFFFF}(" . distance . "m {FFFFFF}entfernt): " . line_4)
    }
    }
    }
    }
    }
    return
    */


    /*
    loadini(){
    RegRead, username, HKCU, Software\SAMP, PlayerName
    robstore := 0
    bkcall := 0
    needbk := 0
    fischers := 1
    Loop, 9
    {
    IniRead, HK%A_Index%, Robbinder.ini, Hotkey, %A_Index%, Keine


    if(HK%A_Index% != "Keine")
    Hotkey, % HK%A_Index%, HotKey%A_Index%, On
    }
    Loop, 9
    {
    IniRead, HK%A_Index%, Robbinder.ini, Hotkey, %A_Index%, Keine
    StringReplace, HK%A_Index%, HK%A_Index%, ~,,
    }
    IniRead, Backup, Robbinder.ini, Einstellungen, backup, 0
    IniRead, Storeshow, Robbinder.ini, Einstellungen, Store, 2
    }
    */



    errors(output){
    if(output != "NO_ERROR"){
    AddChatMessage(prefix . "{FF0000} Fehler: " output " --- Bitte an John_Reese wenden")
    return
    }
    }




    showNearestStore() {
    if (!updated) {
    loadStores()
    }
    storeCount := stores.Length() - 1
    string := "Typ`tGK`tOrt`tDistanz`n"
    coords := GetCoordinates()
    playerX := coords[1]
    playerY:= coords[2]
    playerZ:= coords[3]
    Loop %storeCount%
    {
    maxDist := 99999
    id := 0


    Loop %storeCount%
    {
    dist := GetDistanceBetween(playerX, playerY, playerZ, stores[A_Index][3], stores[A_Index][4], stores[A_Index][5]) ;FindGroundZForPosition(storeList[A_Index][3], storeList[A_Index][4])
    if(dist < maxDist)
    {
    maxDist := dist
    maxDist := Round(maxDist, 0)
    id := A_Index
    }
    else
    continue


    type := stores[A_Index][1]
    gk := stores[A_Index][2]
    zone := calculateZone(stores[A_Index][3], stores[A_Index][4], stores[A_Index][5])
    city := calculateCity(stores[A_Index][3], stores[A_Index][4], stores[A_Index][5])


    if(type == "BS")
    type := "{8A4B08}BS"
    else if(type == "CB")
    type := "{F7BE81}CB"
    else if(type == "CS")
    type := "{81F7F3}CS"
    else if(type == "PS")
    type := "{FFFF00}PS"
    else if(type == "SM")
    type := "{00FF00}SM"
    }


    string .= type . "`t" . gk . "`t" . zone . "`t" . maxDist . "m`n"
    stores[id][3] := 99999
    stores[id][4] := 99999
    }
    string .= "Keine weitere freie Stores gefunden"
    ShowDialog(5, "{FFFFFF}Übersicht der Stores", string, "Schließen")
    stores := ""
    string := ""
    updated := false
    }


    loadStores() {
    URLDownloadToVar(baseURL . "loadstores.php", result)
    stores := JSON.Load(result)
    updated := true
    }


    loadStores2() {
    URLDownloadToVar(baseURL . "loadstores2.php", result)
    stores := JSON.Load(result)
    updated := true
    }


    showStores() {
    if (!updated) {
    loadStores2()
    }


    storeCount := stores.Length() - 1
    string := "{FFFFFF}Typ`tGK`tOrt`tStatus`n"
    currentTime := ToUnix(A_Now)


    Loop %storeCount%
    {
    type := stores[A_Index][1]
    gk := stores[A_Index][2]
    zone := calculateZone(stores[A_Index][3], stores[A_Index][4], stores[A_Index][5])
    city := calculateCity(stores[A_Index][3], stores[A_Index][4], stores[A_Index][5])
    time := stores[A_Index][6]


    if(type == "BS")
    type := "{8A4B08}BS"
    else if(type == "CB")
    type := "{F7BE81}CB"
    else if(type == "CS")
    type := "{81F7F3}CS"
    else if(type == "PS")
    type := "{FFFF00}PS"
    else if(type == "SM")
    type := "{00FF00}SM"


    if(currentTime - time > 900){
    state := "{FA5858}unbekannt"
    status := 0
    } else if(currentTime > time){
    state := "{58FA58}frei seit " . Floor((currentTime - time) / 60) . " Min."
    status := 1
    } else {
    state := "{F4FA58}gesperrt für " . Floor((time - currentTime) / 60) . " Min."
    status := 0
    }


    string .= type . "`t" . gk . "`t" . zone . "`t" . state . "`n"
    }
    ShowDialog(5, "{FFFFFF}Übersicht der Stores", string, "Schließen")
    stores := ""
    string := ""
    updated := false
    }


    ToUnix(T)
    {
    FormatTime Y, %T%, yyyy
    FormatTime D, %T%, YDay
    FormatTime H, %T%, H
    FormatTime M, %T%, m
    FormatTime S, %T%, s


    return (31536000 * (Y - 1970) + (D + Floor((Y - 1972) / 4)) * 86400 + H * 3600 + M * 60 + S)
    }


    Danke für die Hilfe!

  • Am besten wäre es, wenn du die Zeilen, die nicht so funktionieren wie du es willst, rauskopierst und erklärst, was du vorhattest und was genau aber nicht funktioniert. Ich glaube niemand hat vor, sich durch fast 800 Zeilen Code zu lesen.

  • Am besten wäre es, wenn du die Zeilen, die nicht so funktionieren wie du es willst, rauskopierst und erklärst, was du vorhattest und was genau aber nicht funktioniert. Ich glaube niemand hat vor, sich durch fast 800 Zeilen Code zu lesen.

    Es geht hauptsächlich um die .php Sachen.
    Ich weiß grade nicht genau wie ich die erstellen muss, damit alles Scripttechnisch funktioniert..

  • Ändert nichts an dem, was ich geschrieben habe. Gib uns ein Beispiel und nicht 800 Zeilen an Code.


    [list=1][*]:?:t/cops::
    [*]coplist := 2
    [*]copscount := 0
    [*]UrlDownloadToVar("http://5.83.161.232/abfragen/allcops.php", result)
    [*]Loop, Parse, result, ~
    [*]{
    [*]RegExMatch(A_LoopField, "(\S+)", member)
    [*]id := getPlayerIdByName(member1)
    [*]if (member1 != "") {
    [*]if (id != -1) {
    [*]if (StrLen(member1) > 14) {
    [*]tab := "`t"
    [*]} else if (StrLen(member1) > 6) {
    [*]tab := "`t`t"
    [*]} else {
    [*]tab := "`t`t`t"
    [*]}
    [*]AddChatMessage("{0B610B} " . member1 . "{FF8000}" . tab "`t`t [ID: " . id "]")
    [*]copscount++
    [*]
    [*]}
    [*]}
    [*]}
    [*]if(copscount != 0)
    [*]{
    [*]AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Es sind " copscount " Cops online")
    [*]} else if(copscount == 0){
    [*]AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Es sind 0 Cops online")
    [*]}
    [*]return
    [/list]
    Hier zum Beispiel... Ich weiß nicht wie genau ich die PHP erstellen muss, damit es funktioniert.

  • Einfach Loop, Parse, result, %A_Space% statt der Tilde. Da in einem Spielernamen kein Leerzeichen sein kann, kannst du wie du es ja schon getan hast, einfach die Namen mit einem Leerzeichen trennen und so eben auch auslesen.

  • Einfach Loop, Parse, result, %A_Space% statt der Tilde. Da in einem Spielernamen kein Leerzeichen sein kann, kannst du wie du es ja schon getan hast, einfach die Namen mit einem Leerzeichen trennen und so eben auch auslesen.

    Funktioniert nicht. Er liest nur den ersten Namen aus, aber die nächsten werden dann nicht ausgelesen.

  • Probier einfach mal nur


    PHP
    UrlDownloadToVar("http://5.83.161.232/abfragen/allcops.php", result)
    Loop, Parse, result, %A_Space%
    {
    	AddChatMessage(A_LoopField)
    }

    Letztendlich macht es keinen Unterschied, ob PHP oder TXT oder was auch immer.

  • Probier einfach mal nur


    PHP
    UrlDownloadToVar("http://5.83.161.232/abfragen/allcops.php", result)
    Loop, Parse, result, %A_Space%
    {
    	AddChatMessage(A_LoopField)
    }

    Letztendlich macht es keinen Unterschied, ob PHP oder TXT oder was auch immer.

    Das stimmt allerdings. Das sollte so erstmal reichen.
    Danke schonmal dafür. Jetzt komme ich zum nächsten WICHTIGEN Thema:
    :?:t/cpstats::
    URLDownloadToVar(baseURL . "stats.php?name=" username, result)
    StringSplit, out, result, ~
    errors(out1)
    if(out1 == "NO_ERROR")
    {
    AddChatMessage(prefix . "Ausgeraubte Stores: " FormatNumber(out3) ", dadurch eingenommenes Geld: " FormatNumber(out2) "$")
    AddChatMessage(prefix . "Ausgeraubte Stores (Woche): " FormatNumber(out4) ", dadurch eingenommenes Geld: " FormatNumber(out5) "$")
    }
    return

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Auch hier wieder die Frage, wie ist die stats.php aufgebaut bzw. was gibt die Query aus. Du kannst ja mal erläutern, warum du ~ als Delimiter verwendest.

    Stimmt. Das Problem habe ich selbst jetzt schon behoben.


    Das hier ist zurzeit noch mega dringend, damit auch die Nutzer des Binders die Liste der Cops aktuell halten können..
    :?:t/addcop::
    Suspend Permit
    playername := GetUsername()
    cname := PlayerInput("/Cop-Name: ")
    if(cname is number)
    cname := GetPlayerNameByID(cname)
    url = http://5.83.161.232/abfragen/addcop.php?name=%cname%&uname=%playername%
    URLDownloadToVar(url, result)
    if(result == 1 || result == 11)
    {
    AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Du hast den Cop " cname " hinzugefügt")
    } else {
    AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Fehler: " result)
    }
    return


    :?:t/delcop::
    Suspend Permit
    username := GetUsername()
    cname := PlayerInput("/Cop-Name: ")
    url = http://5.83.161.232/abfragen/delcop.php?name=%cname%&uname=%username%
    URLDownloadToVar(url, result)
    if(result == 1)
    {
    AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Du hast den Cop " cname " gelöscht")
    } else {
    AddChatMessage("|{01DF01}Wheelman{FFFFFF}| Fehler: " result)
    }
    return