SA-MP Forums Archive
Block IP's in chat - 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: Block IP's in chat (/showthread.php?tid=59425)



Block IP's in chat - Vetle - 26.12.2008

how can i block IP's in the chat? (OnPlayerText)


Re: Block IP's in chat - Backwardsman97 - 27.12.2008

I think he means like if someone is trying to advertise another server.


Re: Block IP's in chat - Serbish - 27.12.2008

I think he means that if an admin block some IP, the player isn't able to write anymore, something like /mute?


Re: Block IP's in chat - beatcat - 27.12.2008

I think he means that
Quote:
Originally Posted by backwardsman97
I think he means like if someone is trying to advertise another server.
Like make a little FS to if someone types an ip Ex: 11.111.111.111:1111
It would maybe kick them or ban them that why theres no advertisement on your server
Right?


Re: Block IP's in chat - Zezombia - 27.12.2008

pawn Код:
public OnPlayerText(playerid, text)
{
    if(new pos = strfind(".", text, true) == 0)
        if(pos = strfind(".", text, true, pos + 1) == 0)
            if(pos = strfind(".", text, true, pos + 1) == 0)
                if(pos = strfind(".", text, true, pos + 1) == 0)
                    if(pos = strfind(":", text, true, pos + 1) == 0)
                        return 0;
                    else return 1;
                else return 1;
            else return 1;
        else return 1;
    else return 1;
}
Nooo idea if that works.


Re: Block IP's in chat - beatcat - 27.12.2008

Ill try it give me a min.


Re: Block IP's in chat - Zezombia - 27.12.2008

Updated it a little :P.


Re: Block IP's in chat - beatcat - 27.12.2008

Nope didnt work sorry


Re: Block IP's in chat - Jason_Borne420 - 19.06.2009

none of that nonsense will work

this will :

Код:
new len=strlen(cmdtext);
		new bTest=0;
		for(new s=0;s<len;s++)
		{
		  if((cmdtext==46)&&(cmdtext[s+4]==46)&&(cmdtext[s+8]==46)) bTest=1;
		}
		if(PlayerAdminLevel[playerid] == 1337){
  		return 1;
  		}
  		if(bTest==0){ return 1;}
  		
		new gname[30];
  // 	new string[256];
	  new interi;
		interi = GetPlayerInterior(playerid);
	  new wep = GetPlayerWeapon(playerid);
	  GetPlayerName(playerid, gname, 30);
	  format(string, sizeof(string), "-ANTI ADVERTISE- **(AUTO BAN)** %s(%d) Has attempted to Advertise an IP address",gname,playerid);
	  SendClientMessageToAll(COLOR_RED, string);
  	//ircSay(EchoConnection, EchoChan,string);
    SendClientMessage(playerid,COLOR_RED,"YOU HAVE BEEN DETECTED AS AN ADVERTISER");
    SendClientMessage(playerid,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER");
    SendClientMessage(playerid,COLOR_RED,"If you think this is a mistake post an appeal at www.thematrixrpg.com");
    format(string, sizeof(string), "-ANTI ADVERTISE-**(AUTO BAN)** %s(%d) ADVERTISER Wep:[%d] Int:[%d]",gname,playerid,wep,interi);
    printf("%s", string);
    if(udb_Exists(PlayerName(playerid)) && PLAYERLIST_authed[playerid]) {
 		dUserSetINT(PlayerName(playerid)).("nameban",1);
	 	dUserSetINT(PlayerName(playerid)).("donater",0);
    SetPlayerInterior(playerid,10);
    SetPlayerPos(playerid,219.6257,111.2549,999.0156);
    SetPlayerFacingAngle(playerid,2.2339);
    SetCameraBehindPlayer(playerid);
    Banning[playerid] = 1;
    SetTimer("BanPlayer",700,0);
  		return 1;

		}
Even has an auto ban


Re: Block IP's in chat - Jason_Borne420 - 19.06.2009

actually you can comment out alot of that stuff because your server dont use it, and now that i look it will only work if it has all 3 digit numbers ex: xxx.xxx.xxx.xxx

illhave to get the cookie cutter and ill post another solutiion