Countdown

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
  • Hey,
    Ich habe ein Gate und ich möchte sobald das Gate aufgeht das ein Countdown von 10 Sekunden gestartet wird.
    Hat jemand nen Code für mich für einen Countdown?
    Bitte ;)
    Danke im vorraus :love:

  • forward CountDown10();
    forward CountDown9();
    forward CountDown8();
    forward CountDown7();
    forward CountDown6();
    forward CountDown5();
    forward CountDown4();
    forward CountDown3();
    forward CountDown2();
    forward CountDown1();
    forward CountDownLos();


    //-----------------------------------------Countdown--------------------------------------------
    if(strcmp("/countdown",cmdtext,true) == 0)
    {
    if (PlayerInfo[playerid][pAdmin] >= 1337) SetTimer("CountDown10",1000,0);
    else SendClientMessage(playerid,COLOR_RED,"Du kannst keinen Countdown sarten!");
    return 1;
    }


    - - - - -- -- -- - - -- - -- -
    public CountDown10()
    {
    GameTextForAll("~w~10",1000,0);
    SetTimer("CountDown4",1000,0);
    return 1;
    }


    public CountDown9()
    {
    GameTextForAll("~w~9",1000,0);
    SetTimer("CountDown3",1000,0);
    return 1;
    }


    public CountDown8()
    {
    GameTextForAll("~w~8",1000,0);
    SetTimer("CountDown2",1000,0);
    return 1;
    }


    public CountDown7()
    {
    GameTextForAll("~w~7",1000,0);
    SetTimer("CountDown1",1000,0);
    return 1;
    }


    public CountDown6()
    {
    GameTextForAll("~w~6",1000,0);
    SetTimer("CountDownLos",1000,0);
    return 1;
    }


    public CountDown5()
    {
    GameTextForAll("~w~5",1000,0);
    SetTimer("CountDown4",1000,0);
    return 1;
    }


    public CountDown4()
    {
    GameTextForAll("~w~4",1000,0);
    SetTimer("CountDown3",1000,0);
    return 1;
    }


    public CountDown3()
    {
    GameTextForAll("~w~3",1000,0);
    SetTimer("CountDown2",1000,0);
    return 1;
    }


    public CountDown2()
    {
    GameTextForAll("~w~2",1000,0);
    SetTimer("CountDown1",1000,0);
    return 1;
    }


    public CountDown1()
    {
    GameTextForAll("~w~1",1000,0);
    SetTimer("CountDownLos",1000,0);
    return 1;
    }


    public CountDownLos()
    {
    GameTextForAll("~g~] ! GO GO GO !! ]",1000,0);
    return 1;
    }


    Da ist der Countdown an sicht, weis nicht ob so funzt un ob dir weiterhilft

  • Fabi, leider muss ich sagen das mir dein Code etwas ineffizient vorkommt. Der Commandteil habe ich fast so wie deinen Gelassen:


    Ich habe eine Variabele mehr Definiert:

    Code
    forward CountDown();
    new Zahl;


    Und nur einen Timer gemacht:


    Habe den Code ebenfalls nicht getestet.


    Stratege993

    Signatur:
    Hier findest du viele nützliche Infos!

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