Reaction Test
#1

Hello, i have a problem/question.

I have a reaction test but i want if a player typ H9FS654 win 10000$ & 1 exp & the time ?
So like this:

Код:
Reactiontest: Who first typ H9FS654 win $10000,- and 1exp.
Playername has won the reactiontest in 19sec.
How make i this? thxyou



ps: iam a dutch guy, sorry for my bad english
Reply
#2

Please need help, sorry for dubble post
Reply
#3

erm!
Reply
#4

Quote:
Originally Posted by Steef v Trigt
Please need help, sorry for dubble post
Excuse you speak Spanish? It is that I do not understand your English to you :S
Reply
#5

Quote:
Originally Posted by kingworldsoft
Quote:
Originally Posted by Steef v Trigt
Please need help, sorry for dubble post
Excuse you speak Spanish? It is that I do not understand your English to you :S
me no no understand to to may you please make english speak good? i bad very english help need teacher english there out?? LMAO jk
Reply
#6

http://forum.sa-mp.com/index.php?topic=21359.0
pawn Код:
#include <a_samp>

#define time1 240000 //this is the 4 minute minimum gap time
#define time2 180000 // this is the 3 minute max addon time

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" ReactiontestFS by tomozj");
    print("--------------------------------------\n");
   
    SetTimer("ReactionTest",time1+random(time2),0);
   
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

new reactionstr[9]; //randomly generated string
new reactioninprog; //what status the reactiontest is at
new reactionwinnerid; //id of the current reactiontest winner
new reactiongap; //timer to restart ReactionTest()

forward ReactionTest();
forward ReactionWin(playerid);
forward SetBack();

public OnPlayerText(playerid, text[])
{
    if(!strcmp(text, reactionstr, false))
    {
        if(reactioninprog == 2) ReactionWin(playerid);
        if(reactioninprog == 1)
        {
            if(reactionwinnerid == playerid)
            {
            SendClientMessage(playerid,0x247C1BFF,"You already won!");
            }
            else
            {
            SendClientMessage(playerid,0x247C1BFF,"You are too slow!");
            }
        }
        return 1;
    }
   
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!IsPlayerAdmin(playerid)) return 0; // if player isn't admin, ignore cmds
   
    if (strcmp("/test", cmdtext, true, 10) == 0)
    {
        ReactionTest();
        return 1;
    }

    if (strcmp("/output reactionstr", cmdtext, true, 10) == 0)
    {
      new tmp[256];
        format(tmp,sizeof(tmp),"'reactionstr' output: %d",reactionstr);
      SendClientMessageToAll(0x247C1BFF,tmp);
      return 1;
    }
    return 0;
}

public ReactionTest()
{
    reactionstr = "";
    KillTimer(reactiongap);
    new str[256];
    new random_set[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; // the set of characters used for the generation of the string
    for (new i = 0; i < 8; i++)
        {
  reactionstr[i] = random_set[random(sizeof(random_set))];
        }
    reactioninprog = 2;
    format(str,sizeof(str),"** First who type %s get $10,000!",reactionstr); // announcement
    print(str);
    SendClientMessageToAll(0xFFFF00FF,str);
}

public ReactionWin(playerid)
{
    GivePlayerMoney(playerid, 10000);
    SetTimer("SetBack",30,0); // required delay, for some reason.
    new reactionwinner[256];
    reactionwinnerid = playerid;
    new tempstring[256];
    GetPlayerName(playerid,reactionwinner,sizeof(reactionwinner));
    format(tempstring,sizeof(tempstring),"%s has won on reaction!",reactionwinner);
    SendClientMessageToAll(0xFFFF00FF,tempstring);
    reactiongap = SetTimer("ReactionTest",time1+random(time2),0); // sets the timer to restart ReactionTest()
 }

public SetBack()
{
    reactioninprog = 1;
}
...:
1.Had to Post in Scripting Discussion
2.Use Search
Reply
#7

EDITED: NVM
Reply
#8

He means adding a timer to it so you know in what time a player has won a reactiontest. It's not in the script included. I have the same problem. So anyone can help?

P.S I'm Dutch too.

Quote:
Originally Posted by Steef v Trigt
sorry for dubble post
Should be 'sorry for double post'



Offtopic in Dutch:
Sorry, ik weet niet hoe je zo'n timer moet maken, dat probeer ik ook al maanden uit te zoeken :S
Reply
#9

LOL i am dutch too, but there stands nothing dutch in it, and I understand.

first:
above new things

forward message();

public message()
{
print("first who types H9FS654 wins 10000.");
}

add in OnPlayerCommandText the command:
H9FS654


SetTimer("message",10000,false); ten seconds to type command
GivePlayerMoney(playerid, 10000); gives player 10.000

It must be something I'm looking for you.
NL: Ben aan het kijken voor je.

EDIT:NL: hoe heet je XP? GivePlayerXP ofzoiets?
Reply
#10

Here is one:

http://forum.sa-mp.com/index.php?topic=21359.0

added 10.000 dollar wins.


Hier is er 1:

http://forum.sa-mp.com/index.php?topic=21359.0

zit al 10.000 dollar winst in.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)