brauche hilfe beim buscountdown

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
  • wen /linie mache fahre ich ja zu 1 checkpoint aber zu nächste halte stelle geht es net
    weiter bitte helft mir


    public BusCountdown(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    new string[128];
    if(Spieler[playerid][Job] == 2)
    {
    for(new i=0;i<sizeof(buscars);i++)
    {
    new vID = GetPlayerVehicleID(playerid);
    if(vID == buscars[i])
    {
    if(IsPlayerInCheckpoint(playerid))
    {
    if(buscd[playerid] == 11)
    {
    buscd[playerid] = 10;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~10", 500, 1);
    }
    else if(buscd[playerid] == 10)
    {
    buscd[playerid] = 9;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~9", 500, 1);
    }
    else if(buscd[playerid] == 9)
    {
    buscd[playerid] = 8;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~8", 500, 1);
    }
    else if(buscd[playerid] == 8)
    {
    buscd[playerid] = 7;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~7", 500, 1);
    }
    else if(buscd[playerid] == 7)
    {
    buscd[playerid] = 6;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~6", 500, 1);
    }
    else if(buscd[playerid] == 6)
    {
    buscd[playerid] = 5;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~5", 500, 1);
    }
    else if(buscd[playerid] == 5)
    {
    buscd[playerid] = 4;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~4", 500, 1);
    }
    else if(buscd[playerid] == 4)
    {
    buscd[playerid] = 3;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~3", 500, 1);
    }
    else if(buscd[playerid] == 3)
    {
    buscd[playerid] = 2;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~2", 500, 1);
    }
    else if(buscd[playerid] == 1)
    {
    buscd[playerid] = 0;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~1", 500, 1);
    if(pCP[playerid] == CHECKPOINT_BUSSTART)
    {
    SetPlayerCheckpoint(playerid, 1203.0599,-934.3010,42.3596, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP1;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Vinewood.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP1)
    {
    SetPlayerCheckpoint(playerid, 742.7133,-1393.4297,13.0455, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP2;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Vinewood - Intercars.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP2)
    {
    SetPlayerCheckpoint(playerid, 301.2852,-1397.0028,13.5145, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP3;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Rodeo.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP3)
    {
    SetPlayerCheckpoint(playerid, 354.8143,-1648.1133,32.4861, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP4;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Rodeo.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP4)
    {
    SetPlayerCheckpoint(playerid, 678.2159,-1760.6434,12.9662, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP5;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Marina.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP5)
    {
    SetPlayerCheckpoint(playerid, 1153.5178,-1714.3553,13.4061, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP6;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Conference Center.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP6)
    {
    SetPlayerCheckpoint(playerid, 1479.6708,-1735.2942,13.0075, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP7;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Commerce.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP7)
    {
    SetPlayerCheckpoint(playerid, 1442.5582,-1524.2251,13.0075, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP8;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Commerce.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP8)
    {
    SetPlayerCheckpoint(playerid, 1483.9996,-1065.5348,23.2813, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCPENDE;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Mulholland Intersection.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCPENDE)
    {
    new rand = 3000 + random(5000);
    Spieler[playerid][PayDayGeld] += rand;
    format(string, sizeof(string), "Die Fahrt ist nun zuende. Du hast $%d verdient und erhälst es am nächsten Zahltag.", rand);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Bus-Erfahrungspunkte sind um 5 aufgestiegen.");
    Spieler[playerid][BusExp] += 5;
    }
    }
    }
    }
    return 1;
    }
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist in keinem Bus.");
    buscd[playerid] = 11;
    KillTimer(bustimer[playerid]);
    return 1;
    }
    }
    return 1;
    }

  • geht noch immer nicht


    public BusCountdown(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    new string[128];
    if(Spieler[playerid][Job] == 2)
    {
    for(new i=0;i<sizeof(buscars);i++)
    {
    new vID = GetPlayerVehicleID(playerid);
    if(vID == buscars[i])
    {
    if(IsPlayerInCheckpoint(playerid))
    {
    if(buscd[playerid] == 11)
    {
    buscd[playerid] = 10;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~10", 500, 1);
    }
    else if(buscd[playerid] == 10)
    {
    buscd[playerid] = 9;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~9", 500, 1);
    }
    else if(buscd[playerid] == 9)
    {
    buscd[playerid] = 8;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~8", 500, 1);
    }
    else if(buscd[playerid] == 8)
    {
    buscd[playerid] = 7;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~7", 500, 1);
    }
    else if(buscd[playerid] == 7)
    {
    buscd[playerid] = 6;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~6", 500, 1);
    }
    else if(buscd[playerid] == 6)
    {
    buscd[playerid] = 5;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~5", 500, 1);
    }
    else if(buscd[playerid] == 5)
    {
    buscd[playerid] = 4;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~4", 500, 1);
    }
    else if(buscd[playerid] == 4)
    {
    buscd[playerid] = 3;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~3", 500, 1);
    }
    else if(buscd[playerid] == 3)
    {
    buscd[playerid] = 1;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~2", 500, 1);
    }
    else if(buscd[playerid] == 1)
    {
    buscd[playerid] = 0;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~1", 500, 1);
    if(pCP[playerid] == CHECKPOINT_BUSSTART)
    {
    SetPlayerCheckpoint(playerid, 1203.0599,-934.3010,42.3596, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP1;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Vinewood.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP1)
    {
    SetPlayerCheckpoint(playerid, 742.7133,-1393.4297,13.0455, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP2;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Vinewood - Intercars.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP2)
    {
    SetPlayerCheckpoint(playerid, 301.2852,-1397.0028,13.5145, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP3;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Rodeo.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP3)
    {
    SetPlayerCheckpoint(playerid, 354.8143,-1648.1133,32.4861, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP4;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Rodeo.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP4)
    {
    SetPlayerCheckpoint(playerid, 678.2159,-1760.6434,12.9662, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP5;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Marina.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP5)
    {
    SetPlayerCheckpoint(playerid, 1153.5178,-1714.3553,13.4061, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP6;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Conference Center.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP6)
    {
    SetPlayerCheckpoint(playerid, 1479.6708,-1735.2942,13.0075, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP7;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Commerce.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP7)
    {
    SetPlayerCheckpoint(playerid, 1442.5582,-1524.2251,13.0075, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP8;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Commerce.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP8)
    {
    SetPlayerCheckpoint(playerid, 1483.9996,-1065.5348,23.2813, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCPENDE;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Mulholland Intersection.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCPENDE)
    {
    new rand = 3000 + random(5000);
    Spieler[playerid][PayDayGeld] += rand;
    format(string, sizeof(string), "Die Fahrt ist nun zuende. Du hast $%d verdient und erhälst es am nächsten Zahltag.", rand);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Bus-Erfahrungspunkte sind um 5 aufgestiegen.");
    Spieler[playerid][BusExp] += 5;
    }
    }
    }
    }
    return 1;
    }
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist in keinem Bus.");
    buscd[playerid] = 11;
    KillTimer(bustimer[playerid]);
    return 1;
    }
    }
    return 1;
    }

  • Meine Glaskugel ist leider gerade kaputt. 8|
    Könntest du auch schildern, was genau nicht tut, bzw. was passiert wenn du was machst. Wird der Countdown angezeigt, kommt sonst irgendwas? Einfach alles was du weißt.


    Wenn gar nichts passiert: Wird der Timer überhaupt aufgerufen?

  • forward BusCountdown(playerid);


    if(dialogid==DIALOG_LINIE)
    {
    if(response)
    {
    if(listitem==0)
    {
    buscd[playerid] = 11;
    bustimer[playerid] = SetTimerEx("BusCountdown", 1000, 1, "i", playerid);
    pCP[playerid] = CHECKPOINT_BUSSTART;
    SetPlayerCheckpoint(playerid, 1203.0599,-934.3010,42.3596, 5.0);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Dienst gestartet! Linie: 1");
    }
    }
    else
    {
    return 1;
    }
    }

  • meint ihr das


    #define CHECKPOINT_BUSSTART 1025
    #define CHECKPOINT_BUSCP1 1026
    #define CHECKPOINT_BUSCP2 1027
    #define CHECKPOINT_BUSCP3 1028
    #define CHECKPOINT_BUSCP4 1029
    #define CHECKPOINT_BUSCP5 1030
    #define CHECKPOINT_BUSCP6 1031
    #define CHECKPOINT_BUSCP7 1032
    #define CHECKPOINT_BUSCP8 1033
    #define CHECKPOINT_BUSCPENDE 1034

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Alles klar, der Start des Timers stimmt. Ich bin nochmal alles Schritt für Schritt durchgegangen:


    Du musst das 3.
    return 1;
    von unten weg machen. Das beendet die Schleife nach einer Abfrage, was falsch ist.


    Code:

    Spoiler anzeigen
    public BusCountdown(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    new string[128];
    if(Spieler[playerid][Job] == 2)
    {
    for(new i=0;i<sizeof(buscars);i++)
    {
    new vID = GetPlayerVehicleID(playerid);
    if(vID == buscars[i])
    {
    if(IsPlayerInCheckpoint(playerid))
    {
    if(buscd[playerid] == 11)
    {
    buscd[playerid] = 10;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~10", 500, 1);
    }
    else if(buscd[playerid] == 10)
    {
    buscd[playerid] = 9;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~9", 500, 1);
    }
    else if(buscd[playerid] == 9)
    {
    buscd[playerid] = 8;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~8", 500, 1);
    }
    else if(buscd[playerid] == 8)
    {
    buscd[playerid] = 7;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~7", 500, 1);
    }
    else if(buscd[playerid] == 7)
    {
    buscd[playerid] = 6;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~6", 500, 1);
    }
    else if(buscd[playerid] == 6)
    {
    buscd[playerid] = 5;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~5", 500, 1);
    }
    else if(buscd[playerid] == 5)
    {
    buscd[playerid] = 4;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~4", 500, 1);
    }
    else if(buscd[playerid] == 4)
    {
    buscd[playerid] = 3;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~3", 500, 1);
    }
    else if(buscd[playerid] == 3)
    {
    buscd[playerid] = 1;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~2", 500, 1);
    }
    else if(buscd[playerid] == 1)
    {
    buscd[playerid] = 0;
    GameTextForPlayer(playerid, "~w~Warten ...~n~~b~1", 500, 1);
    if(pCP[playerid] == CHECKPOINT_BUSSTART)
    {
    SetPlayerCheckpoint(playerid, 1203.0599,-934.3010,42.3596, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP1;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Vinewood.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP1)
    {
    SetPlayerCheckpoint(playerid, 742.7133,-1393.4297,13.0455, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP2;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Vinewood - Intercars.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP2)
    {
    SetPlayerCheckpoint(playerid, 301.2852,-1397.0028,13.5145, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP3;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Rodeo.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP3)
    {
    SetPlayerCheckpoint(playerid, 354.8143,-1648.1133,32.4861, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP4;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Rodeo.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP4)
    {
    SetPlayerCheckpoint(playerid, 678.2159,-1760.6434,12.9662, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP5;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Marina.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP5)
    {
    SetPlayerCheckpoint(playerid, 1153.5178,-1714.3553,13.4061, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP6;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Conference Center.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP6)
    {
    SetPlayerCheckpoint(playerid, 1479.6708,-1735.2942,13.0075, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP7;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Commerce.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP7)
    {
    SetPlayerCheckpoint(playerid, 1442.5582,-1524.2251,13.0075, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCP8;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Commerce.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCP8)
    {
    SetPlayerCheckpoint(playerid, 1483.9996,-1065.5348,23.2813, 5.0);
    pCP[playerid] = CHECKPOINT_BUSCPENDE;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Nächste Haltestelle: Mulholland Intersection.");
    }
    else if(pCP[playerid] == CHECKPOINT_BUSCPENDE)
    {
    new rand = 3000 + random(5000);
    Spieler[playerid][PayDayGeld] += rand;
    format(string, sizeof(string), "Die Fahrt ist nun zuende. Du hast $%d verdient und erhälst es am nächsten Zahltag.", rand);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Bus-Erfahrungspunkte sind um 5 aufgestiegen.");
    Spieler[playerid][BusExp] += 5;
    }
    }
    }
    }
    }
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist in keinem Bus.");
    buscd[playerid] = 11;
    KillTimer(bustimer[playerid]);
    return 1;
    }
    }
    return 1;
    }