Timer zwischen zeilen

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 folgende frage ist es möglich einen timer zumachen der zwischen den Zeilen geht das es wie beim autohotkey funktionier
    z.B for(new msg=0; msg<50; msg++) SendClientMessage(playerid,COLOR_WHITE," ");
    TogglePlayerControllable(playerid,0);
    GameTextForPlayer(playerid,"~w~WILLKOMMEN",5000,3);
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Willkommen bei der schnellen Fahrschule von Server xyz.");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Dir werden jetzt auf die Schnelle die Grundregeln beigebracht.Kurz gesagt: Die Straßenverkehrsordnung.");
    }
    else if(PruefungsSchritt[playerid] == 10)
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE," ");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Bei uns gilt meistens die 'Rechts vor Links Regel'. Es sei denn es ist mit Ampeln geregelt.");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Die Einzigen die diese Regeln missachten dürfen sind Staatsbeamte die im Dienst sind!");
    }
    else if(PruefungsSchritt[playerid] == 25)
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE," ");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," In der Stadt darfst du max. 80 fahren. Außerhalb gibt es keine Grenze.");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Sollte dir ein Beamter mit Sirene begegnen musst du diesem Platz machen");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," und ihn vorbei lassen.");
    }
    else if(PruefungsSchritt[playerid] == 40)
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE," ");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Solltest du in eine Verkehrskontrolle geraten musst du Rechts ranfahren");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," und dem Beamten deine Lizenzen zeigen. Dies Funktioniert mit /showlicenses oder /showperso.");
    }
    else if(PruefungsSchritt[playerid] == 58)
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE," ");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Damit dein Fahrzeug auch nicht sinnlos herumsteht und auch");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," nicht abgeschleppt wird, musst du es ordnungsgemäß parken.");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Park es am besten auf einem Parkplatz.");
    }
    else if(PruefungsSchritt[playerid] == 72)
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE," ");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Wir hoffen du hast dir alles gut gemerkt,");
    SendClientMessage(playerid,COLOR_LIGHTBLUE," Die Prüfung geht sofort los. Das Admin Team wünscht dir viel Glück");
    }
    else if(PruefungsSchritt[playerid] == 90)
    {
    ShowPlayerDialog(playerid,DIALOG_FRAGE1, DIALOG_STYLE_LIST, "Was machst du wenn ein Beamter dir mit Sirene Begegnet?","a) Ich fahre ganz normal weiter.\nb) Auf der Straße parken.\nc) Rechts ranfahren und vorbei lassen.\nd) Fenster runter und winken.","Auswählen","Abbrechen");
    KillTimer(PruefungsTimer[playerid]);
    } "); Dort wird auch immer zwischen durch eine pause gemacht von ca 5 secunden oder so und dann kann man das so für was anderes übernehmen?
    Danke schonmal im Forraus für die Antwort

  • Beim dem program autohotkey (wird offt als keybinder benutzt ) ein schleife erstellen z.b /m LSPD (danach eine pause von ca 5sec und dann weiter) /m Halten sie an


    Sowas in der richtung habe vor einen restart befehl einzu bauen mit countdown für die spieler
    habe schon was gemacht aber er sendet alles fast seitgleich ab und restartet dann


    Mfg

  • genau so habe ich es ein gefügt if(strcmp(cmd, "/restart", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] >=4)
    {
    GameTextForAll("~g~RESTART ~r~SERVERA ",10000,5);
    SendClientMessageToAll(0xFFFF00AA, " Der Server Restartet ");
    SendClientMessageToAll(0xFFFF00AA, " in 60sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 59sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 58sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 57sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 56sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 55sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 54sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 53sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 52sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 51sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 50sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 49sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 48sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 47sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 46sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 45sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 44sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 43sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 42sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 41sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 40sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 39sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 38sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 37sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 36sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 35sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 34sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 33sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 32sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 31sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 30sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 29sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 28sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 27sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 26sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 25sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 24sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 23sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 22sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 21sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 20sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 19sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 18sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 17sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 16sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 15sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 14sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 13sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 12sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 11sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 10sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 9sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 8sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 7sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 6sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 5sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 4sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 3sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 2sec ");
    SendClientMessageToAll(0xFFFF00AA, " in 1sec ");
    SendClientMessageToAll(0xFFFF00AA, " Reallife Trucking startet neu wir sind gleich wieder da ");
    SendRconCommand("gmx");
    }
    return 1;
    }


  • forward restart();
    new RT;


    if(strcmp(cmd, "/restart", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] >=4)
    {
    SetTimer("restart",1000*1,true);
    RT =60;
    }
    return 1;
    }
    public restart()
    {
    if(RT == 60)
    {
    SendClientMessage
    RT =59;
    }
    else if(RT == 59)
    {
    //usw
    }
    return 1;
    }


  • es klapt nicht der sagt mir habe da ein klammerfehler habe es mehr mals überprüft aber nix gefunden habe es so eingefügt
    if(strcmp(cmd, "/restart", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] >=4)
    {
    SetTimer("restart",1000*1,true);
    RT =61;
    }
    else
    {
    SendClientMessage(playerid, 0xAA3333AA ," Du bist nicht Befugt den Server neu zu Starten");
    }
    return 1;
    }
    public restart()
    {
    if(RT == 61)
    {
    SendClientMessageToAll(0xFFFF00AA, " Achtung Server-Restart");
    }
    RT =60;
    else if(RT == 60)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 60 Sekunden");
    }
    RT =59;
    else if(RT == 59)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 59 Sekunden");
    }
    RT =58;
    else if(RT == 58)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 58 Sekunden");
    }
    RT =57;
    else if(RT == 57)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 57 Sekunden");
    }
    RT =56;
    else if(RT == 56)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 56 Sekunden");
    }
    RT =55;
    else if(RT == 55)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 55 Sekunden");
    }
    RT =54;
    else if(RT == 54)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 54 Sekunden");
    }
    RT =53;
    else if(RT == 53)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 53 Sekunden");
    }
    RT =52;
    else if(RT == 52)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 52 Sekunden");
    }
    RT =51;
    else if(RT == 51)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 51 Sekunden");
    }
    RT =50;
    else if(RT == 50)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 50 Sekunden");
    }
    RT =49;
    else if(RT == 49)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 49 Sekunden");
    }
    RT =48;
    else if(RT == 48)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 48 Sekunden");
    }
    RT =47;
    else if(RT == 47)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 47 Sekunden");
    }
    RT =46;
    else if(RT == 46)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 46 Sekunden");
    }
    RT =45;
    else if(RT == 45)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 45 Sekunden");
    }
    RT =44;
    else if(RT == 44)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 44 Sekunden");
    }
    RT =43;
    else if(RT == 43)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 43 Sekunden");
    }
    RT =42;
    else if(RT == 42)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 42 Sekunden");
    }
    RT =41;
    else if(RT == 41)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 41 Sekunden");
    }
    RT =40;
    else if(RT == 40)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 40 Sekunden");
    }
    RT =39;
    else if(RT == 39)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 38 Sekunden");
    }
    RT =38;
    else if(RT == 38)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 38 Sekunden");
    }
    RT =37;
    else if(RT == 37)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 37 Sekunden");
    }
    RT =36;
    else if(RT == 36)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 36 Sekunden");
    }
    RT =35;
    else if(RT == 35)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 35 Sekunden");
    }
    RT =34;
    else if(RT == 34)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 34 Sekunden");
    }
    RT =33;
    else if(RT == 33)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 33 Sekunden");
    }
    RT =32;
    else if(RT == 32)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 32 Sekunden");
    }
    RT =31;
    else if(RT == 31)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 31 Sekunden");
    }
    RT =30;
    else if(RT == 30)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 30 Sekunden");
    }
    RT =29;
    else if(RT == 29)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 29 Sekunden");
    }
    RT =28;
    else if(RT == 28)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 28 Sekunden");
    }
    RT =27;
    else if(RT == 27)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 27 Sekunden");
    }
    RT =26;
    else if(RT == 26)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 26 Sekunden");
    }
    RT =25;
    else if(RT == 25)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 25 Sekunden");
    }
    RT =24;
    else if(RT == 24)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 24 Sekunden");
    }
    RT =23;
    else if(RT == 23)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 23 Sekunden");
    }
    RT =22;
    else if(RT == 22)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 22 Sekunden");
    }
    RT =21;
    else if(RT == 21)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 21 Sekunden");
    }
    RT =20;
    else if(RT == 20)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 20 Sekunden");
    }
    RT =19;
    else if(RT == 19)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 19 Sekunden");
    }
    RT =18;
    else if(RT == 18)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 18 Sekunden");
    }
    RT =17;
    else if(RT == 17)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 17 Sekunden");
    }
    RT =16;
    else if(RT == 16)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 16 Sekunden");
    }
    RT =15;
    else if(RT == 15)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 15 Sekunden");
    }
    RT =14;
    else if(RT == 14)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 14 Sekunden");
    }
    RT =13;
    else if(RT == 13)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 13 Sekunden");
    }
    RT =12;
    else if(RT == 12)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 12 Sekunden");
    }
    RT =11;
    else if(RT == 11)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 11 Sekunden");
    }
    RT =10;
    else if(RT == 10)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 10 Sekunden");
    }
    RT =9;
    else if(RT == 9)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 9 Sekunden");
    }
    RT =8;
    else if(RT == 8)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 8 Sekunden");
    }
    RT =7;
    else if(RT == 7)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 7 Sekunden");
    }
    RT =6;
    else if(RT == 6)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 6 Sekunden");
    }
    RT =5;
    else if(RT == 5)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 5 Sekunden");
    }
    RT =4;
    else if(RT == 4)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 4 Sekunden");
    }
    RT =3;
    else if(RT == 3)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 3 Sekunden");
    }
    RT =2;
    else if(RT == 2)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 2 Sekunden");
    }
    RT =1;
    else if(RT == 1)
    {
    SendClientMessageToAll(0xFFFF00AA, "Server-Restart in 1Sekunden");
    }
    RT =0;
    else if(RT == 0)
    {
    SendClientMessageToAll(0xFFFF00AA, "Reallife Trucking Startet Neu und ist Gleich wieder Ereichbar");
    SendRconCommand("gmx");
    }
    return 1;
    }

    wer ne idee?

    Einmal editiert, zuletzt von Mareck ()

  • fast 330 zeilen für so ne kleinigkeit :D
    habs mal ein bisschen optimiert und habs auch getestet.



    new RT;
    if(strcmp(cmd, "/restart", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] <4)return SendClientMessage(playerid, 0xAA3333AA ," Du bist nicht Befugt den Server neu zu Starten");
    else return RT=61,SetTimer("restart",1000,1);
    }
    forward restart();public restart()
    {
    RT-=1;
    switch(RT)
    {
    case 60:return SendClientMessageToAll(0xFFFF00AA, " Achtung Server-Restart");
    case 1..59:return format(stringbert,128,"Server-Restart in %i Sekunden",RT),SendClientMessageToAll(0xFFFF00AA,stringbert);
    case 0:return SendClientMessageToAll(0xFFFF00AA, "Reallife Trucking Startet Neu und ist Gleich wieder Ereichbar"),SendRconCommand("gmx");
    }
    return 1;
    }