SA-MP Forums Archive
/report - 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)
+--- Thread: /report (/showthread.php?tid=352667)



/report - lewismichaelbbc - 20.06.2012

I would like to make my /report system disallow players to type the name Lewis, Joe, or Sean in the text..

e.g, if a player types /report lewis please tp me - It tells the player that they are not allowed to use the name lewis in their report.

Код:
	if(strcmp(cmd, "/report", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(JustReported[playerid] == 1)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Wait 120 seconds to send another report ! ");
	            return 1;
	        }
	        GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[96];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [text]");
				return 1;
			}
			JustReported[playerid] = 1;
			SetTimerEx("ReportReset", 120000, false, "i", playerid);
			format(string, sizeof(string), "Report from %s [ReportID:[%d]]: %s",sendername, playerid, (result));
			reportsystem[playerid] = 1;
			ABroadCast(COLOR_LIGHTYELLOW,string,1);
			SendClientMessage(playerid, COLOR_YELLOW, "Your report message was sent to online administrators, thank you.");
	    }
	    return 1;
	}