SA-MP Forums Archive
problems with onplayertext - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: problems with onplayertext (/showthread.php?tid=149064)



problems with onplayertext - swredder - 20.05.2010

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;
}



Re: problems with onplayertext - Sascha - 20.05.2010

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,