Anti text spam
#9

Quote:
Originally Posted by Affan
Посмотреть сообщение
Код:
new LastMsg[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
	LastMsg[playerid] = 0;
}

public OnPlayerText(playerid, text[]) 
{
	if(strfind(LastText[playerid], text, false) != -1)
	{
		LastMsg[playerid]++;
		if(LastMsg[playerid] >= 2) // If he repeats it twice
		{
			SendClientMessage(playerid, COLOR_RED, "Don't repeat your message.");
			return false;
		}
		else
			LastMsg[playerid] = 0;
		strmid(LastText[playerid], text, 0, strlen(text), sizeof(LastText[]));
	}
}
Where did you define LastText ... ?
Reply


Messages In This Thread
Anti text spam - by iLearner - 20.08.2016, 14:02
Re: Anti text spam - by Shinja - 20.08.2016, 14:15
Re: Anti text spam - by iLearner - 20.08.2016, 14:44
Re: Anti text spam - by SyS - 20.08.2016, 14:53
Re: Anti text spam - by oMa37 - 20.08.2016, 14:59
Re: Anti text spam - by Affan - 20.08.2016, 15:05
Re: Anti text spam - by Shinja - 20.08.2016, 15:20
Re: Anti text spam - by Jefff - 20.08.2016, 15:21
Re: Anti text spam - by iLearner - 21.08.2016, 10:43
Re: Anti text spam - by Shinja - 21.08.2016, 12:59

Forum Jump:


Users browsing this thread: 1 Guest(s)