Menü erstellen ... "Weiter" funktioniert nicht

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
  • hi,


    bin jetzt ziemlich ratsam... also zu meinem problem:


    habe zurzeit 2 menüs (wo man sich autos spawnt), habe nun ein drittes erstellt, leider funktioniert das nicht... wenn ich im 2. menü der vehicles bin und auf "weiter" klicke, komme ich wieder zurück zum Vehicle menü 1.


    buildMenu[4] = CreateMenu("Vehicle",1, 200.0, 125.0, 220.0, 50.0);
    SetMenuColumnHeader(buildMenu[4], 0, "Select the Vehicle");
    AddMenuItem(buildMenu[4],0,"Turismo");
    AddMenuItem(buildMenu[4],0,"Flash");
    AddMenuItem(buildMenu[4],0,"Banshee");
    AddMenuItem(buildMenu[4],0,"Cheetah");
    AddMenuItem(buildMenu[4],0,"Uranus");
    AddMenuItem(buildMenu[4],0,"NRG 500");
    AddMenuItem(buildMenu[4],0,"Sanchez");
    AddMenuItem(buildMenu[4],0,"Stunt Plane");
    AddMenuItem(buildMenu[4],0,"Caddy");
    AddMenuItem(buildMenu[4],0,"More...");


    buildMenu[5] = CreateMenu("Vehicle2",1, 200.0, 125.0, 220.0, 50.0);
    SetMenuColumnHeader(buildMenu[5], 0, "Select the Vehicle");
    AddMenuItem(buildMenu[5],0,"Sultan");
    AddMenuItem(buildMenu[5],0,"SuperGT");
    AddMenuItem(buildMenu[5],0,"Savanna");
    AddMenuItem(buildMenu[5],0,"BF Injection");
    AddMenuItem(buildMenu[5],0,"Monster");
    AddMenuItem(buildMenu[5],0,"Bullet");
    AddMenuItem(buildMenu[5],0,"Hotring");
    AddMenuItem(buildMenu[5],0,"Kart");
    AddMenuItem(buildMenu[5],0,"Hydra");//520
    AddMenuItem(buildMenu[5],0,"More...");

    buildMenu[6] = CreateMenu("Vehicle3",1, 200.0, 125.0, 220.0, 50.0);
    SetMenuColumnHeader(buildMenu[6], 0, "Select the Vehicle");
    AddMenuItem(buildMenu[6],0,"Police Car");
    AddMenuItem(buildMenu[6],0,"Tampa");
    AddMenuItem(buildMenu[6],0,"Hotknife");
    AddMenuItem(buildMenu[6],0,"Muellwagen");
    AddMenuItem(buildMenu[5],0,"More...");


    und dann noch das
    case 5:
    {
    switch (row)
    {
    case 0: xCarIds[playerid][0] = 451;
    case 1: xCarIds[playerid][0] = 565;
    case 2: xCarIds[playerid][0] = 429;
    case 3: xCarIds[playerid][0] = 415;
    case 4: xCarIds[playerid][0] = 558;
    case 5: xCarIds[playerid][0] = 522;
    case 6: xCarIds[playerid][0] = 468;
    case 7: xCarIds[playerid][0] = 513;
    case 8: xCarIds[playerid][0] = 457;
    case 9: xCarIds[playerid][0] = 0, print("More..");
    }
    if (xCarIds[playerid][0] > 0)
    {
    SetPlayerVirtualWorld(playerid, playerid+100);
    printf("playerVirtual: %d world:%d",playerid, playerid+100);
    newCar(playerid);
    }
    }
    case 6:
    {
    switch (row)
    {
    case 0: xCarIds[playerid][0] = 560;
    case 1: xCarIds[playerid][0] = 506;
    case 2: xCarIds[playerid][0] = 567;
    case 3: xCarIds[playerid][0] = 424;
    case 4: xCarIds[playerid][0] = 556;
    case 5: xCarIds[playerid][0] = 541;
    case 6: xCarIds[playerid][0] = 494;
    case 7: xCarIds[playerid][0] = 571;
    case 8: xCarIds[playerid][0] = 520;
    case 9: xCarIds[playerid][0] = 0, print("More..");
    }
    if (xCarIds[playerid][0] > 0)
    {
    SetPlayerVirtualWorld(playerid, playerid+100);
    printf("playerVirtual: %d world:%d",playerid, playerid+100);
    newCar(playerid);
    }
    }
    case 7:
    {
    switch (row)
    {
    case 0: xCarIds[playerid][0] = 598;
    case 1: xCarIds[playerid][0] = 549;
    case 2: xCarIds[playerid][0] = 434;
    case 3: xCarIds[playerid][0] = 408;
    case 4: xCarIds[playerid][0] = 0, print("More..");
    }
    if (xCarIds[playerid][0] > 0)
    {
    SetPlayerVirtualWorld(playerid, playerid+100);
    printf("playerVirtual: %d world:%d",playerid, playerid+100);
    newCar(playerid);
    }
    }


    wo ist da der fehler??
    (case 7 sollte das 3 menü sein, also die car ids sind das)

  • sry war flasch.. mein fhler..


    --> hier stand ne flasche lösung.. -.- sry.. nicht nachgedacht bevor jemand spam meckert...

  • schau doch mal wo das menü überhaupt geändert wird!... da müsst sowas stehen wie ShowMenuForPlayer.. :)

  • printf("DEBUG: xCarIds=%d xracebuilding=%d",xCarIds[playerid][0],xRaceBuilding[playerid]);
    //HideMenuForPlayer(buildMenu[xRaceBuilding[playerid]-1],playerid);
    xRaceBuilding[playerid]++;
    printf("xRaceBuilding=%d",xRaceBuilding[playerid]);
    if (xCarIds[playerid][0]==0)
    {
    switch (xRaceBuilding[playerid])
    {
    case 7:
    {
    xRaceBuilding[playerid]=xRaceBuilding[playerid]-2;
    ShowMenuForPlayer(buildMenu[xRaceBuilding[playerid]-1],playerid);
    }
    default:
    {
    ShowMenuForPlayer(buildMenu[xRaceBuilding[playerid]-1],playerid);
    }
    }


    print("Got here");
    }
    else {
    SendClientMessage(playerid, COLOR_TEMP, "Please Set the Race Name! Eg /set RaceDemon");
    printf("SER RACE NAME; racebuilding %d; pworld:%d",xRaceBuilding[playerid], playerid+100);


    }
    return 1;
    }
    return 1;
    }

  • ich würde das anders machen :)


    ich würde eingentlich bei dieser Abfrage hier ein else wie du siehst hinzufügen und dann einfach das nächste menü anzeigen lassen^^ .. ist einfacher.. :D

    if (xCarIds[playerid][0] > 0)
    {
    SetPlayerVirtualWorld(playerid, playerid+100);
    printf("playerVirtual: %d world:%d",playerid, playerid+100);
    newCar(playerid);
    } else {
    //hier das menü anziegen
    }