Reaction test
#4

Or you can compare the value instead of string.
Like this.
pawn Код:
new reaction;
new reactionmoney;

OnPlayerText:
if(reaction == strval(text))
    {
    new string[128];
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), ""COL_BLUE"%s"COL_WHITE" won reaction test! Result: %d.", name,reaction);
    SendClientMessageToAll(COLOR_GRAY, string);
    SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
    sGivePlayerMoney(playerid, reactionmoney);
    }

public timer:
forward react();
public react()
{
new string[128];
reactionmoney = randomEx(1000, 3000);
new rand1 = randomEx(10, 99);
new rand2 = randomEx(10, 99);
new rand3 = randomEx(10, 99);
reaction = rand1+rand2+rand3;
format(string, sizeof(string), ""COL_WHITE"Reaction test | "COL_BLUE"%d - %d + %d "COL_WHITE"| "COL_BLUE"+1 score and $%d", rand1, rand2, rand3, reactionmoney);
SendClientMessageToAll(COLOR_GRAY, string);
return 1;
}
Reply


Messages In This Thread
Reaction test - by CroM256 - 08.03.2014, 15:02
Re: Reaction test - by RenovanZ - 08.03.2014, 15:07
Re: Reaction test - by CroM256 - 08.03.2014, 15:22
Re: Reaction test - by RenovanZ - 08.03.2014, 15:27
Re: Reaction test - by Matess - 08.03.2014, 15:27
Re: Reaction test - by Misiur - 08.03.2014, 15:28
Re: Reaction test - by CroM256 - 08.03.2014, 15:39

Forum Jump:


Users browsing this thread: 1 Guest(s)