SA-MP Forums Archive
Reaction Test Poblem?? [I Give +REP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Reaction Test Poblem?? [I Give +REP] (/showthread.php?tid=404317)



Reaction Test Poblem?? [I Give +REP] - ThePrograme - 02.01.2013

Ok i have this reaction test but i have a problem. The problem is that when te reaction test is over you can stll win it.
pawn Код:
#include <a_samp>
#define blue2                   0x0247FEFF

#if !defined function
#define function%0(%1) \
    forward%0(%1); public%0(%1)
#endif

#if !defined Loop
#define Loop(%0,%1) \
    for(new %0 = 0; %0 != %1; %0++)
#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
;

function xReactionProgress()
{
    switch(xTestBusy)
    {
        case true:
        {
            new
                string[128]
            ;
            format(string, sizeof(string), "[REACTION TEST] : No One Manage To Win The Reaction Test. New One Starting In %d Minutes.", (TIME/60000));
            SendClientMessageToAll(blue2, string);
            xReactionTimer = SetTimer("xReactionTest", TIME, 1);
        }
    }
    return 1;
}

function xReactionTest()
{
    new
        xLength = (random(5) + 3),
        string[128]
    ;
    xCash = (random(1000) + 9000);
    xScore = (random(2) + 3);
    format(xChars, sizeof(xChars), "");
    Loop(x, xLength) format(xChars, sizeof(xChars), "%s%s%s%s%s%s%s%s", xChars, xCharacters[random(sizeof(xCharacters))][0], xCharacters[random(sizeof(xCharacters))][0], xCharacters[random(sizeof(xCharacters))][0], xCharacters[random(sizeof(xCharacters))][0], xCharacters[random(sizeof(xCharacters))][0], xCharacters[random(sizeof(xCharacters))][0], xCharacters[random(sizeof(xCharacters))][0]);
    format(string, sizeof(string), "[REACTION TEST] : Who First Types %s Wins $%d With %d Score!", xChars, xCash, xScore);
    SendClientMessageToAll(blue2, string);
    KillTimer(xReactionTimer);
    xTestBusy = true;
    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), "[REACTION TEST] : %s (%i) Has Won And Earned $%d With %d Score!", pName, playerid, xCash, xScore);
                SendClientMessageToAll(blue2, string);
                GivePlayerMoney(playerid, xCash);
                SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
                xReactionTimer = SetTimer("xReactionTest", TIME, 1);
                xTestBusy = false;
                return false;
            }
            return true;
        }
    }
    return 0;
}



Re: Reaction Test Poblem?? [I Give +REP] - aslan890 - 02.01.2013

You can use Ryder reaction test its better,
https://sampforum.blast.hk/showthread.php?tid=150274


Re: Reaction Test Poblem?? [I Give +REP] - ThePrograme - 02.01.2013

No i want to use this one. Can anyone help me


Re: Reaction Test Poblem?? [I Give +REP] - mastermax7777 - 02.01.2013

tell us whats happening.. or just debug the shit out of it.... ryders looks the same to me


Re: Reaction Test Poblem?? [I Give +REP] - aslan890 - 02.01.2013

Did you join the server as a [GM] i mean admin or just player because i got similar problem like when i join my server as a admin i still win when i don't type anything but others can't, in your one is it same?


Re: Reaction Test Poblem?? [I Give +REP] - aslan890 - 02.01.2013

Quote:
Originally Posted by mastermax7777
Посмотреть сообщение
tell us whats happening.. or just debug the shit out of it.... ryders looks the same to me
Ryder one is like still admin can win but others can't when they don't type anything


Re: Reaction Test Poblem?? [I Give +REP] - ThePrograme - 02.01.2013

Look every one has the same problem. when it says No One Manage To Win The Reaction Test.
I can still type the word it was and i win. And this is the ryders i modifyed it a little!


Re: Reaction Test Poblem?? [I Give +REP] - RedCrossER - 02.01.2013

xTestBusy = true;
Paste before killing time? Or make it false.