SA-MP Forums Archive
[Help] Anti spam - 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: [Help] Anti spam (/showthread.php?tid=264329)



[Help] Anti spam - GunFight - 25.06.2011

This works

Код:
	if (realchat)
	{
		new string [128];
		new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Says %s", sendername, text);
		ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		return 0;
	}
	if(GetPVarInt(playerid,"textspam") == 5) {
		new string[128];
		new tname[MAX_PLAYER_NAME];
		GetPlayerName(playerid,tname,sizeof(tname));
		format(string,sizeof(string),"AdmCmd: %s was kicked by bot.. spamming", tname,playerid);
		SendClientMessageToAll(COLOR_RED,string);
  		CallRemoteFunction("KickIncrease","d",playerid);
		Kick(playerid);
	}
	return 1;
}
And this dont works:

Код:
	if (realchat == 0)
	{
		new string [128];
		new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "[%i] %s: %s", playerid, sendername, text);
		SendClientMessageToAll(GetPlayerColor(playerid),string);
		return 0;
	}
	if (realchat == 1)
	{
		new string [128];
		new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Says %s", sendername, text);
		ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		return 0;
	}
	if(GetPVarInt(playerid,"textspam") == 5) {
		new string[128];
		new tname[MAX_PLAYER_NAME];
		GetPlayerName(playerid,tname,sizeof(tname));
		format(string,sizeof(string),"AdmCmd: %s was kicked by Bot.. spamming", tname,playerid);
		SendClientMessageToAll(COLOR_RED,string);
  		CallRemoteFunction("KickIncrease","d",playerid);
		Kick(playerid);
	}
	return 1;
}
I need that 2nd one because it showing the id of the player in main chat.. but then the spam kicker dont works