Szerző Téma: Reaction test Timer  (Megtekintve 658 alkalommal)

Reaction test Timer
« Dátum: 2014. Június 15. - 18:04:46 »
0
Sziasztok!
Letöltöttem egy reakció teszt szkriptet..
 

    /*
            Release:
                    » Reaction-Test Filterscript
            Author:
                    » » RyDeR «
            Last Update:
                    » 25/05/2010
            ChangeLog:
                    » v0.1a:
                                    - Initial release
            Bugs:
                    » No bugs
            Version:
                            » v0.1a
            Functions:
                            » /
            Credits:
                    » /
    */
    #include <a_samp>
    #if !defined Loop
    #define Loop(%0,%1) \\
            for(new %0 = 0; %0 != %1; %0++)
    #endif
    #if !defined function
    #define function%0(%1) \\
            forward%0(%1); public%0(%1)
    #endif
    #if !defined PURPLE
    #define PURPLE \\
        0xBF60FFFF
    #endif
    #if !defined GREEN
    #define GREEN \\
        0x94D317FF
    #endif
    #if !defined TIME
    #define TIME \\
        180000
    #endif
    new
            xCharacters[][] =
            {
                \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\",
                    \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\",
                \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\",
                    \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\",
                \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"
            },
            xChars[16] = \"\",
            xReactionTimer,
            xCash,
            xScore,
            bool: xTestBusy
    ;
    public OnFilterScriptInit()
    {
            xReactionTimer = SetTimer(\"xReactionTest\", TIME, 1);
            return 1;
    }
    public OnFilterScriptExit()
    {
            KillTimer(xReactionTimer);
            return 1;
    }
    public OnPlayerText(playerid, text[])
    {
            switch(xTestBusy)
            {
                case true:
                {
                            if(!strcmp(xChars, text, false))
                            {
                                new
                                    string[128],
                                    pName[MAX_PLAYER_NAME]
                                    ;
                                GetPlayerName(playerid, pName, sizeof(pName));
                                format(string, sizeof(string), \"« \\%s\\\" megnyerte a reakciótesztet. »\", pName);
                                SendClientMessageToAll(GREEN, string);
                                format(string, sizeof(string), \"« Kaptál %d $-t és %d pontot. »\", xCash, xScore);
                                SendClientMessage(playerid, GREEN, string);
                                GivePlayerMoney(playerid, xCash);
                                SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
                                xReactionTimer = SetTimer(\"xReactionTest\", TIME, 1);
                                xTestBusy = false;
                            }
                    }
            }
            return 1;
    }
    function xReactionProgress()
    {
       switch(xTestBusy)
            {
                case true:
                {
                        new
                            string[128]
                            ;
                        format(string, sizeof(string), \"« Senki nem nyerte meg a reakciótesztet. Új %d perc mulva indul. »\", (TIME/370000));
                        SendClientMessageToAll(PURPLE, string);
                        xReactionTimer = SetTimer(\"xReactionTest\", TIME, 1);
           }
            }
       return 1;
    }
    function xReactionTest()
    {
            new
                    xLength = (random(8) + 2),
                    string[128]
            ;
            xCash = (random(10000) + 30000);
            xScore = (random(2)+1);
            format(xChars, sizeof(xChars), \"\");
            Loop(x, xLength) format(xChars, sizeof(xChars), \"%s%s\", xChars, xCharacters[random(sizeof(xCharacters))][0]);
            format(string, sizeof(string), \"« Reakció teszt! Aki elõsször beírja ezt: %s nyer %d $-t és %d pontot.»\", xChars, xCash, xScore);
            SendClientMessageToAll(PURPLE, string);
            KillTimer(xReactionTimer);
            xTestBusy = true;
            SetTimer(\"xReactionProgress\", 370000, 0);
            return 1;
    }

 
..Hogy lehetne megoldani,hogy 5 percenként írjon új tesztet ne 3 percenként?
Mert bármien számra is írom át a timereket..
 
SetTimer(\"xReactionProgress\", 370000, 0);

 

(TIME/370000));

 
Akkor is 3 percenként ír ki új tesztet
« Utoljára szerkesztve: 2014. Június 15. - 18:11:04 írta DragonSoul »

Nem elérhető KovaNovik

  • 1121
  • KovaNovik
    • Profil megtekintése
Reaction test Timer
« Válasz #1 Dátum: 2014. Június 15. - 18:14:41 »
0
#define TIME \\
       180000

 
helyett
 
#define TIME \\
       5*60*1000

 
Az elején lévõ számot cserélgetheted is.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal