[FilterScript] [FS] Reaction-Test
#21

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;/
Reply
#22

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

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.
Reply
#24

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
Reply
#25

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
Reply
#26

//EDIT: Dont work
Reply
#27

Awesome using at my server. +2 from me.
Reply
#28

Best Reaction test what i ever seen
Reply
#29

Simple and nice.
Reply
#30

Very Nice Thanks..
Cok Guzel Eline Saglık
Reply
#31

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..
Reply
#32

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;
}
Reply
#33

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
Reply
#34

Your Welcome!
Reply
#35

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

Great
Reply
#37

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

Nice!
Reply
#39

Change time will make bug ?
Reply
#40

Nice FilterScript.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)