Countdown Problem

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
  • Wenn ich nun /gmx eingeben kommt nur 5 aber nicht 4 3 2 1 GMX wiso :o ?


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext, "/gmx", true) == 0)
    {
    if(isPlayerAnAdmin(playerid,2000))
    {
    SetTimer("countdown5",1000,false);
    GameTextForAll("~b~>>>~r~5~b~<<<",1000,4);
    return 1;
    }
    }


    forward countdown5();
    stock countdown5()
    {
    SetTimer("countdown4",1000,false);
    GameTextForAll("~b~>>>~r~4~b~<<<",1000,4);
    return 1;
    }


    forward countdown4();
    stock countdown4()
    {
    SetTimer("countdown3",1000,false);
    GameTextForAll("~b~>>>~r~3~b~<<<",1000,4);
    return 1;
    }


    forward countdown3();
    stock countdown3()
    {
    SetTimer("countdown2",1000,false);
    GameTextForAll("~b~>>>~r~2~b~<<<",1000,4);
    return 1;
    }


    forward countdown2();
    stock countdown2()
    {
    SetTimer("countdown1",1000,false);
    GameTextForAll("~b~>>>~r~1~b~<<<",1000,4);
    return 1;
    }


    forward countdown1();
    stock countdown1()
    {
    SetTimer("countdown0",1000,false);
    GameTextForAll("~b~>>>~r~0~b~<<<",1000,4);
    return 1;
    }


    forward countdown0();
    stock countdown0()
    {
    SetTimer("secondo3",1000,false);
    GameTextForAll("~b~>>>~g~GMX~b~<<<",1000,4);
    SendRconCommand ("gmx")
    return 1;
    }

  • stock countdown0()


    mach aus den stock ein public

  • du hast ja überall stock..... für den countdown verwendet so wie du es da gepostet hast mit jeden machen

  • Soweit ich es mal verstanden habe sind socks für einige sachen geeigene z.B. wenn du einen /stats befehl machst dann kannst du ein stock verwenden in den fall:
    ocmd:stats(playerid,params[])
    {
    showstats(playerid);
    return 1;
    }
    dann den stock so verwenden


    stock showstats(playerid)
    {
    //halt was kommen soll
    return 1;
    }


    bei einen publick ist es vom Prinzip auch so machbar aber bei einen Timer wie du ihn verwendet hat, ist es die Beste methode ein public zu nehmen und ein public musst du dafür auch forwarden