~6 Error, Switch Funktion, bitte lesen~

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo,


    ich habe hier einen Auschnitte aus meinem Script.
    Dort sind 6 Errors und ich weiß nicht, woher diese kommen - ich bitte um Hilfe!



    #include <a_samp>


    #define COLOR_LIGHTGREEN 0x86FF59FF
    #define COLOR_RED 0xFF0000FF
    #define COLOR_GREEN 0x00CA00FF



    new auftrag1[MAX_PLAYERS];




    public OnPlayerEnterCheckpoint(playerid)
    {
    switch(auftrag1)
    {
    case 1:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 199.2657,-1379.1980,49.4461, 5.0);
    auftrag1[playerid] = 2
    }
    case 2:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 284.5833,-1252.7310,74.2073, 5.0);
    auftrag1[playerid] = 3
    case 3:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 548.7088,-1195.9177,45.0756, 5.0);
    auftrag1[playerid] = 4
    case 4:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 566.0327,-1138.8364,51.6114, 5.0);
    auftrag1[playerid] = 5
    case 5:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 468.4139,-1179.8032,64.6608, 5.0);
    auftrag1[playerid] = 6
    case 6:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 388.0745,-1162.3539,79.1744, 5.0);
    auftrag1[playerid] = 7
    case 7:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 484.8989,-1079.7264,82.7310, 5.0);
    auftrag1[playerid] = 8
    case 8:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 565.2359,-1054.3549,74.6838, 5.0);
    auftrag1[playerid] = 9
    case 9:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 978.4000,-810.9236,98.6700, 5.0);
    auftrag1[playerid] = 10
    case 10:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 944.1165,-759.0430,108.2155 5.0);
    auftrag1[playerid] = 11
    case 11:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 943.8287,-695.3416,122.3382, 5.0);
    auftrag1[playerid] = 12
    case 12:
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1006.3703,-636.4201,121.1949, 5.0);
    auftrag1[playerid] = 13
    case 13:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1286.2035,-607.0198,101.9000, 5.0);
    auftrag1[playerid] = 14
    case 14:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1402.2178,-645.8114,90.7170, 5.0);
    auftrag1[playerid] = 15
    case 15:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1078.7463,-768.8945,108.4876, 5.0);
    auftrag1[playerid] = 16
    case 16:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1021.7408,-779.8043,103.3206, 5.0);
    auftrag1[playerid] = 17
    case 17:
    {
    SendClientMessage(playerid, COLOR_LIGHTGREEN, "**Auftrag beendet!**");
    SendClientMessage(playerid, COLOR_LIGHTGREEN, "**Lohnabrechnung: 100.000$");
    GivePlayerMoney(i,100000);
    return 1;
    }






    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == Auftragsmenu)
    {
    if(response)
    {
    if(listitem == 0) // Entsorgung: Mullholland
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    new model = GetVehicleModel(vehicleid);
    if(model == 408)
    {
    SetPlayerCheckpoint(playerid, 118.0383,-1481.3660,17.5473, 5.0);
    auftrag1[playerid] = 1;
    }



    Error's:



    Vielen Dank im Vorraus! :love:

  • und Sehr Sehr Sehr viele Klammerfehler ^^ Hier das gefixxte:


    public OnPlayerEnterCheckpoint(playerid)
    {
    switch(auftrag1)
    {
    case 1:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 199.2657,-1379.1980,49.4461, 5.0);
    auftrag1[playerid] = 2;
    }
    case 2:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 284.5833,-1252.7310,74.2073, 5.0);
    auftrag1[playerid] = 3;
    }
    case 3:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 548.7088,-1195.9177,45.0756, 5.0);
    auftrag1[playerid] = 4;
    }
    case 4:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 566.0327,-1138.8364,51.6114, 5.0);
    auftrag1[playerid] = 5;
    }
    case 5:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 468.4139,-1179.8032,64.6608, 5.0);
    auftrag1[playerid] = 6;
    }
    case 6:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 388.0745,-1162.3539,79.1744, 5.0);
    auftrag1[playerid] = 7;
    }
    case 7:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 484.8989,-1079.7264,82.7310, 5.0);
    auftrag1[playerid] = 8;
    }
    case 8:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 565.2359,-1054.3549,74.6838, 5.0);
    auftrag1[playerid] = 9;
    }
    case 9:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 978.4000,-810.9236,98.6700, 5.0);
    auftrag1[playerid] = 10;
    }
    case 10:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 944.1165,-759.0430,108.2155 5.0);
    auftrag1[playerid] = 11;
    }
    case 11:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 943.8287,-695.3416,122.3382, 5.0);
    auftrag1[playerid] = 12;
    }
    case 12:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1006.3703,-636.4201,121.1949, 5.0);
    auftrag1[playerid] = 13;
    }
    case 13:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1286.2035,-607.0198,101.9000, 5.0);
    auftrag1[playerid] = 14;
    }
    case 14:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1402.2178,-645.8114,90.7170, 5.0);
    auftrag1[playerid] = 15;
    }
    case 15:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1078.7463,-768.8945,108.4876, 5.0);
    auftrag1[playerid] = 16;
    }
    case 16:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1021.7408,-779.8043,103.3206, 5.0);
    auftrag1[playerid] = 17;
    }
    case 17:
    {
    SendClientMessage(playerid, COLOR_LIGHTGREEN, "**Auftrag beendet!**");
    SendClientMessage(playerid, COLOR_LIGHTGREEN, "**Lohnabrechnung: 100.000$");
    GivePlayerMoney(i,100000);
    }
    }
    return 1;
    }

    Mfg Templer


    >>Dein Breadfish-Thema im Unterforum ScriptingBase / Scriptingwünsche wurde nicht richtig beantworter?<<
    >>Es handelt sich um ein Programmier Problem und du nicht einfach weiter kommst wo der Fehler sein könnte?<<
    Dann melde dich bei mir über die PN-Funktion indem du den Link zu deinem Breadfish-Themen Problem schickst.
    Voraussetzung:
    Thema älter als 1 Tag und im Breadfish Forum gespostet!

  • Danke erstmal!


    Jetzt habe ich trotzdessen noch 5 Error :cursing:



    #include <a_samp>


    #define COLOR_LIGHTGREEN 0x86FF59FF
    #define COLOR_RED 0xFF0000FF
    #define COLOR_GREEN 0x00CA00FF



    new auftrag1[MAX_PLAYERS];




    public OnPlayerEnterCheckpoint(playerid)
    {
    switch(auftrag1)
    {
    case 1:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 199.2657,-1379.1980,49.4461, 5.0);
    auftrag1[playerid] = 2;
    }
    case 2:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 284.5833,-1252.7310,74.2073, 5.0);
    auftrag1[playerid] = 3;
    }
    case 3:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 548.7088,-1195.9177,45.0756, 5.0);
    auftrag1[playerid] = 4;
    }
    case 4:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 566.0327,-1138.8364,51.6114, 5.0);
    auftrag1[playerid] = 5;
    }
    case 5:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 468.4139,-1179.8032,64.6608, 5.0);
    auftrag1[playerid] = 6;
    }
    case 6:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 388.0745,-1162.3539,79.1744, 5.0);
    auftrag1[playerid] = 7;
    }
    case 7:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 484.8989,-1079.7264,82.7310, 5.0);
    auftrag1[playerid] = 8;
    }
    case 8:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 565.2359,-1054.3549,74.6838, 5.0);
    auftrag1[playerid] = 9;
    }
    case 9:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 978.4000,-810.9236,98.6700, 5.0);
    auftrag1[playerid] = 10;
    }
    case 10:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 944.1165,-759.0430,108.2155 5.0);
    auftrag1[playerid] = 11;
    }
    case 11:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 943.8287,-695.3416,122.3382, 5.0);
    auftrag1[playerid] = 12;
    }
    case 12:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1006.3703,-636.4201,121.1949, 5.0);
    auftrag1[playerid] = 13;
    }
    case 13:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1286.2035,-607.0198,101.9000, 5.0);
    auftrag1[playerid] = 14;
    }
    case 14:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1402.2178,-645.8114,90.7170, 5.0);
    auftrag1[playerid] = 15;
    }
    case 15:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1078.7463,-768.8945,108.4876, 5.0);
    auftrag1[playerid] = 16;
    }
    case 16:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1021.7408,-779.8043,103.3206, 5.0);
    auftrag1[playerid] = 17;
    }
    case 17:
    {
    SendClientMessage(playerid, COLOR_LIGHTGREEN, "**Auftrag beendet!**");
    SendClientMessage(playerid, COLOR_LIGHTGREEN, "**Lohnabrechnung: 100.000$");
    GivePlayerMoney(i,100000);
    }
    }
    return 1;
    }






    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == Auftragsmenu)
    {
    if(response)
    {
    if(listitem == 0) // Entsorgung: Mullholland
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    new model = GetVehicleModel(vehicleid);
    if(model == 408)
    {
    SetPlayerCheckpoint(playerid, 118.0383,-1481.3660,17.5473, 5.0);
    auftrag1[playerid] = 1;
    }




  • So bitte:


    public OnPlayerEnterCheckpoint(playerid)
    {
    switch(auftrag1[playerid])
    {
    case 1:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 199.2657,-1379.1980,49.4461, 5.0);
    auftrag1[playerid] = 2;
    }
    case 2:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 284.5833,-1252.7310,74.2073, 5.0);
    auftrag1[playerid] = 3;
    }
    case 3:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 548.7088,-1195.9177,45.0756, 5.0);
    auftrag1[playerid] = 4;
    }
    case 4:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 566.0327,-1138.8364,51.6114, 5.0);
    auftrag1[playerid] = 5;
    }
    case 5:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 468.4139,-1179.8032,64.6608, 5.0);
    auftrag1[playerid] = 6;
    }
    case 6:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 388.0745,-1162.3539,79.1744, 5.0);
    auftrag1[playerid] = 7;
    }
    case 7:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 484.8989,-1079.7264,82.7310, 5.0);
    auftrag1[playerid] = 8;
    }
    case 8:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 565.2359,-1054.3549,74.6838, 5.0);
    auftrag1[playerid] = 9;
    }
    case 9:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 978.4000,-810.9236,98.6700, 5.0);
    auftrag1[playerid] = 10;
    }
    case 10:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 944.1165,-759.0430,108.2155, 5.0);
    auftrag1[playerid] = 11;
    }
    case 11:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 943.8287,-695.3416,122.3382, 5.0);
    auftrag1[playerid] = 12;
    }
    case 12:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1006.3703,-636.4201,121.1949, 5.0);
    auftrag1[playerid] = 13;
    }
    case 13:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1286.2035,-607.0198,101.9000, 5.0);
    auftrag1[playerid] = 14;
    }
    case 14:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1402.2178,-645.8114,90.7170, 5.0);
    auftrag1[playerid] = 15;
    }
    case 15:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1078.7463,-768.8945,108.4876, 5.0);
    auftrag1[playerid] = 16;
    }
    case 16:
    {
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1021.7408,-779.8043,103.3206, 5.0);
    auftrag1[playerid] = 17;
    }
    case 17:
    {
    SendClientMessage(playerid, COLOR_LIGHTGREEN, "**Auftrag beendet!**");
    SendClientMessage(playerid, COLOR_LIGHTGREEN, "**Lohnabrechnung: 100.000$");
    GivePlayerMoney(i,100000);
    }
    }
    return 1;
    }

    Mfg Templer


    >>Dein Breadfish-Thema im Unterforum ScriptingBase / Scriptingwünsche wurde nicht richtig beantworter?<<
    >>Es handelt sich um ein Programmier Problem und du nicht einfach weiter kommst wo der Fehler sein könnte?<<
    Dann melde dich bei mir über die PN-Funktion indem du den Link zu deinem Breadfish-Themen Problem schickst.
    Voraussetzung:
    Thema älter als 1 Tag und im Breadfish Forum gespostet!