problems with onplayertext
#1

hello, today i implented reaction test into my gamemode but it brought some problems to me with on playertext

i alreaddy had a script so when a player talks the id gets behind his name,but now it works when i restart the server but after the first reaction string comes up u can talk annymore for some reason

this is my script;
Код:
public OnPlayerText(playerid, text[])
{
		if(!IsPlayerConnected(playerid)) {
				new textstring[128];
			format(textstring, sizeof(textstring), "[%i] %s", playerid, text);
			SendPlayerMessageToAll(playerid, textstring);
}
	else if(!strcmp(text, reactionstr, false))
	{

 		KillTimer(stopper2);
		if(reactioninprog == 2) ReactionWin(playerid);

		if(reactioninprog == 1)
		{
			if(reactionwinnerid == playerid)
			{
			SendClientMessage(playerid,0x247C1BFF,"You've already won!");
			}
			else
			{
			SendClientMessage(playerid,0x247C1BFF,"You are too slow!");
			}
			}
			else
			{

  			return 1;
			}
	}

	return 0;
}
Reply
#2

if(!IsPlayerConnected(playerid)) {
new textstring[128];
format(textstring, sizeof(textstring), "[%i] %s", playerid, text);
SendPlayerMessageToAll(playerid, textstring);

the !IsPlayerConnect means that the player is not connected,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)