[FILTERSCRIPT WUNSCH] Countdown System

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
  • Hei

    Ich habe Jetzt ein basejump Server...

    Und wenn Leute ein Video machen wollen fehlt ihn der CMD=Countdown


    Ich Wollte daher Fragen ob einer ein Filterscript dazu hat. Ich Möchte keine Tutorials!!!

    Also der Player Sollte /countdown um ein Countdown auszuführen...

    Der CMD sollte nur von 5 Sekunden auf 0 Laufen und bei 0 Sollte nicht 0 Stehen sondern GO!


    Also so

    5...

    4...

    3...

    2...

    1...

    GO!!


    ------------------------------------------------------

    !Ich Hoffe ihr könnt mir helfen!

    LG ICH *-* :love:

  • ocmd:countdown(playerid,cmdtext[])
    {
    SetTimer("countdown4");
    GameTextForAll( "5", 1000, 4);
    reuturn 1;
    }
    forward countdown4();
    forward countdown3();
    forward countdown2();
    forward countdown1();
    forward countdowngo();
    public countdown4(){SetTimer("countdown3"); GameTextForAll( "4...", 1000, 4);}
    public countdown3(){SetTimer("countdown2"); GameTextForAll( "3...", 1000, 4);}
    public countdown2(){SetTimer("countdown1"); GameTextForAll( "2...", 1000, 4);}
    public countdown1(){SetTimer("countdowngo"); GameTextForAll( "1...", 1000, 4);}
    public countdowngo()GameTextForAll( "GO!!", 1000, 4);

    vllt klappts ja, musst mal testen, ich benutze ocmd, kannst auch dcmd benutzen

  • geht auch kleiner :D


    new countdown;
    new countdowntimer;


    ocmd:countdown(playerid,cmdtext[])
    {
    countdowntimer = SetTimer("countdown", TIME, 1);
    return 1;
    }
    forward countdown();
    public countdown()
    {
    if(countdown == 1){
    GameTextForAll( "3...", 1000, 4);
    }else if(countdown == 2){
    GameTextForAll( "3...", 1000, 4);
    }else if(countdown == 3){
    GameTextForAll( "2...", 1000, 4);
    }else if(countdown == 4){
    GameTextForAll("1...", 1000, 4);
    }else if(countdown == 5){
    GameTextForAll("Goooo Goooo", 1000, 4);
    KillTimer(countdowntimer);
    }
    }


  • forward countdown();
    new countdown;
    new cttimer;


    if(strcmp("/countdown", cmdtext, true) == 0)
    {
    cttimer =SetTimer("countdown", 1000, 1);
    GameTextForAll( "~>~~y~5~<~", 1000, 4);
    countdown = 0;
    return 1;
    }


    public countdown()
    {
    if(countdown == 0)
    {
    GameTextForAll( "~>~~b~4~<~", 1000, 4);
    countdown = 1;
    }
    if(countdown == 1)
    {
    GameTextForAll( "~>~~b~3~<~", 1000, 4);
    countdown = 2;
    }
    if(countdown == 2)
    {
    GameTextForAll( "~>~~b~2~<~", 1000, 4);
    countdown = 3;
    }
    if(countdown == 3)
    {
    GameTextForAll( "~>~~b~1~<~", 1000, 4);
    countdown = 4;
    }
    if(countdown == 4)
    {
    GameTextForAll( "~>~~>~~y~!!!~b~GO~y~!!!~<~~<~", 1000, 4);
    countdown = 1;
    Killtimer(cttimer);
    }


    }



    eine verbesserte Version (stylischer :D und besser)


    Bedanke dich bitte, wenn du den Beitrag als hilfreich empfandest!



    Einmal editiert, zuletzt von ToBee94 ()


  • Resourcen fressener weil du jedes mal ein neun Timer machst.

  • Habs ja auch über arbeitet:



    Bedanke dich bitte, wenn du den Beitrag als hilfreich empfandest!



  • Warum so umständlich?


    Variable erstellen:


    new count;


    Forward:


    forward Timer();


    Timer starten:


    SetTimer("Timer",1000,true);


    Befehl erstellen:


    if(strcmp("/countdown", cmdtext, true) == 0)
    {
    count = 30; // anpassen.
    SendClientMessage(playerid,farbe,"Countdown gestartet.");
    return 1;
    }


    Public erstellen:


    public Timer()
    {
    if(count > 1)
    {
    count --;
    new str[3];
    format(str,3,"%d",count);
    GameTextForAll( str, 1000, 4);
    }
    if(count == 1)
    {
    count = 0;
    SendClientMessageToAll(farbe,"Go!");
    }
    return 1;
    }


    LG.


    (e: Text)
    (e: FS aus Langeweile xD)

    Einmal editiert, zuletzt von pwnfl4sh ()

  • Noch optimierter:


    new count;
    forward Timer();
    forward timertimer();


    //unter onplayercommand text
    if(strcmp("/countdown", cmdtext, true) == 0)
    {
    count = 5; // anpassen.
    SendClientMessage(playerid,farbe,"Countdown gestartet.");
    timertimer = SetTimer("Timer",1000,false);
    return 1;
    }


    //irgendwo ins script
    public Timer()
    {
    count --;
    new str[2];
    format(str,2,"%d",count);
    GameTextForAll( str, 1000, 4);
    if(count == 1)
    {
    SendClientMessageToAll(farbe,"Go!");
    KillTimer(timertimer);
    }
    return 1;
    }

  • Warum öffnest du dann ein Thema wenn du es eh von einer anderen Seite bekommst -.- ?

  • Kann man auch einen Timer machen als Textdraw?
    Von 60 auf 0? Bitte


    new Text:Sekunden[MAX_PLAYERS];


    Sekunden[i] = TextDrawCreate(339.000000,1.000000,"--");
    TextDrawAlignment(Sekunden[i],0);
    TextDrawBackgroundColor(Sekunden[i],0x0000ffff);
    TextDrawFont(Sekunden[i],2);
    TextDrawLetterSize(Sekunden[i],0.299999,1.800000);
    TextDrawColor(Sekunden[i],0x00ff00ff);
    TextDrawSetProportional(Sekunden[i],1);
    TextDrawSetShadow(Sekunden[i],1);


    ..
    Wie kann ich daraus einen Timer bilden der von 60 abläuft und wenn er abgelaufen ist wieder von 60 anfängt?
    Ich hoffe ihr wisst worauf ich hin naus will :D Auf eine Minuten/Sekunden Anzeige in Form von 10:00 -> 9:59 > 9:58 usw.
    Aber ich denke, ich brauche für's erste nur die Hilfe bei der Sekunden Anzeige. Die Minuten Anzeige mache ich dann später genau so.

    KleineHilfe 2.0