SA-MP Forums Archive
[FilterScript] [FS] Reaction-Test - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS] Reaction-Test (/showthread.php?tid=150274)

Pages: 1 2 3


Re: [FS] Reaction-Test - AndriusZ* - 14.09.2010

Quote:

function xReactionTest()
{
new
xLength = (random( + 2),
string[128]
;
xCash = (random(5000) + 10000);
xScore = (random(5)+10);
format(xChars, sizeof(xChars), "");
Loop(x, xLength) format(xChars, sizeof(xChars), "%s%s", xChars, xCharacters[random(sizeof(xCharacters))][0]);
format(string, sizeof(string), "GangWars: Kas pirmas paraрys %s laimлs %d$ + %d patirties taрkш.", xChars, xCash, xScore);
SendClientMessageToAll(PURPLE, string);
KillTimer(xReactionTimer);
xTestBusy = true;
SetTimer("xReactionProgress", 30000, 0);
return 1;
}

and im get crash for this;/


Re: [FS] Reaction-Test - Stigg - 14.09.2010

Great script, just 1 question.
Is there any way to make this do random words ?


Re: [FS] Reaction-Test - RyDeR` - 14.09.2010

Quote:
Originally Posted by AndriusZ*
Посмотреть сообщение
and im get crash for this;/
Unpossible. That piece just works perfect.

But, just wait for the new version; I just got back from school - When I'm done with my work, I'll update.

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Great script, just 1 question.
Is there any way to make this do random words ?
Sure, even easier then the current version. But I don't think it's a good idea.


Re: [FS] Reaction-Test - ColdXX - 15.09.2010

Quote:
Originally Posted by RyDeR`
Посмотреть сообщение
Can be, I made this script real quickly..

Anyway, I was working on a new, optimised and a quicker version. And it's doesn't only have Reaction test but also others like maths etc..

I'll let something know when it's done.
Ok cool!
Would be awesome if you could do a Questioning System!
There r only few on sa:mp.com and not so good !
U could break the ice :P


Re: [FS] Reaction-Test - royal_king - 15.09.2010

lol this has some bug which spams alot at some times i know this because i have used this on my server
plz try to fix that :S
anyway its nice one only that bug found for me


AW: [FS] Reaction-Test - Numb3rs - 19.01.2011

//EDIT: Dont work


Re: [FS] Reaction-Test - Davz*|*Criss - 31.01.2011

Awesome using at my server. +2 from me.


Re: [FS] Reaction-Test - Negat1Ve - 03.02.2011

Best Reaction test what i ever seen


Re: [FS] Reaction-Test - KotoK - 03.02.2011

Simple and nice.


Re: [FS] Reaction-Test - oFLu - 14.08.2011

Very Nice Thanks..
Cok Guzel Eline Saglık


Re: [FS] Reaction-Test - Astralis - 20.11.2011

pawn Code:
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(95) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(97) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(101) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(103) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(119) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(120) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(121) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(124) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


8 Warnings.
bump..


Re: [FS] Reaction-Test - Kostas' - 20.11.2011

Quote:
Originally Posted by Neonman
View Post
pawn Code:
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(95) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(97) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(101) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(103) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(119) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(120) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(121) : warning 217: loose indentation
C:\Documents and Settings\Ad05n\Desktop\Rtest.pwn(124) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


8 Warnings.
bump..
This should fix the indentation
pawn Code:
/*
    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\" has won the reaction test. »", pName);
                SendClientMessageToAll(GREEN, string);
                format(string, sizeof(string), "« You have earned $%d + %d score points. »", 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), "« No-one won the reaction-test. New one starting in %d minutes. »", (TIME/60000));
            SendClientMessageToAll(PURPLE, string);
            xReactionTimer = SetTimer("xReactionTest", TIME, 1);
        }
    }
    return 1;
}


function xReactionTest()
{
    new
        xLength = (random(8) + 2),
        string[128]
        ;
    xCash = (random(10000) + 20000);
    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), "« Who first types %s wins $%d + %d score points. »", xChars, xCash, xScore);
    SendClientMessageToAll(PURPLE, string);
    KillTimer(xReactionTimer);
    xTestBusy = true;
    SetTimer("xReactionProgress", 30000, 0);
    return 1;
}



Re: [FS] Reaction-Test - Astralis - 20.11.2011

Quote:
Originally Posted by Kostas'
View Post
This should fix the indentation
pawn Code:
/*
    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\" has won the reaction test. »", pName);
                SendClientMessageToAll(GREEN, string);
                format(string, sizeof(string), "« You have earned $%d + %d score points. »", 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), "« No-one won the reaction-test. New one starting in %d minutes. »", (TIME/60000));
            SendClientMessageToAll(PURPLE, string);
            xReactionTimer = SetTimer("xReactionTest", TIME, 1);
        }
    }
    return 1;
}


function xReactionTest()
{
    new
        xLength = (random(8) + 2),
        string[128]
        ;
    xCash = (random(10000) + 20000);
    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), "« Who first types %s wins $%d + %d score points. »", xChars, xCash, xScore);
    SendClientMessageToAll(PURPLE, string);
    KillTimer(xReactionTimer);
    xTestBusy = true;
    SetTimer("xReactionProgress", 30000, 0);
    return 1;
}
Thanks now working

+rep'ed


Re: [FS] Reaction-Test - Kostas' - 20.11.2011

Your Welcome!


Re: [FS] Reaction-Test - saikumar - 27.04.2014

is there anyway to hide the text(reaction) if player wins the reaction test?


Re: [FS] Reaction-Test - GeasyW - 27.04.2014

Great


Re: [FS] Reaction-Test - Ghazal - 04.05.2014

I am coming with a new suggestion.
It should be Playername has won the reaction in %i seconds
I hope it will be added ;]


Re: [FS] Reaction-Test - iRaiDeN - 04.05.2014

Nice!


Re: [FS] Reaction-Test - VenomMancer - 23.03.2015

Change time will make bug ?


Re: [FS] Reaction-Test - mirza1221 - 25.03.2015

Nice FilterScript.