Checkpoint Problem

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 wenn ich den CMD: startroute schreibe und die 1. Route wähle erscheint kein CP, wisst ihr vielleicht woran es liegen könnte?
    Wenn ich es compile zeigt es keine Fehlern an.
    Ich bedanke mich schonmal im vorraus :)


    CMD:startroute(playerid, params[])
    {
    if(PlayerInfo[playerid][pJob] == 22 || PlayerInfo[playerid][pJob2] == 22)
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(IsABusCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    if(!CheckPointCheck(playerid))
    {
    if(IsPlayerInRangeOfPoint(playerid, 80.0, 1237.2679, -1814.0695, 13.2502))
    {
    ShowPlayerDialog(playerid, DIALOG_BUSJOB, DIALOG_STYLE_LIST,"Select the Route","Route #1\nRoute #2\nRoute #3\nRoute #4","Select","Cancel");
    return 1;
    }
    }
    else return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
    }
    else return SendClientMessageEx(playerid, COLOR_GREY, "You are not driving a Bus Transport Vehicle or you aren't near the Transport Company!");
    }
    else return SendClientMessageEx(playerid, COLOR_GREY, "You are not a Bus Driver!");
    return 1;
    }



    Dialog


    if(dialogid == DIALOG_BUSJOB)
    {
    if(response)
    {
    switch(listitem)
    {
    case 0:
    {
    SetPlayerCheckpoint(playerid, 1308.3702, -1857.7684, 13.5469, 7.0); //1st Stat
    BusCP[playerid] = 1;
    }
    case 1:
    {
    ShowPlayerDialog(playerid, DIALOG_BUSJOB, DIALOG_STYLE_LIST,"Select the Route","Route #1\nRoute #2\nRoute #3\nRoute #4","Select","Cancel");
    }
    case 2:
    {
    ShowPlayerDialog(playerid, DIALOG_BUSJOB, DIALOG_STYLE_LIST,"Select the Route","Route #1\nRoute #2\nRoute #3\nRoute #4","Select","Cancel");
    }
    case 3:
    {
    ShowPlayerDialog(playerid, DIALOG_BUSJOB, DIALOG_STYLE_LIST,"Select the Route","Route #1\nRoute #2\nRoute #3\nRoute #4","Select","Cancel");
    }
    }
    }
    return 1;
    }

  • Du musst beim Dialog das anders machen.
    Nicht mit Case sondern mit if(response == 1)


    bin grad mit dem Handy on, sonst würde ich Dir das schnell machen. Schau mal hier im Forum wie der Callback von Dialogen geht.

  • So ?


    if(dialogid == DIALOG_BUSJOB)
    {
    if(response == 1)
    {

    switch(listitem)
    {
    if(listitem == 0)
    {
    SetPVarInt(playerid,"busjb", 1);
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, 1308.3702, -1857.7684, 13.5469, 7); //1st Stat
    SendClientMessageEx(playerid, COLOR_GREY, "11.");
    }
    else if(listitem == 1)
    {
    SendClientMessageEx(playerid, COLOR_GREY, "222.");
    SetPlayerCheckpoint(playerid, 1308.3702, -1857.7684, 13.5469, 7.0); //1st Stat
    BusCP[playerid] = 1;
    ShowPlayerDialog(playerid, DIALOG_BUSJOB, DIALOG_STYLE_LIST,"Select the Route","Route #1\nRoute #2\nRoute #3\nRoute #4","Select","Cancel");
    }
    else if(listitem == 2)
    {
    ShowPlayerDialog(playerid, DIALOG_BUSJOB, DIALOG_STYLE_LIST,"Select the Route","Route #1\nRoute #2\nRoute #3\nRoute #4","Select","Cancel");
    }
    else if(listitem == 3)
    {
    ShowPlayerDialog(playerid, DIALOG_BUSJOB, DIALOG_STYLE_LIST,"Select the Route","Route #1\nRoute #2\nRoute #3\nRoute #4","Select","Cancel");
    }
    }
    }
    return 1;
    }


    Danke