Busjob befehl+ Liniendialog

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
  • Guten Morgen


    Ich habe folgendes problem:


    Wenn ich Ingame auf mein Server bin und den befehl /buslinie eintippe um mein Dialog für die Busrouten zu bekommen wird es auch angzeigt nur das problem ist wenn ich die 1Route auswähle zeigt er mir zwar den ersten Marker aber dann auch kein weiter mehr.


    Damit ihr ein blick auf den Code werfen könnt:




    Enum:
    enum bus1Enum{
    Float:g_x,
    Float:g_y,
    Float:g_z
    }


    Befehl:
    ocmd:buslinie(playerid,params[])
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,1135.5480,-1693.4392,13.7931))return
    SendClientMessage(playerid,helblau,"Du kannst den Job hier nicht starten");
    new Float:ox,Float:oy,Float:oz,Float:or;
    GetPlayerPos(playerid,ox,oy,oz);
    GetPlayerFacingAngle(playerid,or);
    new vID = CreateVehicle(431,ox,oy,oz,or,-1,-1,-1);
    SetPVarInt(playerid,"bus_car",vID);
    SendClientMessage(playerid,rot,"Du hast dein Routenplaner geöffnent.");
    SetPVarInt(playerid,"bus_cp",0);
    SetPVarInt(playerid,"bus_job",1);
    PutPlayerInVehicle(playerid,vID,0);
    ShowPlayerDialog(playerid,DIALOG_Buslinien,DIALOG_STYLE_LIST,"Busstrecke.","Buslinie1\nBuslinie2\nBuslinie3\nBuslinie4","Annehmen","Abbrechen");


    return 1;
    }


    OnPlayerEnterCheckpoint:


    public OnPlayerEnterCheckpoint(playerid)
    {
    if(GetPVarInt(playerid, "trash_job"))
    {
    //Wenn trash job ausgeführt wird
    new cID = GetPVarInt(playerid, "trash_cp");
    if(IsPlayerInRangeOfPoint(playerid, 5, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
    {
    cID++;

    if(cID >= sizeof(tCPs))
    {
    GivePlayerMoney(playerid, 3000);
    SetPVarInt(playerid, "trash_cp", 0);
    SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
    SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid, "trash_cp", cID);
    SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
    }
    return 1;
    }
    }

    if(GetPVarInt(playerid,"bus_job"))
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,5,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
    {
    bID++;
    if(bID >= sizeof(bust1cps))
    {
    GivePlayerMoney(playerid,6000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
    }
    }
    }
    DisablePlayerCheckpoint(playerid);
    return 1;
    }


    zu guter letzt noch der Dialog:




    public OnPasswordResponse(playerid)
    {
    new num_rows,num_fields;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(num_rows==1)
    {
    //passwort Richtig
    sInfo[playerid][eingeloggt] = 1;
    sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
    SetPlayerScore(playerid,sInfo[playerid][level]);
    sInfo[playerid][db_id] = cache_get_field_content_int(0,"id",dbhandle);
    SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
    sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
    sInfo[playerid][fraktion] = cache_get_field_content_int(0,"fraktion",dbhandle);
    sInfo[playerid][rang] = cache_get_field_content_int(0,"rang",dbhandle);
    sInfo[playerid][spawnchange]= cache_get_field_content_int(0,"spawnchange",dbhandle);
    loadPlayerCars(playerid);


    }
    else
    {
    //Passwort Falsch
    SendClientMessage(playerid,grün,"Du hast dein Passwort falsch eingetippt. Versuche es nochmal!");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
    }
    return 1;
    }



    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid==DIALOG_AUTOHAUS)
    {
    if(response)
    {
    //Autoverkauf
    new id=GetPVarInt(playerid,"buyCarID");
    if(GetPlayerMoney(playerid)<ahCars[id][c_preis])
    {
    SendClientMessage(playerid,gelb,"Du besitzt nicht das benötige Geld für das Fahrzeug");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    GivePlayerMoney(playerid,-ahCars[id][c_preis]);
    createPlayerCar(playerid,ahCars[id][model],ahInfo[ahCars[id][ah_id]][v_x],ahInfo[ahCars[id][ah_id]][v_y],ahInfo[ahCars[id][ah_id]][v_z],ahInfo[ahCars[id][ah_id]][v_r]);
    SendClientMessage(playerid,grün,"Sie haben sich erfolgreich ein Fahrzeug gekauft.");
    RemovePlayerFromVehicle(playerid);
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,türkis,"Du hast den Kaufvorgang abgebrochen.");


    }
    return 1;
    }
    if(dialogid==DIALOG_LOGIN)
    {
    if(response)
    {
    new name[MAX_PLAYER_NAME],query[128],passwort[35];
    GetPlayerName(playerid,name,sizeof(name));
    if(strlen(inputtext)>0)
    {
    mysql_escape_string(inputtext,passwort,dbhandle);
    format(query,sizeof(query),"SELECT * FROM user WHERE username='%s' AND passwort=MD5('%s')",name,passwort);
    mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
    }
    else
    {
    //Keine Eingabe
    SendClientMessage(playerid,grün,"Gibt bitte dein Passwort ein.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
    }
    }
    else
    {
    Kick(playerid);
    }
    return 1;
    }
    if(dialogid==DIALOG_REGISTER)
    {
    if(response)
    {
    new name[MAX_PLAYER_NAME],query[128],passwort[35];
    GetPlayerName(playerid,name,sizeof(name));
    if(strlen(inputtext)>5)
    {
    //Registrierungsfunktion
    mysql_escape_string(inputtext,passwort,dbhandle);
    format(query,sizeof(query),"INSERT INTO user (username,passwort) VALUES ('%s',MD5('%s')) ",name,passwort);
    mysql_function_query(dbhandle,query,false,"","");
    }
    else
    {
    //Kleiner als 4 Zeichen
    SendClientMessage(playerid,helblau,"Dein Passwort muss mindestens 6 Zeichen lang sein.");
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Account Erstellung","Gebe bitte nun dein gewünschtes Passwort ein!","Erstellen","Abbrechen");
    }
    }
    else
    {
    Kick(playerid);
    }
    return 1;
    }
    if(dialogid==DIALOG_TELEPORT)
    {
    if(response)
    {
    if(listitem==0)
    {
    //Autohaus
    SetPlayerPos(playerid,2502.1106,1706.7172,10.8203);
    SetPlayerFacingAngle(playerid,95.2747);
    }
    }
    else
    {
    SendClientMessage(playerid,rot,"Vorgang abgebrochen.");
    }
    return 1;
    }

    if(dialogid==DIALOG_Buslinien)
    {
    if(response)
    {
    if(listitem== 0)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);


    }
    if(listitem== 1)
    {
    //Busliniet2
    if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");


    }


    if(listitem== 2)
    {
    //Buslinie3
    if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    }


    if(listitem== 3)
    {
    //Buslinie 4
    if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    }
    }
    else
    {
    SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
    RemovePlayerFromVehicle(playerid);
    DestroyVehicle(431);
    return 1;
    }
    }
    return 1;
    }



    da ich einfach den Fehler nicht finde brauche ich eure hilfe

    Einmal editiert, zuletzt von seegras () aus folgendem Grund: Expander durch PWN-Tags ersetzt - Gibts ja nicht nur zum Spaß hier ;)

  • Beitrag von FileZilla ()

    Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar.
  • 1.)
    Ändere
    else
    {
    SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
    RemovePlayerFromVehicle(playerid);
    DestroyVehicle(431);
    return 1;
    }
    zu
    else
    {
    SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
    DestroyVehicle(GetPlayerVehicleID(playerid));
    return 1;
    }


    2.)
    DisablePlayerCheckpoint muss ganz oben stehen, sonst entfernst du den Checkpoint nachdem du ihn angezeigt hast.
    Außerdem habe ich die Größe des Ranges von 5 auf 7 geändert, das könnte sonst zu Problemen kommen, wenn es mal nicht ganz passt.
    public OnPlayerEnterCheckpoint(playerid)
    {
    DisablePlayerCheckpoint(playerid);
    if(GetPVarInt(playerid, "trash_job"))
    {
    //Wenn trash job ausgeführt wird
    new cID = GetPVarInt(playerid, "trash_cp");
    if(IsPlayerInRangeOfPoint(playerid, 7, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
    {
    cID++;
    if(cID >= sizeof(tCPs))
    {
    GivePlayerMoney(playerid, 3000);
    SetPVarInt(playerid, "trash_cp", 0);
    SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
    SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid, "trash_cp", cID);
    SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
    }
    return 1;
    }
    }


    if(GetPVarInt(playerid,"bus_job"))
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
    {
    bID++;
    if(bID >= sizeof(bust1cps))
    {
    GivePlayerMoney(playerid,6000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
    }
    }
    }
    return 1;
    }

  • Sieht jetzt so aus Jeffry


    enum bus1Enum{
    Float:g_x,
    Float:g_y,
    Float:g_z
    }
    enum bus2Enum{
    Float:v_x,
    Float:v_y,
    Float:v_z
    }
    enum bus3Enum{
    Float:n_x,
    Float:n_y,
    Float:n_z
    }
    enum bus4Enum{
    Float:m_x,
    Float:m_y,
    Float:m_z
    }


    new bust1cps[][bus1Enum]={
    {1135.5480,-1693.4392,13.7931}, // busstarten
    {1722.2972,-1599.5205,13.5478},//buscp 1
    {1526.4220,-1660.5486,13.4871}, //buscp1
    {1467.7390,-1728.8627,13.4710}, //buscp1
    {1361.6545,-1285.1267,13.5398}, //buscp1
    {1446.1191,-1029.5895,23.8441},//buscp 1
    {1275.4427,-1380.3951,13.3839} //buscp1 letzte

    };
    new bust2cps[][bus2Enum]={
    {1135.5480,-1693.4392,13.7931}, // busstarten
    {1378.1691,-1876.8495,13.1888},
    {1937.2477,-2171.4868,13.1890},
    {2327.6970,-2054.9773,13.1441},
    {2719.7451,-2029.7438,13.1351},
    {2774.6575,-1942.9828,13.1381},
    {2683.9724,-1871.7905,10.6911},
    {2741.3979,-1610.1760,12.5695},
    {2682.0027,-1459.3654,30.1905},
    {2418.9873,-1251.8312,23.5439},
    {2007.6500,-1455.2505,13.1968}
    };
    new bust3cps[][bus3Enum]={
    {1135.5480,-1693.4392,13.7931}, // busstarten
    {1679.9683,-1293.2322,13.6465},
    {1453.7729,-1029.0790,23.4661},
    {1330.3799,-920.0157,36.3406},
    {1208.4860,-930.5677,42.5413},
    {1000.6902,-953.3558,41.7086},
    {820.6417,-1032.6522,24.7459},
    {792.3692,-1120.2891,23.4660},
    {937.4135,-1202.0179,17.4626}
    };
    new bust4cps[][bus4Enum]={
    {1135.5480,-1693.4392,13.7931}, // busstarten
    {912.7061,-1544.2203,13.1864},
    {1373.5081,-1737.3380,13.1889},
    {1460.0719,-1386.0859,13.1890},
    {1191.4703,-1472.5956,13.1890},
    {1087.5948,-1707.3693,13.1890},
    {978.7953,-1567.1348,13.2248},
    {484.9120,-1577.5508,21.0505},
    {454.7106,-1498.5461,30.7047},
    {343.1253,-1523.9889,33.0096},
    {280.3340,-1643.8889,33.0396},
    {425.5682,-1696.6198,9.6370},
    {237.6003,-1737.2343,3.8593}
    };





    public OnPlayerEnterCheckpoint(playerid)
    {
    if(GetPVarInt(playerid, "trash_job"))
    {
    //Wenn trash job ausgeführt wird
    new cID = GetPVarInt(playerid, "trash_cp");
    if(IsPlayerInRangeOfPoint(playerid, 5, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
    {
    cID++;

    if(cID >= sizeof(tCPs))
    {
    GivePlayerMoney(playerid, 3000);
    SetPVarInt(playerid, "trash_cp", 0);
    SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
    SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid, "trash_cp", cID);
    SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
    }
    return 1;
    }
    }

    if(GetPVarInt(playerid,"bus_job") == 1)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
    {
    bID++;
    if(bID >= sizeof(bust1cps))
    {
    GivePlayerMoney(playerid,6000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
    }
    }
    }

    else if(GetPVarInt(playerid,"bus_job") == 1)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
    {
    bID++;
    if(bID >= sizeof(bust2cps))
    {
    GivePlayerMoney(playerid,12000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
    }
    }
    else if (GetPVarInt(playerid,"bus_job") == 1)
    {
    if(IsPlayerInRangeOfPoint(playerid,7,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
    {
    bID++;
    if(bID >= sizeof(bust3cps))
    {
    GivePlayerMoney(playerid,15000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    }
    }
    else if(GetPVarInt(playerid,"bus_job") == 1)
    {
    if(IsPlayerInRangeOfPoint(playerid,7,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
    {
    bID++;
    if(bID >= sizeof(bust4cps))
    {
    GivePlayerMoney(playerid,30000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    }

    }
    }
    }
    }
    DisablePlayerCheckpoint(playerid);
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid==DIALOG_AUTOHAUS)
    {
    if(response)
    {
    //Autoverkauf
    new id=GetPVarInt(playerid,"buyCarID");
    if(GetPlayerMoney(playerid)<ahCars[id][c_preis])
    {
    SendClientMessage(playerid,gelb,"Du besitzt nicht das benötige Geld für das Fahrzeug");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    GivePlayerMoney(playerid,-ahCars[id][c_preis]);
    createPlayerCar(playerid,ahCars[id][model],ahInfo[ahCars[id][ah_id]][v_x],ahInfo[ahCars[id][ah_id]][v_y],ahInfo[ahCars[id][ah_id]][v_z],ahInfo[ahCars[id][ah_id]][v_r]);
    SendClientMessage(playerid,grün,"Sie haben sich erfolgreich ein Fahrzeug gekauft.");
    RemovePlayerFromVehicle(playerid);
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,türkis,"Du hast den Kaufvorgang abgebrochen.");


    }
    return 1;
    }
    if(dialogid==DIALOG_LOGIN)
    {
    if(response)
    {
    new name[MAX_PLAYER_NAME],query[128],passwort[35];
    GetPlayerName(playerid,name,sizeof(name));
    if(strlen(inputtext)>0)
    {
    mysql_escape_string(inputtext,passwort,dbhandle);
    format(query,sizeof(query),"SELECT * FROM user WHERE username='%s' AND passwort=MD5('%s')",name,passwort);
    mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
    }
    else
    {
    //Keine Eingabe
    SendClientMessage(playerid,grün,"Gibt bitte dein Passwort ein.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
    SetPlayerScore(playerid,sInfo[playerid][level]);
    }
    }
    else
    {
    Kick(playerid);
    }
    return 1;
    }
    if(dialogid==DIALOG_REGISTER)
    {
    if(response)
    {
    new name[MAX_PLAYER_NAME],query[128],passwort[35];
    GetPlayerName(playerid,name,sizeof(name));
    if(strlen(inputtext)>5)
    {
    //Registrierungsfunktion
    mysql_escape_string(inputtext,passwort,dbhandle);
    format(query,sizeof(query),"INSERT INTO user (username,passwort) VALUES ('%s',MD5('%s')) ",name,passwort);
    mysql_function_query(dbhandle,query,false,"","");
    sInfo[playerid][level]=1;
    SetPlayerScore(playerid,sInfo[playerid][level]);
    }
    else
    {
    //Kleiner als 4 Zeichen
    SendClientMessage(playerid,helblau,"Dein Passwort muss mindestens 6 Zeichen lang sein.");
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Account Erstellung","Gebe bitte nun dein gewünschtes Passwort ein!","Erstellen","Abbrechen");
    }
    }
    else
    {
    Kick(playerid);
    }
    return 1;
    }
    if(dialogid==DIALOG_TELEPORT)
    {
    if(response)
    {
    if(listitem==0)
    {
    //Autohaus
    SetPlayerPos(playerid,2502.1106,1706.7172,10.8203);
    SetPlayerFacingAngle(playerid,95.2747);
    }
    }
    else
    {
    SendClientMessage(playerid,rot,"Vorgang abgebrochen.");
    }
    return 1;
    }

    if(dialogid==DIALOG_Buslinien)
    {
    if(response)
    {
    if(listitem== 0)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);


    }
    if(listitem== 1)
    {
    //Busliniet2
    if(!IsPlayerInRangeOfPoint(playerid,5,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);


    }


    if(listitem== 2)
    {
    //Buslinie3
    if(!IsPlayerInRangeOfPoint(playerid,5,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    SetPlayerCheckpoint(playerid,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z],5);
    }


    if(listitem== 3)
    {
    //Buslinie 4
    if(!IsPlayerInRangeOfPoint(playerid,5,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    SetPlayerCheckpoint(playerid,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z],5);
    }
    }
    else
    {
    SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
    RemovePlayerFromVehicle(playerid);
    DestroyVehicle(431);
    return 1;
    }
    }
    return 1;
    }
    aber die Checkpoints kommen einfach nicht:

  • Ein Tipp von mir für die Übersichtlichkeit deiner posts:
    Bitte poste nur das was auch zu der Funktion gehört.
    Ich glaube dein Teleport Dialog gehört nicht zu deinem Bus System ;)
    und bitte lösche die threads nicht nach Lösung der Probleme/des Problems. es könnte anderen Usern auch helfen.
    Und es erspart den anderen auch die Arbeit ;)

  • Beitrag von Blackshadowscript ()

    Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar.
  • public OnPlayerEnterCheckpoint(playerid)
    {
    if(GetPVarInt(playerid, "trash_job"))
    {
    //Wenn trash job ausgeführt wird
    new cID = GetPVarInt(playerid, "trash_cp");
    if(IsPlayerInRangeOfPoint(playerid, 5, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
    {
    cID++;

    if(cID >= sizeof(tCPs))
    {
    GivePlayerMoney(playerid, 3000);
    SetPVarInt(playerid, "trash_cp", 0);
    SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
    SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid, "trash_cp", cID);
    SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
    }
    return 1;
    }
    }

    if(GetPVarInt(playerid,"bus_job") == 1)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
    {
    bID++;
    if(bID >= sizeof(bust1cps))
    {
    GivePlayerMoney(playerid,6000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
    }
    }
    }

    else if(GetPVarInt(playerid,"bus_job") == 1)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
    {
    bID++;
    if(bID >= sizeof(bust2cps))
    {
    GivePlayerMoney(playerid,12000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
    }
    }
    else if (GetPVarInt(playerid,"bus_job") == 1)
    {
    if(IsPlayerInRangeOfPoint(playerid,7,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
    {
    bID++;
    if(bID >= sizeof(bust3cps))
    {
    GivePlayerMoney(playerid,15000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    }
    }
    else if(GetPVarInt(playerid,"bus_job") == 1)
    {
    if(IsPlayerInRangeOfPoint(playerid,7,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
    {
    bID++;
    if(bID >= sizeof(bust4cps))
    {
    GivePlayerMoney(playerid,30000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    }

    }
    }
    }
    }
    DisablePlayerCheckpoint(playerid);
    return 1;
    }


    PS: Ich weiß das da auch vom Müllwagen die Checkpoints sind.

  • Sieht jetzt so aus Jeffry


    public OnPlayerEnterCheckpoint(playerid)
    {
    if(GetPVarInt(playerid, "trash_job"))
    {
    //Wenn trash job ausgeführt wird
    new cID = GetPVarInt(playerid, "trash_cp");
    if(IsPlayerInRangeOfPoint(playerid, 5, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
    {
    cID++;

    if(cID >= sizeof(tCPs))
    {
    GivePlayerMoney(playerid, 3000);
    SetPVarInt(playerid, "trash_cp", 0);
    SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
    SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid, "trash_cp", cID);
    SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
    }
    return 1;
    }
    }

    if(GetPVarInt(playerid,"bus_job") == 1)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
    {
    bID++;
    if(bID >= sizeof(bust1cps))
    {
    GivePlayerMoney(playerid,6000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
    }
    }
    }

    else if(GetPVarInt(playerid,"bus_job") == 2)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
    {
    bID++;
    if(bID >= sizeof(bust2cps))
    {
    GivePlayerMoney(playerid,12000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
    }
    }
    }
    else if (GetPVarInt(playerid,"bus_job") == 3)
    {
    if(IsPlayerInRangeOfPoint(playerid,7,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
    {
    bID++;
    if(bID >= sizeof(bust3cps))
    {
    GivePlayerMoney(playerid,15000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    }
    }
    }
    else if(GetPVarInt(playerid,"bus_job") == 4)
    {
    if(IsPlayerInRangeOfPoint(playerid,7,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
    {
    bID++;
    if(bID >= sizeof(bust4cps))
    {
    GivePlayerMoney(playerid,30000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    }

    }
    }
    DisablePlayerCheckpoint(playerid);
    return 1;
    }

  • wenn ich den code so nehme wie du den gepostet hast kommen:


    samplernen.p(1230) : error 017: undefined symbol "bID"
    samplernen.p(1232) : error 017: undefined symbol "bID"
    samplernen.p(1232) : warning 215: expression has no effect
    samplernen.p(1233) : error 017: undefined symbol "bID"
    samplernen.p(1237) : error 017: undefined symbol "bID"
    samplernen.p(1242) : error 017: undefined symbol "bID"
    samplernen.p(1243) : error 017: undefined symbol "bID"
    samplernen.p(1249) : error 017: undefined symbol "bID"
    samplernen.p(1251) : error 017: undefined symbol "bID"
    samplernen.p(1251) : warning 215: expression has no effect
    samplernen.p(1252) : error 017: undefined symbol "bID"
    samplernen.p(1256) : error 017: undefined symbol "bID"
    samplernen.p(1261) : error 017: undefined symbol "bID"
    samplernen.p(1262) : error 017: undefined symbol "bID"


    fehler

  • Du hattest es bei den unteren beiden entfernt, da habe ich natürlich nicht drauf geachtet.
    public OnPlayerEnterCheckpoint(playerid)
    {
    if(GetPVarInt(playerid, "trash_job"))
    {
    //Wenn trash job ausgeführt wird
    new cID = GetPVarInt(playerid, "trash_cp");
    if(IsPlayerInRangeOfPoint(playerid, 5, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
    {
    cID++;

    if(cID >= sizeof(tCPs))
    {
    GivePlayerMoney(playerid, 3000);
    SetPVarInt(playerid, "trash_cp", 0);
    SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
    SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid, "trash_cp", cID);
    SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
    }
    return 1;
    }
    }

    if(GetPVarInt(playerid,"bus_job") == 1)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
    {
    bID++;
    if(bID >= sizeof(bust1cps))
    {
    GivePlayerMoney(playerid,6000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
    }
    }
    }

    else if(GetPVarInt(playerid,"bus_job") == 2)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
    {
    bID++;
    if(bID >= sizeof(bust2cps))
    {
    GivePlayerMoney(playerid,12000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
    }
    }
    }
    else if (GetPVarInt(playerid,"bus_job") == 3)
    {
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
    {
    bID++;
    if(bID >= sizeof(bust3cps))
    {
    GivePlayerMoney(playerid,15000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    }
    }
    }
    else if(GetPVarInt(playerid,"bus_job") == 4)
    {
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
    {
    bID++;
    if(bID >= sizeof(bust4cps))
    {
    GivePlayerMoney(playerid,30000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    }
    }
    }
    DisablePlayerCheckpoint(playerid);
    return 1;
    }

  • Die Checkpoints werden nicht geladen.



    Ich habe den verdacht das es vielleicht am Dialog liegen könnte:



    if(dialogid==DIALOG_Buslinien)
    {
    if(response)
    {
    if(listitem== 0)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);


    }
    if(listitem== 1)
    {
    //Busliniet2
    if(!IsPlayerInRangeOfPoint(playerid,5,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);


    }


    if(listitem== 2)
    {
    //Buslinie3
    if(!IsPlayerInRangeOfPoint(playerid,5,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    SetPlayerCheckpoint(playerid,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z],5);
    }


    if(listitem== 3)
    {
    //Buslinie 4
    if(!IsPlayerInRangeOfPoint(playerid,5,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z]))return
    SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
    SetPlayerCheckpoint(playerid,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z],5);
    }
    }
    else
    {
    SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
    RemovePlayerFromVehicle(playerid);
    DestroyVehicle(431);
    return 1;
    }
    }
    return 1;
    }

  • Klappt es so?
    if(dialogid==DIALOG_Buslinien)
    {
    if(response)
    {
    if(listitem== 0)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 1 gestartet.");
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);

    }
    if(listitem== 1)
    {
    //Busliniet2
    if(!IsPlayerInRangeOfPoint(playerid,5,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 2 gestartet.");
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    }
    if(listitem== 2)
    {
    //Buslinie3
    if(!IsPlayerInRangeOfPoint(playerid,5,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 3 gestartet.");
    SetPlayerCheckpoint(playerid,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z],5);
    }
    if(listitem== 3)
    {
    //Buslinie 4
    if(!IsPlayerInRangeOfPoint(playerid,5,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 4 gestartet.");
    SetPlayerCheckpoint(playerid,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z],5);
    }
    }
    else
    {
    SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
    DestroyVehicle(GetPlayerVehicleID(playerid));
    return 1;
    }
    }
    return 1;
    }

  • Erster Checkpoint wird gesetzt aber weiter gehts nicht!




    Buslinie:


    Dialogdefine:
    #define DIALOG_Buslinien 5


    Enums:
    enum bus1Enum{
    Float:g_x,
    Float:g_y,
    Float:g_z
    }
    enum bus2Enum{
    Float:v_x,
    Float:v_y,
    Float:v_z
    }
    enum bus3Enum{
    Float:n_x,
    Float:n_y,
    Float:n_z
    }
    enum bus4Enum{
    Float:m_x,
    Float:m_y,
    Float:m_z
    }
    new bust1cps[][bus1Enum]={
    {1135.5480,-1693.4392,13.7931}, // busstarten
    {1722.2972,-1599.5205,13.5478},//buscp 1
    {1526.4220,-1660.5486,13.4871}, //buscp1
    {1467.7390,-1728.8627,13.4710}, //buscp1
    {1361.6545,-1285.1267,13.5398}, //buscp1
    {1446.1191,-1029.5895,23.8441},//buscp 1
    {1275.4427,-1380.3951,13.3839} //buscp1 letzte

    };
    new bust2cps[][bus2Enum]={
    {1135.5480,-1693.4392,13.7931}, // busstarten
    {1378.1691,-1876.8495,13.1888},
    {1937.2477,-2171.4868,13.1890},
    {2327.6970,-2054.9773,13.1441},
    {2719.7451,-2029.7438,13.1351},
    {2774.6575,-1942.9828,13.1381},
    {2683.9724,-1871.7905,10.6911},
    {2741.3979,-1610.1760,12.5695},
    {2682.0027,-1459.3654,30.1905},
    {2418.9873,-1251.8312,23.5439},
    {2007.6500,-1455.2505,13.1968}
    };
    new bust3cps[][bus3Enum]={
    {1135.5480,-1693.4392,13.7931}, // busstarten
    {1679.9683,-1293.2322,13.6465},
    {1453.7729,-1029.0790,23.4661},
    {1330.3799,-920.0157,36.3406},
    {1208.4860,-930.5677,42.5413},
    {1000.6902,-953.3558,41.7086},
    {820.6417,-1032.6522,24.7459},
    {792.3692,-1120.2891,23.4660},
    {937.4135,-1202.0179,17.4626}
    };
    new bust4cps[][bus4Enum]={
    {1135.5480,-1693.4392,13.7931}, // busstarten
    {912.7061,-1544.2203,13.1864},
    {1373.5081,-1737.3380,13.1889},
    {1460.0719,-1386.0859,13.1890},
    {1191.4703,-1472.5956,13.1890},
    {1087.5948,-1707.3693,13.1890},
    {978.7953,-1567.1348,13.2248},
    {484.9120,-1577.5508,21.0505},
    {454.7106,-1498.5461,30.7047},
    {343.1253,-1523.9889,33.0096},
    {280.3340,-1643.8889,33.0396},
    {425.5682,-1696.6198,9.6370},
    {237.6003,-1737.2343,3.8593}
    };


    OCMD-Befehl:
    ocmd:buslinie(playerid,params[])
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,1135.5480,-1693.4392,13.7931))return
    SendClientMessage(playerid,helblau,"Du kannst den Job hier nicht starten");
    new Float:ox,Float:oy,Float:oz,Float:or;
    GetPlayerPos(playerid,ox,oy,oz);
    GetPlayerFacingAngle(playerid,or);
    new vID = CreateVehicle(431,ox,oy,oz,or,-1,-1,-1);
    SetPVarInt(playerid,"bus_car",vID);
    SendClientMessage(playerid,rot,"Du hast dein Routenplaner geöffnent.");
    PutPlayerInVehicle(playerid,vID,0);
    ShowPlayerDialog(playerid,DIALOG_Buslinien,DIALOG_STYLE_LIST,"Busstrecke.","Buslinie1\nBuslinie2\nBuslinie3\nBuslinie4","Annehmen","Abbrechen");
    SetPVarInt(playerid,"bus_cp",0);
    SetPVarInt(playerid,"bus_job",1);


    return 1;
    }


    OnPlayerEnterCheckpoint:
    if(GetPVarInt(playerid,"bus_job") == 1)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
    {
    bID++;
    if(bID >= sizeof(bust1cps))
    {
    GivePlayerMoney(playerid,6000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
    }
    }
    }

    else if(GetPVarInt(playerid,"bus_job") == 2)
    {
    //wenn bus_job ausgeführt wird.
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
    {
    bID++;
    if(bID >= sizeof(bust2cps))
    {
    GivePlayerMoney(playerid,12000);
    SetPVarInt(playerid,"bus_cp",0);
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
    }
    }
    }
    else if (GetPVarInt(playerid,"bus_job") == 3)
    {
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
    {
    bID++;
    if(bID >= sizeof(bust3cps))
    {
    GivePlayerMoney(playerid,15000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
    }
    }
    }
    else if(GetPVarInt(playerid,"bus_job") == 4)
    {
    new bID = GetPVarInt(playerid,"bus_cp");
    if(IsPlayerInRangeOfPoint(playerid,7,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
    {
    bID++;
    if(bID >= sizeof(bust4cps))
    {
    GivePlayerMoney(playerid,30000);
    SetPVarInt(playerid,"bus_cp",8);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
    }
    else
    {
    SetPVarInt(playerid,"bus_cp",bID);
    SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
    }
    }
    }
    DisablePlayerCheckpoint(playerid);
    return 1;
    }


    Dialgo:
    if(dialogid==DIALOG_Buslinien)
    {
    if(response)
    {
    if(listitem== 0)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 1 gestartet.");
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);

    }
    if(listitem== 1)
    {
    //Busliniet2
    if(!IsPlayerInRangeOfPoint(playerid,5,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 2 gestartet.");
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    }
    if(listitem== 2)
    {
    //Buslinie3
    if(!IsPlayerInRangeOfPoint(playerid,5,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 3 gestartet.");
    SetPlayerCheckpoint(playerid,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z],5);
    }
    if(listitem== 3)
    {
    //Buslinie 4
    if(!IsPlayerInRangeOfPoint(playerid,5,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 4 gestartet.");
    SetPlayerCheckpoint(playerid,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z],5);
    }
    }
    else
    {
    SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
    DestroyVehicle(GetPlayerVehicleID(playerid));
    return 1;
    }
    }
    return 1;
    }

  • Du setzt den bus_job nicht.
    Versuche es so:
    if(dialogid==DIALOG_Buslinien)
    {
    if(response)
    {
    if(listitem== 0)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 1 gestartet.");
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);

    }
    if(listitem== 1)
    {
    //Busliniet2
    if(!IsPlayerInRangeOfPoint(playerid,5,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 2 gestartet.");
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    }
    if(listitem== 2)
    {
    //Buslinie3
    if(!IsPlayerInRangeOfPoint(playerid,5,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 3 gestartet.");
    SetPlayerCheckpoint(playerid,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z],5);
    }
    if(listitem== 3)
    {
    //Buslinie 4
    if(!IsPlayerInRangeOfPoint(playerid,5,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 4 gestartet.");
    SetPlayerCheckpoint(playerid,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z],5);
    }
    SetPVarInt(playerid,"bus_job",listitem+1);
    }
    else
    {
    SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
    DestroyVehicle(GetPlayerVehicleID(playerid));
    return 1;
    }
    }
    return 1;
    }

  • Beitrag von Blackshadowscript ()

    Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar.
  • Ja die Nachrichten bekomme ich.
    2. Erstercheckpoint wird zwar bei Linie 1 angezeigt aber bei den anderen Linien nicht.


    if(dialogid==DIALOG_Buslinien)
    {
    if(response)
    {
    if(listitem== 0)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 1 gestartet.");
    SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);

    }
    if(listitem== 1)
    {
    //Busliniet2
    if(!IsPlayerInRangeOfPoint(playerid,5,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 2 gestartet.");
    SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
    }
    if(listitem== 2)
    {
    //Buslinie3
    if(!IsPlayerInRangeOfPoint(playerid,5,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 3 gestartet.");
    SetPlayerCheckpoint(playerid,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z],5);
    }
    if(listitem== 3)
    {
    //Buslinie 4
    if(!IsPlayerInRangeOfPoint(playerid,5,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z]))return 1;
    SendClientMessage(playerid,helblau,"Du hast die Busroute 4 gestartet.");
    SetPlayerCheckpoint(playerid,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z],5);
    }
    SetPVarInt(playerid,"bus_job",listitem+1);
    }
    else
    {
    SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
    DestroyVehicle(GetPlayerVehicleID(playerid));
    return 1;
    }
    }
    return 1;
    }

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen