Reaction test
#1

Hi, i have problem with reaction test...Everything is fine until I have to write correct answer...example 55+12-45
and i type 22 and nothing happens...
Код:
new reaction;
new reactionmoney;
new result[128];

OnPlayerText:
if(strfind(text, result, true) != -1)
    {
	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(result, sizeof(result), "%d", reaction);
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;
}

ongamemodeinit:
SetTimer("react", 20000, true);
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)