Jump to content
  • 0

Reaction


Ph0eniX

Question

Salutare , am o problema la reaction si nu stiu cum sa il rezolv...merge totu ok perfect dar cand un player scrie raspunsu...nu se intampla nimic

public OnPlayerText(playerid, text[])
{
	new str[128];
	if(Starts == true)
	{
	    if(TypeGame == 0) //Question
	    {
			if(strcmp(text, targetanswer, true) == 0)
			{
			    format(str, sizeof(str), "ANSWER: Player %s[%d] answer the question '%s' the answer is '%s'", pName(playerid), playerid, question, targetanswer);
				SendClientMessageToAll(COLOR_ORANGE, str);
				format(str, sizeof(str), "REACTIONTEST: Player %s[%d] wins '$%d + %d score'", pName(playerid), playerid, PRIZE_PER_CONTEST, PRIZE_PER_CONTEST_SCO);
				SendClientMessageToAll(COLOR_YELLOW, str);
				GivePlayerMoney(playerid, PRIZE_PER_CONTEST);
				SetPlayerScore(playerid, GetPlayerScore(playerid) + PRIZE_PER_CONTEST_SCO);
				Starts = false;
				TypeGame = -1;
				KillTimer(Timer);
				return 0;
			}
		}
	    if(TypeGame == 1) //Typing
	    {
			if(strcmp(text, targetword, true) == 0)
			{
				format(str, sizeof(str), "REACTIONTEST: Player %s[%d] wins '$%d + %d score' for typing '%s' as first", pName(playerid), playerid, PRIZE_PER_CONTEST, PRIZE_PER_CONTEST_SCO, targetword);
				SendClientMessageToAll(COLOR_YELLOW, str);
				GivePlayerMoney(playerid, PRIZE_PER_CONTEST);
				SetPlayerScore(playerid, GetPlayerScore(playerid) + PRIZE_PER_CONTEST_SCO);
				Starts = false;
				TypeGame = -1;
				KillTimer(Timer);
				return 0;
			}
		}
	}
	return 1;
}

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

#define  PRIZE_PER_CONTEST      1000
#define  PRIZE_PER_CONTEST_SCO  5

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Pune asta:

[pawn]#define  PRIZE_PER_CONTEST      5050

#define  PRIZE_PER_CONTEST_SCO  1[/pawn]

Nu fa asta...e o aberatie.

Sunt de parere ca ceva gresit e aici:

[pawn]    if(Starts == true)

    {

        if(TypeGame == 0) //Question

        {[/pawn]

sau la:

"targetanswer"

[glow=blue,2,300]SAMP.[glow=yellow,2,300]RSP-GAME[glow=red,2,300].NET[/glow][/glow][/glow]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.